"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[77418],{98464:function(t,e,r){r.a(t,async function(t,a){try{r.r(e);var o,n,i,s=r(28430),c=r(57567),h=r(25979),l=r(12463),d=r(16472),u=r(92297),v=(r(28706),r(62062),r(18111),r(61701),r(2892),r(26099),r(15697)),g=r(57527),p=r(51209),m=r(82677),y=r(88457),f=r(96917),C=t([y]);y=(C.then?(await C)():C)[0];var _=function(t){function e(){var t;(0,c.A)(this,e);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(t=(0,d.A)(this,e,[].concat(a))).errorCorrectionLevel="medium",t.width=4,t.scale=4,t.margin=4,t}return(0,l.A)(e,t),(0,h.A)(e,[{key:"willUpdate",value:function(t){(0,u.A)(e,"willUpdate",this,3)([t]),(t.has("data")||t.has("scale")||t.has("width")||t.has("margin")||t.has("maskPattern")||t.has("errorCorrectionLevel"))&&this._error&&(this._error=void 0)}},{key:"updated",value:function(t){var e=this,r=this._canvas;if(r&&this.data&&(t.has("data")||t.has("scale")||t.has("width")||t.has("margin")||t.has("maskPattern")||t.has("errorCorrectionLevel")||t.has("centerImage"))){var a=getComputedStyle(this),o=a.getPropertyValue("--rgb-primary-text-color"),n=a.getPropertyValue("--rgb-card-background-color"),i=(0,f.v2)(o.split(",").map(function(t){return parseInt(t,10)})),s=(0,f.v2)(n.split(",").map(function(t){return parseInt(t,10)}));if(m.toCanvas(r,this.data,{errorCorrectionLevel:this.errorCorrectionLevel||(this.centerImage?"Q":"M"),width:this.width,scale:this.scale,margin:this.margin,maskPattern:this.maskPattern,color:{light:s,dark:i}}).catch(function(t){e._error=t.message}),this.centerImage){var c=this._canvas.getContext("2d"),h=new Image;h.src=this.centerImage,h.onload=function(){null==c||c.drawImage(h,.375*r.width,.375*r.height,r.width/4,r.height/4)}}}}},{key:"render",value:function(){return this.data?this._error?(0,g.qy)(o||(o=(0,s.A)(['<ha-alert alert-type="error">',"</ha-alert>"])),this._error):(0,g.qy)(n||(n=(0,s.A)(["<canvas></canvas>"]))):g.s6}}])}(g.WF);_.styles=(0,g.AH)(i||(i=(0,s.A)([":host{display:block}"]))),(0,v.Cg)([(0,p.MZ)()],_.prototype,"data",void 0),(0,v.Cg)([(0,p.MZ)({attribute:"error-correction-level"})],_.prototype,"errorCorrectionLevel",void 0),(0,v.Cg)([(0,p.MZ)({type:Number})],_.prototype,"width",void 0),(0,v.Cg)([(0,p.MZ)({type:Number})],_.prototype,"scale",void 0),(0,v.Cg)([(0,p.MZ)({type:Number})],_.prototype,"margin",void 0),(0,v.Cg)([(0,p.MZ)({attribute:!1})],_.prototype,"maskPattern",void 0),(0,v.Cg)([(0,p.MZ)({attribute:"center-image"})],_.prototype,"centerImage",void 0),(0,v.Cg)([(0,p.wk)()],_.prototype,"_error",void 0),(0,v.Cg)([(0,p.P)("canvas")],_.prototype,"_canvas",void 0),_=(0,v.Cg)([(0,p.EM)("ha-qr-code")],_),r.d(e,{HaQrCode:function(){return _}}),a()}catch(k){a(k)}})},28860:function(t,e,r){r.a(t,async function(t,a){try{r.r(e);var o,n,i=r(28430),s=r(57567),c=r(25979),h=r(12463),l=r(16472),d=r(15697),u=r(57527),v=r(51209),g=r(98464),p=t([g]);g=(p.then?(await p)():p)[0];var m=function(t){function e(){return(0,s.A)(this,e),(0,l.A)(this,e,arguments)}return(0,h.A)(e,t),(0,c.A)(e,[{key:"render",value:function(){var t,e,r,a;return(0,u.qy)(o||(o=(0,i.A)(["<ha-qr-code .data="," .scale="," .errorCorrectionLevel="," .centerImage=","></ha-qr-code>"])),null===(t=this.selector.qr_code)||void 0===t?void 0:t.data,null===(e=this.selector.qr_code)||void 0===e?void 0:e.scale,null===(r=this.selector.qr_code)||void 0===r?void 0:r.error_correction_level,null===(a=this.selector.qr_code)||void 0===a?void 0:a.center_image)}}])}(u.WF);m.styles=(0,u.AH)(n||(n=(0,i.A)(["ha-qr-code{text-align:center}"]))),(0,d.Cg)([(0,v.MZ)({attribute:!1})],m.prototype,"selector",void 0),m=(0,d.Cg)([(0,v.EM)("ha-selector-qr_code")],m),r.d(e,{HaSelectorQRCode:function(){return m}}),a()}catch(y){a(y)}})},35370:function(t,e,r){var a=r(26198);t.exports=function(t,e,r){for(var o=0,n=arguments.length>2?r:a(e),i=new t(n);n>o;)i[o]=e[o++];return i}}}]);
//# sourceMappingURL=77418.facd3293352c760f.js.map