var e,t,n,r,o,i,a,s;function u(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function E(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function j(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function M(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){j(i,r,o,a,s,"next",e)}function s(e){j(i,r,o,a,s,"throw",e)}a(void 0)}))}}window.addEventListener("card-mod-bootstrap",function(){var e=M(P().mark((function e(t){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.stopPropagation(),document.addEventListener("ll-custom",(function(e){var t=e.detail;if(t&&"object"===T(t)){var n=t.card_mod;if(n&&"object"===T(n)){var r=n.action;if(r&&"string"==typeof r&&"function"==typeof N[r])try{var o=N[r]();o&&"function"==typeof o.catch&&o.catch((function(e){console.error('Error while executing action "'.concat(r,'":'),e)}))}catch(e){console.error('Error while executing action "'.concat(r,'":'),e)}}}}));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var N=function(){function e(){$(this,e)}var t;return C(e,null,[{key:"clear_cache",value:(t=M(P().mark((function e(){var t,n;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.caches){e.next=18;break}return e.prev=1,e.next=4,window.caches.keys();case 4:return t=e.sent,n=[],t.forEach((function(e){n.push(window.caches.delete(e))})),e.next=9,Promise.all(n);case 9:window.location.reload(),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(1),console.error("Failed to clear caches:",e.t0),window.location.reload();case 16:e.next=19;break;case 18:window.location.reload();case 19:case"end":return e.stop()}}),e,null,[[1,12]])}))),function(){return t.apply(this,arguments)})}]),e}();function R(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":T(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}"function"==typeof SuppressedError&&SuppressedError;var L=globalThis,U=L.ShadowRoot&&(void 0===L.ShadyCSS||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,D=Symbol(),H=new WeakMap,I=function(){function e(t,n,r){if($(this,e),this._$cssResult$=!0,r!==D)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}return C(e,[{key:"styleSheet",get:function(){var e=this.o,t=this.t;if(U&&void 0===e){var n=void 0!==t&&1===t.length;n&&(e=H.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&H.set(t,e))}return e}},{key:"toString",value:function(){return this.cssText}}]),e}(),q=U?function(e){return e}:function(e){return e instanceof CSSStyleSheet?function(e){var t,n="",r=x(e.cssRules);try{for(r.s();!(t=r.n()).done;){n+=t.value.cssText}}catch(e){r.e(e)}finally{r.f()}return function(e){return new I("string"==typeof e?e:e+"",void 0,D)}(n)}(e):e},z=Object.is,V=Object.defineProperty,B=Object.getOwnPropertyDescriptor,W=Object.getOwnPropertyNames,F=Object.getOwnPropertySymbols,J=Object.getPrototypeOf,Y=globalThis,G=Y.trustedTypes,K=G?G.emptyScript:"",Z=Y.reactiveElementPolyfillSupport,X=function(e,t){return e},Q={toAttribute:function(e,t){switch(t){case Boolean:e=e?K:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute:function(e,t){var n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},ee=function(e,t){return!z(e,t)},te={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:ee};null!==(e=Symbol.metadata)&&void 0!==e||(Symbol.metadata=Symbol("metadata")),null!==(t=Y.litPropertyMetadata)&&void 0!==t||(Y.litPropertyMetadata=new WeakMap);var ne=function(e){v(r,b(HTMLElement));var t,n=y(r);function r(){var e;return $(this,r),(e=n.call(this))._$Ep=void 0,e.isUpdatePending=!1,e.hasUpdated=!1,e._$Em=null,e._$Ev(),e}return C(r,[{key:"_$Ev",value:function(){var e,t=this;this._$Eg=new Promise((function(e){return t.enableUpdating=e})),this._$AL=new Map,this._$ES(),this.requestUpdate(),null===(e=this.constructor.l)||void 0===e||e.forEach((function(e){return e(t)}))}},{key:"addController",value:function(e){var t,n;(null!==(t=this._$E_)&&void 0!==t?t:this._$E_=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}},{key:"removeController",value:function(e){var t;null===(t=this._$E_)||void 0===t||t.delete(e)}},{key:"_$ES",value:function(){var e,t=new Map,n=x(this.constructor.elementProperties.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value;this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r])}}catch(e){n.e(e)}finally{n.f()}t.size>0&&(this._$Ep=t)}},{key:"createRenderRoot",value:function(){var e,t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return function(e,t){if(U)e.adoptedStyleSheets=t.map((function(e){return e instanceof CSSStyleSheet?e:e.styleSheet}));else{var n,r=x(t);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=document.createElement("style"),a=L.litNonce;void 0!==a&&i.setAttribute("nonce",a),i.textContent=o.cssText,e.appendChild(i)}}catch(e){r.e(e)}finally{r.f()}}}(t,this.constructor.elementStyles),t}},{key:"connectedCallback",value:function(){var e,t;null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$E_)||void 0===t||t.forEach((function(e){var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)}))}},{key:"enableUpdating",value:function(e){}},{key:"disconnectedCallback",value:function(){var e;null===(e=this._$E_)||void 0===e||e.forEach((function(e){var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)}))}},{key:"attributeChangedCallback",value:function(e,t,n){this._$AK(e,n)}},{key:"_$EO",value:function(e,t){var n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(void 0!==r&&!0===n.reflect){var o,i=(void 0!==(null===(o=n.converter)||void 0===o?void 0:o.toAttribute)?n.converter:Q).toAttribute(t,n.type);this._$Em=e,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}},{key:"_$AK",value:function(e,t){var n=this.constructor,r=n._$Eh.get(e);if(void 0!==r&&this._$Em!==r){var o,i=n.getPropertyOptions(r),a="function"==typeof i.converter?{fromAttribute:i.converter}:void 0!==(null===(o=i.converter)||void 0===o?void 0:o.fromAttribute)?i.converter:Q;this._$Em=r,this[r]=a.fromAttribute(t,i.type),this._$Em=null}}},{key:"requestUpdate",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(void 0!==e){var i,a;if(null!==(i=n)&&void 0!==i||(n=this.constructor.getPropertyOptions(e)),!(null!==(a=n.hasChanged)&&void 0!==a?a:ee)(r?o:this[e],t))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}},{key:"C",value:function(e,t,n){var r;this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$Em!==e&&(null!==(r=this._$Ej)&&void 0!==r?r:this._$Ej=new Set).add(e)}},{key:"_$EP",value:(t=M(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isUpdatePending=!0,e.prev=1,e.next=4,this._$Eg;case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),Promise.reject(e.t0);case 9:if(t=this.scheduleUpdate(),e.t1=null!=t,!e.t1){e.next=14;break}return e.next=14,t;case 14:return e.abrupt("return",!this.isUpdatePending);case 15:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return t.apply(this,arguments)})},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){if(this.isUpdatePending){if(!this.hasUpdated){var e;if(null!==(e=this.renderRoot)&&void 0!==e||(this.renderRoot=this.createRenderRoot()),this._$Ep){var t,n=x(this._$Ep);try{for(n.s();!(t=n.n()).done;){var r=p(t.value,2),o=r[0],i=r[1];this[o]=i}}catch(e){n.e(e)}finally{n.f()}this._$Ep=void 0}var a=this.constructor.elementProperties;if(a.size>0){var s,u=x(a);try{for(u.s();!(s=u.n()).done;){var c=p(s.value,2),l=c[0],d=c[1];!0!==d.wrapped||this._$AL.has(l)||void 0===this[l]||this.C(l,this[l],d)}}catch(e){u.e(e)}finally{u.f()}}}var h=!1,f=this._$AL;try{var v;(h=this.shouldUpdate(f))?(this.willUpdate(f),null!==(v=this._$E_)&&void 0!==v&&v.forEach((function(e){var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(f)):this._$ET()}catch(f){throw h=!1,this._$ET(),f}h&&this._$AE(f)}}},{key:"willUpdate",value:function(e){}},{key:"_$AE",value:function(e){var t;null!==(t=this._$E_)&&void 0!==t&&t.forEach((function(e){var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}},{key:"_$ET",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$Eg}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){var t=this;this._$Ej&&(this._$Ej=this._$Ej.forEach((function(e){return t._$EO(e,t[e])}))),this._$ET()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}],[{key:"addInitializer",value:function(e){var t;this._$Ei(),(null!==(t=this.l)&&void 0!==t?t:this.l=[]).push(e)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&f(this._$Eh.keys())}},{key:"createProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:te;if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){var n=Symbol(),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&V(this.prototype,e,r)}}},{key:"getPropertyDescriptor",value:function(e,t,n){var r,o=null!==(r=B(this.prototype,e))&&void 0!==r?r:{get:function(){return this[t]},set:function(e){this[t]=e}},i=o.get,a=o.set;return{get:function(){return null==i?void 0:i.call(this)},set:function(t){var r=null==i?void 0:i.call(this);a.call(this,t),this.requestUpdate(e,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){var t;return null!==(t=this.elementProperties.get(e))&&void 0!==t?t:te}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(X("elementProperties"))){var e=J(this);e.finalize(),void 0!==e.l&&(this.l=f(e.l)),this.elementProperties=new Map(e.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(X("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(X("properties"))){var e,t=this.properties,n=x([].concat(f(W(t)),f(F(t))));try{for(n.s();!(e=n.n()).done;){var r=e.value;this.createProperty(r,t[r])}}catch(e){n.e(e)}finally{n.f()}}var o=this[Symbol.metadata];if(null!==o){var i=litPropertyMetadata.get(o);if(void 0!==i){var a,s=x(i);try{for(s.s();!(a=s.n()).done;){var u=p(a.value,2),c=u[0],l=u[1];this.elementProperties.set(c,l)}}catch(e){s.e(e)}finally{s.f()}}}this._$Eh=new Map;var d,h=x(this.elementProperties);try{for(h.s();!(d=h.n()).done;){var v=p(d.value,2),y=v[0],m=v[1],b=this._$Eu(y,m);void 0!==b&&this._$Eh.set(b,y)}}catch(e){h.e(e)}finally{h.f()}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(e){var t=[];if(Array.isArray(e)){var n,r=x(new Set(e.flat(1/0).reverse()));try{for(r.s();!(n=r.n()).done;){var o=n.value;t.unshift(q(o))}}catch(e){r.e(e)}finally{r.f()}}else void 0!==e&&t.push(q(e));return t}},{key:"_$Eu",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}}]),r}();ne.elementStyles=[],ne.shadowRootOptions={mode:"open"},ne[X("elementProperties")]=new Map,ne[X("finalized")]=new Map,null!=Z&&Z({ReactiveElement:ne}),(null!==(n=Y.reactiveElementVersions)&&void 0!==n?n:Y.reactiveElementVersions=[]).push("2.0.2");var re=globalThis,oe=re.trustedTypes,ie=oe?oe.createPolicy("lit-html",{createHTML:function(e){return e}}):void 0,ae="$lit$",se="lit$".concat((Math.random()+"").slice(9),"$"),ue="?"+se,ce="<".concat(ue,">"),le=document,de=function(){return le.createComment("")},he=function(e){return null===e||"object"!=T(e)&&"function"!=typeof e},fe=Array.isArray,pe="[ \t\n\f\r]",ve=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ye=/-->/g,me=/>/g,be=RegExp(">|".concat(pe,"(?:([^\\s\"'>=/]+)(").concat(pe,"*=").concat(pe,"*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),ge=/'/g,we=/"/g,_e=/^(?:script|style|textarea|title)$/i,ke=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o":"",a=ve,s=0;s"===l[0]?(a=null!==(f=n)&&void 0!==f?f:ve,d=-1):void 0===l[1]?d=-2:(d=a.lastIndex-l[2].length,c=l[1],a=void 0===l[3]?be:'"'===l[3]?we:ge):a===we||a===ge?a=be:a===ye||a===me?a=ve:(a=be,n=void 0)}var p=a===be&&e[s+1].startsWith("/>")?" ":"";i+=a===ve?u+ce:d>=0?(o.push(c),u.slice(0,d)+ae+u.slice(d)+se+p):u+se+(-2===d?s:p)}return[Se(e,i+(e[r]||"")+(2===t?"":"")),o]},Oe=function(){function e(t,n){var r,o=t.strings,i=t._$litType$;$(this,e),this.parts=[];var a=0,s=0,u=o.length-1,c=this.parts,l=p(Ce(o,i),2),d=l[0],h=l[1];if(this.el=e.createElement(d,n),$e.currentNode=this.el.content,2===i){var v=this.el.content.firstChild;v.replaceWith.apply(v,f(v.childNodes))}for(;null!==(r=$e.nextNode())&&c.length0){r.textContent=oe?oe.emptyScript:"";for(var A=0;A2&&void 0!==arguments[2]?arguments[2]:e,u=arguments.length>3?arguments[3]:void 0;if(t===xe)return t;var c=void 0!==u?null===(n=s._$Co)||void 0===n?void 0:n[u]:s._$Cl,l=he(t)?void 0:t._$litDirective$;return(null===(r=c)||void 0===r?void 0:r.constructor)!==l&&(null!==(o=c)&&void 0!==o&&null!==(i=o._$AO)&&void 0!==i&&i.call(o,!1),void 0===l?c=void 0:(c=new l(e))._$AT(e,s,u),void 0!==u?(null!==(a=s._$Co)&&void 0!==a?a:s._$Co=[])[u]=c:s._$Cl=c),void 0!==c&&(t=Pe(e,c._$AS(e,t.values),c,u)),t}var Te=function(){function e(t,n){$(this,e),this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}return C(e,[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"u",value:function(e){var t,n=this._$AD,r=n.el.content,o=n.parts,i=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:le).importNode(r,!0);$e.currentNode=i;for(var a=$e.nextNode(),s=0,u=0,c=o[0];void 0!==c;){var l;if(s===c.index){var d=void 0;2===c.type?d=new je(a,a.nextSibling,this,e):1===c.type?d=new c.ctor(a,c.name,c.strings,this,e):6===c.type&&(d=new Ue(a,this,e)),this._$AV.push(d),c=o[++u]}s!==(null===(l=c)||void 0===l?void 0:l.index)&&(a=$e.nextNode(),s++)}return $e.currentNode=le,i}},{key:"p",value:function(e){var t,n=0,r=x(this._$AV);try{for(r.s();!(t=r.n()).done;){var o=t.value;void 0!==o&&(void 0!==o.strings?(o._$AI(e,o,n),n+=o.strings.length-2):o._$AI(e[n])),n++}}catch(e){r.e(e)}finally{r.f()}}}]),e}(),je=function(){function e(t,n,r,o){var i;$(this,e),this.type=2,this._$AH=Ee,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=r,this.options=o,this._$Cv=null===(i=null==o?void 0:o.isConnected)||void 0===i||i}return C(e,[{key:"_$AU",get:function(){var e,t;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cv}},{key:"parentNode",get:function(){var e,t=this._$AA.parentNode,n=this._$AM;return void 0!==n&&11===(null===(e=t)||void 0===e?void 0:e.nodeType)&&(t=n.parentNode),t}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(e){e=Pe(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),he(e)?e===Ee||null==e||""===e?(this._$AH!==Ee&&this._$AR(),this._$AH=Ee):e!==this._$AH&&e!==xe&&this._(e):void 0!==e._$litType$?this.g(e):void 0!==e.nodeType?this.$(e):function(e){return fe(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator])}(e)?this.T(e):this._(e)}},{key:"k",value:function(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}},{key:"$",value:function(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}},{key:"_",value:function(e){this._$AH!==Ee&&he(this._$AH)?this._$AA.nextSibling.data=e:this.$(le.createTextNode(e)),this._$AH=e}},{key:"g",value:function(e){var t,n=e.values,r=e._$litType$,o="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=Oe.createElement(Se(r.h,r.h[0]),this.options)),r);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===o)this._$AH.p(n);else{var i=new Te(o,this),a=i.u(this.options);i.p(n),this.$(a),this._$AH=i}}},{key:"_$AC",value:function(e){var t=Ae.get(e.strings);return void 0===t&&Ae.set(e.strings,t=new Oe(e)),t}},{key:"T",value:function(t){fe(this._$AH)||(this._$AH=[],this._$AR());var n,r,o=this._$AH,i=0,a=x(t);try{for(a.s();!(r=a.n()).done;){var s=r.value;i===o.length?o.push(n=new e(this.k(de()),this.k(de()),this,this.options)):n=o[i],n._$AI(s),i++}}catch(e){a.e(e)}finally{a.f()}i0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,t=arguments.length>1?arguments[1]:void 0;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,t);e&&e!==this._$AB;){var n,r=e.nextSibling;e.remove(),e=r}}},{key:"setConnected",value:function(e){var t;void 0===this._$AM&&(this._$Cv=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}]),e}(),Me=function(){function e(t,n,r,o,i){$(this,e),this.type=1,this._$AH=Ee,this._$AN=void 0,this.element=t,this.name=n,this._$AM=o,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Ee}return C(e,[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=this.strings,i=!1;if(void 0===o)e=Pe(this,e,t,0),(i=!he(e)||e!==this._$AH&&e!==xe)&&(this._$AH=e);else{var a,s,u=e;for(e=o[0],a=0;a1&&void 0!==arguments[1]?arguments[1]:this,0))&&void 0!==t?t:Ee)!==xe){var n=this._$AH,r=e===Ee&&n!==Ee||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,o=e!==Ee&&(n===Ee||r);r&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}}},{key:"handleEvent",value:function(e){var t,n;"function"==typeof this._$AH?this._$AH.call(null!==(t=null===(n=this.options)||void 0===n?void 0:n.host)&&void 0!==t?t:this.element,e):this._$AH.handleEvent(e)}}]),n}(),Ue=function(){function e(t,n,r){$(this,e),this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}return C(e,[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(e){Pe(this,e)}}]),e}(),De=re.litHtmlPolyfillSupport;null!=De&&De(Oe,je),(null!==(r=re.litHtmlVersions)&&void 0!==r?r:re.litHtmlVersions=[]).push("3.1.0");var He=function(e){v(n,ne);var t=y(n);function n(){var e;return $(this,n),(e=t.apply(this,arguments)).renderOptions={host:m(e)},e._$Do=void 0,e}return C(n,[{key:"createRenderRoot",value:function(){var e,t,r=h(k(n.prototype),"createRenderRoot",this).call(this);return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=r.firstChild),r}},{key:"update",value:function(e){var t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),h(k(n.prototype),"update",this).call(this,e),this._$Do=function(e,t,n){var r,o=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:t,i=o._$litPart$;if(void 0===i){var a,s=null!==(a=null==n?void 0:n.renderBefore)&&void 0!==a?a:null;o._$litPart$=i=new je(t.insertBefore(de(),s),s,void 0,null!=n?n:{})}return i._$AI(e),i}(t,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var e;h(k(n.prototype),"connectedCallback",this).call(this),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;h(k(n.prototype),"disconnectedCallback",this).call(this),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return xe}}]),n}();He._$litElement$=!0,He.finalized=!0,null===(o=globalThis.litElementHydrateSupport)||void 0===o||o.call(globalThis,{LitElement:He});var Ie=globalThis.litElementPolyfillSupport;null==Ie||Ie({LitElement:He}),(null!==(i=globalThis.litElementVersions)&&void 0!==i?i:globalThis.litElementVersions=[]).push("4.0.2");var qe,ze={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:ee};function Ve(e){return function(t,n){return"object"==T(n)?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ze,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=n.kind,o=n.metadata,i=globalThis.litPropertyMetadata.get(o);if(void 0===i&&globalThis.litPropertyMetadata.set(o,i=new Map),i.set(n.name,e),"accessor"===r){var a=n.name;return{set:function(n){var r=t.get.call(this);t.set.call(this,n),this.requestUpdate(a,r,e)},init:function(t){return void 0!==t&&this.C(a,void 0,e),t}}}if("setter"===r){var s=n.name;return function(n){var r=this[s];t.call(this,n),this.requestUpdate(s,r,e)}}throw Error("Unsupported decorator location: "+r)}(e,t,n):function(e,t,n){var r=t.hasOwnProperty(n);return t.constructor.createProperty(n,r?l(l({},e),{},{wrapped:!0}):e),r?Object.getOwnPropertyDescriptor(t,n):void 0}(e,t,n)}}var Be=new WeakMap,We=function(){},Fe=function(){function e(t){var n=this;$(this,e),this.subscribers=[],this.settlement=null,this[qe]="Unpromise",this.promise="function"==typeof t?new Promise(t):t;var r=this.promise.then((function(e){var t=n.subscribers;n.subscribers=null,n.settlement={status:"fulfilled",value:e},null==t||t.forEach((function(t){(0,t.resolve)(e)}))}));"catch"in r&&r.catch((function(e){var t=n.subscribers;n.subscribers=null,n.settlement={status:"rejected",reason:e},null==t||t.forEach((function(t){(0,t.reject)(e)}))}))}var t,n,r;return C(e,[{key:"subscribe",value:function(){var e,t,n=this,r=this.settlement;if(null===r){if(null===this.subscribers)throw new Error("Unpromise settled but still has subscribers");var o=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolve:e,reject:t}}();this.subscribers=function(e,t){return[].concat(f(e),[t])}(this.subscribers,o),e=o.promise,t=function(){null!==n.subscribers&&(n.subscribers=function(e,t){var n=e.indexOf(t);return-1!==n?function(e,t){return[].concat(f(e.slice(0,t)),f(e.slice(t+1)))}(e,n):e}(n.subscribers,o))}}else{e="fulfilled"===r.status?Promise.resolve(r.value):Promise.reject(r.reason),t=We}return Object.assign(e,{unsubscribe:t})}},{key:"then",value:function(e,t){var n=this.subscribe(),r=n.unsubscribe;return Object.assign(n.then(e,t),{unsubscribe:r})}},{key:"catch",value:function(e){var t=this.subscribe(),n=t.unsubscribe;return Object.assign(t.catch(e),{unsubscribe:n})}},{key:"finally",value:function(e){var t=this.subscribe(),n=t.unsubscribe;return Object.assign(t.finally(e),{unsubscribe:n})}}],[{key:"proxy",value:function(t){var n=e.getSubscribablePromise(t);return T(n)<"u"?n:e.createSubscribablePromise(t)}},{key:"createSubscribablePromise",value:function(t){var n=new e(t);return Be.set(t,n),Be.set(n,n),n}},{key:"getSubscribablePromise",value:function(e){return Be.get(e)}},{key:"resolve",value:function(t){var n="object"==T(t)&&null!==t&&"then"in t&&"function"==typeof t.then?t:Promise.resolve(t);return e.proxy(n).subscribe()}},{key:"any",value:(r=M(P().mark((function t(n){var r;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(Array.isArray(n)?n:f(n)).map(e.resolve),t.prev=1,t.next=4,Promise.any(r);case 4:return t.abrupt("return",t.sent);case 5:return t.prev=5,r.forEach((function(e){(0,e.unsubscribe)()})),t.finish(5);case 8:case"end":return t.stop()}}),t,null,[[1,,5,8]])}))),function(e){return r.apply(this,arguments)})},{key:"race",value:(n=M(P().mark((function t(n){var r;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(Array.isArray(n)?n:f(n)).map(e.resolve),t.prev=1,t.next=4,Promise.race(r);case 4:return t.abrupt("return",t.sent);case 5:return t.prev=5,r.forEach((function(e){(0,e.unsubscribe)()})),t.finish(5);case 8:case"end":return t.stop()}}),t,null,[[1,,5,8]])}))),function(e){return n.apply(this,arguments)})},{key:"raceReferences",value:(t=M(P().mark((function e(t){var n,r,o;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.map(Ye),e.prev=1,e.next=4,Promise.race(n);case 4:return e.abrupt("return",e.sent);case 5:e.prev=5,r=x(n);try{for(r.s();!(o=r.n()).done;)o.value.unsubscribe()}catch(e){r.e(e)}finally{r.f()}return e.finish(5);case 9:case"end":return e.stop()}}),e,null,[[1,,5,9]])}))),function(e){return t.apply(this,arguments)})}]),e}();qe=Symbol.toStringTag;var Je=Fe;function Ye(e){return Je.proxy(e).then((function(){return[e]}))}function Ge(){return Ke.apply(this,arguments)}function Ke(){return Ke=M(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Je.race([customElements.whenDefined("home-assistant"),customElements.whenDefined("hc-main")]);case 2:t=customElements.get("home-assistant")?"home-assistant":"hc-main";case 3:if(document.querySelector(t)){e.next=8;break}return e.next=6,new Promise((function(e){return window.setTimeout(e,100)}));case 6:e.next=3;break;case 8:return e.abrupt("return",document.querySelector(t));case 9:case"end":return e.stop()}}),e)}))),Ke.apply(this,arguments)}function Ze(){return Xe.apply(this,arguments)}function Xe(){return Xe=M(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ge();case 2:t=e.sent;case 3:if(t.hass){e.next=8;break}return e.next=6,new Promise((function(e){return window.setTimeout(e,100)}));case 6:e.next=3;break;case 8:return e.abrupt("return",t.hass);case 9:case"end":return e.stop()}}),e)}))),Xe.apply(this,arguments)}var Qe="browser_mod-browser-id";var et="SELECTTREE-TIMEOUT";function tt(e){return nt.apply(this,arguments)}function nt(){return nt=M(P().mark((function e(t){var n,r,o,i=arguments;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>1&&void 0!==i[1]&&i[1],!(null===(r=t.localName)||void 0===r?void 0:r.includes("-"))){e.next=4;break}return e.next=4,customElements.whenDefined(t.localName);case 4:if(!t.updateComplete){e.next=7;break}return e.next=7,t.updateComplete;case 7:if(!n){e.next=18;break}if(!t.pageRendered){e.next=11;break}return e.next=11,t.pageRendered;case 11:if(!t._panelState){e.next=18;break}o=0;case 13:if(!("loaded"!==t._panelState&&o++<5)){e.next=18;break}return e.next=16,new Promise((function(e){return setTimeout(e,100)}));case 16:e.next=13;break;case 18:case"end":return e.stop()}}),e)}))),nt.apply(this,arguments)}function rt(e,t){return ot.apply(this,arguments)}function ot(){return ot=M(P().mark((function e(t,n){var r,o,i,a,s,u,c,l=arguments;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=l.length>2&&void 0!==l[2]&&l[2],o=[t],"string"==typeof n&&(n=n.split(/(\$| )/));""===n[n.length-1];)n.pop();i=x(n.entries()),e.prev=5,i.s();case 7:if((a=i.n()).done){e.next=24;break}if(s=p(a.value,2),s[0],"$"!==(u=s[1])){e.next=14;break}return e.next=12,Promise.all(f(o).map((function(e){return tt(e)})));case 12:return o=f(o).map((function(e){return e.shadowRoot})),e.abrupt("continue",22);case 14:if(c=o[0]){e.next=17;break}return e.abrupt("return",null);case 17:if(u.trim().length){e.next=19;break}return e.abrupt("continue",22);case 19:return e.next=21,tt(c);case 21:o=c.querySelectorAll(u);case 22:e.next=7;break;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(5),i.e(e.t0);case 29:return e.prev=29,i.f(),e.finish(29);case 32:return e.abrupt("return",r?o:o[0]);case 33:case"end":return e.stop()}}),e,null,[[5,26,29,32]])}))),ot.apply(this,arguments)}function it(e,t){return at.apply(this,arguments)}function at(){return at=M(P().mark((function e(t,n){var r,o,i=arguments;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>2&&void 0!==i[2]&&i[2],o=i.length>3&&void 0!==i[3]?i[3]:1e4,e.abrupt("return",Je.race([rt(t,n,r),new Promise((function(e,t){return setTimeout((function(){return t(new Error(et))}),o)}))]).catch((function(e){if(!e.message||e.message!==et)throw e;return null})));case 3:case"end":return e.stop()}}),e)}))),at.apply(this,arguments)}var st=null;function ut(e){return ct.apply(this,arguments)}function ct(){return ct=M(P().mark((function e(t){var n,r,o;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(){return o=M(P().mark((function e(t){var n;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,it(t,"home-assistant $ home-assistant-main $ partial-panel-resolver>*");case 2:if(n=e.sent){e.next=7;break}return e.next=6,it(t,"hc-main $ hc-lovelace");case 6:n=e.sent;case 7:if(n){e.next=11;break}return e.next=10,it(t,"hc-main $ hc-lovelace");case 10:n=e.sent;case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e)}))),o.apply(this,arguments)},r=function(e){return o.apply(this,arguments)},e.next=4,r(t);case 4:n=e.sent;case 5:if(null!==n){e.next=13;break}return e.next=8,new Promise((function(e){return setTimeout(e,100)}));case 8:return e.next=10,r(t);case 10:n=e.sent,e.next=5;break;case 13:return e.abrupt("return",n);case 14:case"end":return e.stop()}}),e)}))),ct.apply(this,arguments)}function lt(e){var t,n,r;if(null===(t=null==e?void 0:e.hass)||void 0===t?void 0:t.localize){var o=function(e){return"lovelace"===(null==e?void 0:e.url_path)?"panel.states":"profile"===(null==e?void 0:e.url_path)?"panel.profile":"panel.".concat(null==e?void 0:e.title)}(e.panel);return e.hass.localize(o)||(null===(n=e.panel)||void 0===n?void 0:n.title)||""}return(null===(r=null==e?void 0:e.panel)||void 0===r?void 0:r.title)||""}function dt(e){var t,n,r,o,i;return{panelTitle:lt(e),panelUrlPath:(null===(n=null===(t=null==e?void 0:e.route)||void 0===t?void 0:t.prefix)||void 0===n?void 0:n.replace(/^\/|\/$/g,""))||"",panelComponentName:(null===(r=null==e?void 0:e.panel)||void 0===r?void 0:r.component_name)||"",panelIcon:(null===(o=null==e?void 0:e.panel)||void 0===o?void 0:o.icon)||"",panelNarrow:(null==e?void 0:e.narrow)||!1,panelRequireAdmin:(null===(i=null==e?void 0:e.panel)||void 0===i?void 0:i.require_admin)||!1}}function ht(e){return ft.apply(this,arguments)}function ft(){return ft=M(P().mark((function e(t){var n,r,o,i,a,s,u,c,l,d,h,f,p;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("lovelace"===(null===(n=null==t?void 0:t.panel)||void 0===n?void 0:n.component_name)){e.next=2;break}return e.abrupt("return",{viewTitle:"",viewUrlPath:(null===(o=null===(r=null==t?void 0:t.route)||void 0===r?void 0:r.path)||void 0===o?void 0:o.replace(/^\/|\/$/g,""))||"",viewNarrow:(null==t?void 0:t.narrow)||!1});case 2:h=0;case 3:if((null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelector("hui-root"))||!(h<100)){e.next=9;break}return e.next=6,new Promise((function(e){return setTimeout(e,10)}));case 6:h++,e.next=3;break;case 9:if(f=t.shadowRoot.querySelector("hui-root")){e.next=12;break}return e.abrupt("return",{});case 12:return p=f._curView||0,e.abrupt("return",{viewTitle:(null===(u=null===(s=null===(a=f.config)||void 0===a?void 0:a.views)||void 0===s?void 0:s[p])||void 0===u?void 0:u.title)||"",viewUrlPath:(null===(d=null===(l=null===(c=f.config)||void 0===c?void 0:c.views)||void 0===l?void 0:l[p])||void 0===d?void 0:d.path)||"".concat(p),viewNarrow:f.narrow||!1});case 14:case"end":return e.stop()}}),e)}))),ft.apply(this,arguments)}function pt(){return vt.apply(this,arguments)}function vt(){return(vt=M(P().mark((function e(){var t,n,r,o,i;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ut(document);case 2:return t=e.sent,n=dt(t),e.next=6,ht(t);case 6:return r=e.sent,o=[],n.panelTitle&&o.push(n.panelTitle),r.viewTitle&&o.push(r.viewTitle),i=[],n.panelUrlPath&&i.push(n.panelUrlPath),r.viewUrlPath&&i.push(r.viewUrlPath),e.abrupt("return",{hash:location.hash.substr(1)||"",panel:Object.assign(Object.assign({title:o.join(" - "),fullUrlPath:i.join("/")},n),r)});case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function yt(){var e=function(){var e=M(P().mark((function e(){var t,n,r,o;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,pt();case 2:t=e.sent,n=window.location.pathname.slice(1).toLowerCase(),r=t.panel.fullUrlPath.toLowerCase(),o=0;case 6:if(!(n!==r&&o++<200)){e.next=16;break}return e.next=9,new Promise((function(e){return setTimeout(e,10)}));case 9:return e.next=11,pt();case 11:t=e.sent,n=window.location.pathname.slice(1).toLowerCase(),r=t.panel.fullUrlPath.toLowerCase(),e.next=6;break;case 16:return n!==r&&(console.groupCollapsed("Card-mod: cannot resolve Panel information after 2s."),console.log("Browser path:",n),console.log("Panel path:",r),console.log("Final panel state:",t),console.groupEnd()),e.abrupt("return",t);case 18:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();st=new Promise((function(t){return t(e())}))}window.addEventListener("card-mod-bootstrap",function(){var e=M(P().mark((function e(t){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.stopPropagation(),["popstate","location-changed"].forEach((function(e){window.addEventListener(e,M(P().mark((function e(){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:st=null,yt(),st.then((function(){document.dispatchEvent(new CustomEvent("cm_update",{detail:{variablesChanged:!0}}))}));case 3:case"end":return e.stop()}}),e)}))))}));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),window.cardMod_template_cache=window.cardMod_template_cache||{};var mt=window.cardMod_template_cache;function bt(e,t){var n=mt[e];n&&("error"in t?(n.error=t,n.value="",n.debug&&(console.groupCollapsed("CardMod: Template ".concat(n.error.level)),console.log({template:n.template,variables:n.variables,value:n.value,error:n.error}),console.groupEnd())):(n.value=t.result,n.debug&&(console.groupCollapsed("CardMod: Template updated"),console.log({template:n.template,variables:n.variables,value:n.value,error:n.error}),console.groupEnd())),n.callbacks.forEach((function(e){return e(n.value)})))}function gt(e,t,n){return wt.apply(this,arguments)}function wt(){return(wt=M(P().mark((function e(t,n,r){var o,i,a,s,u,c;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ze();case 2:return o=e.sent,e.next=5,st||yt(),st;case 5:i=e.sent,a=o.connection,r=Object.assign(Object.assign({user:o.user.name,browser:document.querySelector("hc-main")?"CAST":localStorage[Qe]?localStorage[Qe]:""},i),r),s=JSON.stringify([n,r]),(u=mt[s])?(u.debug&&(console.groupCollapsed("CardMod: Reusing template"),console.log({template:u.template,variables:u.variables,value:u.value,error:u.error}),console.groupEnd()),u.callbacks.has(t)||_t(t),t(u.value),u.callbacks.add(t),u.cooldownTimeoutID&&clearTimeout(u.cooldownTimeoutID),u.cooldownTimeoutID=void 0):(c=!1,_t(t),t(""),n.includes("card_mod.debug")&&(c=!0,console.groupCollapsed("CardMod: Binding template"),console.log({template:n,variables:r}),console.groupEnd()),mt[s]=u={template:n,variables:r,value:"",callbacks:new Set([t]),debug:c,unsubscribe:a.subscribeMessage((function(e){return bt(s,e)}),{type:"render_template",template:n,variables:r,report_errors:c})});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _t(e){return kt.apply(this,arguments)}function kt(){return(kt=M(P().mark((function e(t){var n,r,o,i,a;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0,r=Object.entries(mt);case 1:if(!(n2?n-2:0),o=2;o1?n-1:0),o=1;o3&&void 0!==l[3]?l[3]:{},i=!(l.length>4&&void 0!==l[4])||l[4],c=!1,void 0!==(a=l.length>5&&void 0!==l[5]?l[5]:void 0)&&"string"!=typeof a&&(c=!0,i=a,a=void 0),"boolean"!=typeof i&&(i=!0,c=!0),"string"==typeof(r=l.length>2&&void 0!==l[2]?l[2]:void 0)&&(r={style:r},c=!0),r&&0!==Object.keys(r).length&&void 0===(null!==(u=null!==(s=null==r?void 0:r.style)&&void 0!==s?s:null==r?void 0:r.class)&&void 0!==u?u:null==r?void 0:r.debug)&&(r={style:r},c=!0),c&&!window.cm_compatibility_warning&&(window.cm_compatibility_warning=!0,console.groupCollapsed("Card-mod warning"),console.info("You are using a custom card which relies on card-mod, and uses an outdated signature for applyToElement."),console.info("The outdated signature will be removed at some point in the future. Hopefully the developer of your card will have updated their card by then."),console.info("The card used card-mod to apply styles here:",t),console.groupEnd()),e.abrupt("return",Ut(t,n,r,o,i,a));case 11:case"end":return e.stop()}}),e)}))),Lt.apply(this,arguments)}function Ut(e,t){return Dt.apply(this,arguments)}function Dt(){return Dt=M(P().mark((function e(t,n){var r,o,i,a,s,u,c,l,d,h,p,v,y,m,b=arguments;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=b.length>3&&void 0!==b[3]?b[3]:{},a=!(b.length>4&&void 0!==b[4])||b[4],s=b.length>5&&void 0!==b[5]?b[5]:void 0,y=(null==(o=b.length>2&&void 0!==b[2]?b[2]:void 0)?void 0:o.debug)?function(){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&void 0!==u[2]?u[2]:0,o=this.parentElement||this.parentNode,e.next=4,it(o,t,!0);case 4:if((i=e.sent)&&i.length){e.next=12;break}if(!(r>5)){e.next=8;break}throw new Error("NoElements");case 8:return a=new Promise((function(e,t){setTimeout(e,100*r),s._cancel_style_child.push(t)})),e.next=11,a.catch((function(e){throw new Error("Cancelled")}));case 11:return e.abrupt("return",this._style_child(t,n,r+1));case 12:return e.abrupt("return",f(i).map(function(){var e=M(P().mark((function e(t){var r;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ut(t,"".concat(s.type,"-child"),{style:n,debug:s.debug},s.variables,!1);case 2:return(r=e.sent)&&(r.card_mod_parent=s),e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"_connect",value:(n=M(P().mark((function e(){var t,n,r,o,i,a,s,u,c,l,d,h,v,y,m,b=this;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=null!==(t=this._fixed_styles)&&void 0!==t?t:{},u={},c="",l=!1,this._debug.apply(this,["(Re)connecting:","type:",this.type,"to:"].concat(f((null===(n=null==this?void 0:this.parentNode)||void 0===n?void 0:n.host)?["#shadow-root of:",null===(r=null==this?void 0:this.parentNode)||void 0===r?void 0:r.host]:[null!==(o=this.parentElement)&&void 0!==o?o:this.parentNode]))),this.cancelStyleChild(),d=P().mark((function e(){var t,n,r;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=p(v[h],2),n=t[0],r=t[1],"."===n?"string"==typeof r?c=r:b._debug("Style of '.' must be a string: ",r):(l=!0,u[n]=b._style_child(n,r).catch((function(e){if("NoElements"!=e.message){if("Cancelled"!=e.message)throw e;b.debug&&(console.groupCollapsed("card-mod style_child cancelled while looking for elements"),console.info("Looked for ".concat(n)),console.info(b),console.groupEnd())}else b.debug&&(console.groupCollapsed("card-mod found no elements"),console.info("Looked for ".concat(n)),console.info(b),console.groupEnd())})));case 2:case"end":return e.stop()}}),e)})),h=0,v=Object.entries(s);case 8:if(!(h\n ","\n \n "])),this._rendered_styles)}}],[{key:"applyToElement",get:function(){return Rt}}]),s}();R([Ve({attribute:"card-mod-type",reflect:!0})],qt.prototype,"type",void 0),R([Ve()],qt.prototype,"_rendered_styles",void 0),customElements.get("card-mod")||(customElements.define("card-mod",qt),console.info("%cCARD-MOD ".concat(At.version," IS INSTALLED"),"color: green; font-weight: bold"),window.dispatchEvent(new Event("card-mod-bootstrap"))),M(P().mark((function e(){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==customElements.get("home-assistant")){e.next=5;break}return e.next=3,new Promise((function(e){return window.setTimeout(e,100)}));case 3:e.next=0;break;case 5:customElements.get("card-mod")||customElements.define("card-mod",qt);case 6:case"end":return e.stop()}}),e)})))(),window.cardMod_patch_state=window.cardMod_patch_state||{};var zt=window.cardMod_patch_state,Vt=function(e,t,n){if("constructor"!==t){var r=e[t];e[t]=function(){for(var e=arguments.length,t=new Array(e),o=0;o1?t-1:0),r=1;r1?s-1:0),c=1;c1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?r-1:0),i=1;i2?o-2:0),a=2;a2?a-2:0),u=2;u1?o-1:0),a=1;a1?n-1:0),o=1;o1?n-1:0),o=1;o1?t-1:0),r=1;r1?t-1:0),r=1;r1?r-1:0),i=1;i1&&void 0!==s[1]?s[1]:0,r=new Set,10!=n){e.next=4;break}return e.abrupt("return",r);case 4:if(t){e.next=6;break}return e.abrupt("return",r);case 6:if(!t.updateComplete){e.next=9;break}return e.next=9,t.updateComplete;case 9:if(t._cardMod){o=x(t._cardMod);try{for(o.s();!(i=o.n()).done;)(a=i.value).styles&&r.add(a)}catch(e){o.e(e)}finally{o.f()}}if(!t.parentElement){e.next=19;break}return e.t0=pn,e.t1=r,e.next=15,vn(t.parentElement,n+1);case 15:e.t2=e.sent,(0,e.t0)(e.t1,e.t2),e.next=26;break;case 19:if(!t.parentNode){e.next=26;break}return e.t3=pn,e.t4=r,e.next=24,vn(t.parentNode,n+1);case 24:e.t5=e.sent,(0,e.t3)(e.t4,e.t5);case 26:if(!t.host){e.next=33;break}return e.t6=pn,e.t7=r,e.next=31,vn(t.host,n+1);case 31:e.t8=e.sent,(0,e.t6)(e.t7,e.t8);case 33:return e.abrupt("return",r);case 34:case"end":return e.stop()}}),e)}))),yn.apply(this,arguments)}fn=R([Ft("ha-svg-icon")],fn);var mn=function(e){v(n,Nt);var t=y(n);function n(){return $(this,n),t.apply(this,arguments)}return C(n,[{key:"updated",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:new WeakSet;if(null==e)return e;var n=T(e);if("function"!==n&&!("undefined"!=typeof HTMLElement&&e instanceof HTMLElement||"undefined"!=typeof Element&&e instanceof Element)){if("object"!==n)return e;if(!t.has(e)){if(t.add(e),Array.isArray(e)){var r=e.map((function(e){return gn(e,t)})).filter((function(e){return void 0!==e}));return r}for(var o={},i=0,a=Object.entries(e);i2?r-2:0),i=2;i2?r-2:0),i=2;i1?t-1:0),r=1;r2?f-2:0),y=2;y1?n-1:0),o=1;o2?o-2:0),a=2;a1?n-1:0),o=1;o1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r "," "])),this.card)}},{key:"getCardSize",value:function(){if(this._config.report_size)return this._config.report_size;var e=this.shadowRoot;return e&&(e=e.querySelector("ha-card card-maker")),e&&(e=e.getCardSize),e&&(e=e()),e||1}}]),r}();R([Ve()],Nn.prototype,"card",void 0),customElements.get("mod-card")||customElements.define("mod-card",Nn),M(P().mark((function e(){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==customElements.get("home-assistant")){e.next=5;break}return e.next=3,new Promise((function(e){return window.setTimeout(e,100)}));case 3:e.next=0;break;case 5:customElements.get("mod-card")||customElements.define("mod-card",Nn);case 6:case"end":return e.stop()}}),e)})))();var Rn,Ln=[],Un=x(document.querySelectorAll("script"));try{for(Un.s();!(Rn=Un.n()).done;){var Dn=Rn.value;if(null===(Tn=null===(Pn=null==Dn?void 0:Dn.innerText)||void 0===Pn?void 0:Pn.trim())||void 0===Tn?void 0:Tn.startsWith("import(")){var Hn,In=null===(jn=Dn.innerText.split("\n"))||void 0===jn?void 0:jn.map((function(e){return e.trim()})),qn=x(In);try{for(qn.s();!(Hn=qn.n()).done;){var zn=Hn.value;Ln.push(zn.replace(/^import\(\"/,"").replace(/\"\);/,""))}}catch(e){qn.e(e)}finally{qn.f()}}}}catch(e){Un.e(e)}finally{Un.f()}Ln.some((function(e){return e.includes("/card-mod.js")}))||console.info("You may not be getting optimal performance out of card-mod.\nSee https://github.com/thomasloven/lovelace-card-mod#performance-improvements");