"use strict";(self.webpackChunkknx_frontend=self.webpackChunkknx_frontend||[]).push([[8353,3599],{83599:function(e,r,t){t.r(r),t.d(r,{HaQrCode:function(){return y}});var n,a,i,o=t(6238),d=t(36683),c=t(89231),s=t(29864),l=t(83647),u=t(8364),h=t(27526),v=(t(77052),t(36724),t(650),t(43618),t(98168),t(98597)),k=t(196),f=t(28345),m=(t(91074),t(26709)),y=(0,u.A)([(0,k.EM)("ha-qr-code")],(function(e,r){var t=function(r){function t(){var r;(0,c.A)(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=(0,s.A)(this,t,[].concat(a)),e(r),r}return(0,l.A)(t,r),(0,d.A)(t)}(r);return{F:t,d:[{kind:"field",decorators:[(0,k.MZ)()],key:"data",value:void 0},{kind:"field",decorators:[(0,k.MZ)({attribute:"error-correction-level"})],key:"errorCorrectionLevel",value:function(){return"medium"}},{kind:"field",decorators:[(0,k.MZ)({type:Number})],key:"width",value:function(){return 4}},{kind:"field",decorators:[(0,k.MZ)({type:Number})],key:"scale",value:function(){return 4}},{kind:"field",decorators:[(0,k.MZ)({type:Number})],key:"margin",value:function(){return 4}},{kind:"field",decorators:[(0,k.MZ)({type:Number})],key:"maskPattern",value:void 0},{kind:"field",decorators:[(0,k.MZ)({attribute:"center-image"})],key:"centerImage",value:void 0},{kind:"field",decorators:[(0,k.wk)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,k.P)("canvas")],key:"_canvas",value:void 0},{kind:"method",key:"willUpdate",value:function(e){(0,h.A)(t,"willUpdate",this,3)([e]),(e.has("data")||e.has("scale")||e.has("width")||e.has("margin")||e.has("maskPattern")||e.has("errorCorrectionLevel"))&&this._error&&(this._error=void 0)}},{kind:"method",key:"updated",value:function(e){var r=this,t=this._canvas;if(t&&this.data&&(e.has("data")||e.has("scale")||e.has("width")||e.has("margin")||e.has("maskPattern")||e.has("errorCorrectionLevel")||e.has("centerImage"))){var n=getComputedStyle(this),a=n.getPropertyValue("--rgb-primary-text-color"),i=n.getPropertyValue("--rgb-card-background-color"),o=(0,m.v2)(a.split(",").map((function(e){return parseInt(e,10)}))),d=(0,m.v2)(i.split(",").map((function(e){return parseInt(e,10)})));if(f.toCanvas(t,this.data,{errorCorrectionLevel:this.errorCorrectionLevel||(this.centerImage?"Q":"M"),width:this.width,scale:this.scale,margin:this.margin,maskPattern:this.maskPattern,color:{light:d,dark:o}}).catch((function(e){r._error=e.message})),this.centerImage){var c=this._canvas.getContext("2d"),s=new Image;s.src=this.centerImage,s.onload=function(){null==c||c.drawImage(s,.375*t.width,.375*t.height,t.width/4,t.height/4)}}}}},{kind:"method",key:"render",value:function(){return this.data?this._error?(0,v.qy)(n||(n=(0,o.A)(['<ha-alert alert-type="error">',"</ha-alert>"])),this._error):(0,v.qy)(a||(a=(0,o.A)(["<canvas></canvas>"]))):v.s6}},{kind:"field",static:!0,key:"styles",value:function(){return(0,v.AH)(i||(i=(0,o.A)(["\n    :host {\n      display: block;\n    }\n  "])))}}]}}),v.WF)},48353:function(e,r,t){t.r(r),t.d(r,{HaSelectorQRCode:function(){return v}});var n,a,i=t(6238),o=t(36683),d=t(89231),c=t(29864),s=t(83647),l=t(8364),u=(t(77052),t(98597)),h=t(196),v=(t(83599),(0,l.A)([(0,h.EM)("ha-selector-qr_code")],(function(e,r){var t=function(r){function t(){var r;(0,d.A)(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=(0,c.A)(this,t,[].concat(a)),e(r),r}return(0,s.A)(t,r),(0,o.A)(t)}(r);return{F:t,d:[{kind:"field",decorators:[(0,h.MZ)({attribute:!1})],key:"selector",value:void 0},{kind:"method",key:"render",value:function(){var e,r,t,a;return(0,u.qy)(n||(n=(0,i.A)(["<ha-qr-code\n      .data=","\n      .scale=","\n      .errorCorrectionLevel=","\n      .centerImage=","\n    ></ha-qr-code>"])),null===(e=this.selector.qr_code)||void 0===e?void 0:e.data,null===(r=this.selector.qr_code)||void 0===r?void 0:r.scale,null===(t=this.selector.qr_code)||void 0===t?void 0:t.error_correction_level,null===(a=this.selector.qr_code)||void 0===a?void 0:a.center_image)}},{kind:"field",static:!0,key:"styles",value:function(){return(0,u.AH)(a||(a=(0,i.A)(["\n    ha-qr-code {\n      text-align: center;\n    }\n  "])))}}]}}),u.WF))}}]);