diff --git a/www/community/lovelace-mushroom/mushroom.js b/www/community/lovelace-mushroom/mushroom.js index 17b19e8..34b0e56 100644 --- a/www/community/lovelace-mushroom/mushroom.js +++ b/www/community/lovelace-mushroom/mushroom.js @@ -1,4 +1,4 @@ -var t,e,o,i,n,r,a,s,l,c,u,h,d,p,m,f,g,_,v,b,y,w,k,C,$,E,x,A,S,T,M,I,z,P,N,O,B,L,D,j,H,R,U,V,F,G,K,Y,q,W,X,Z,J,Q,tt,et,ot,it,nt,rt,at,st,lt,ct,ut,ht,dt,pt,mt,ft,gt=Object.create,_t=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,bt=Object.getOwnPropertyNames,yt=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty,kt=(t,e)=>()=>(t&&(e=t(t=0)),e),Ct=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),$t=(t,e)=>{let o={};for(var i in t)_t(o,i,{get:t[i],enumerable:!0});return e||_t(o,Symbol.toStringTag,{value:"Module"}),o},Et=(t,e,o)=>(o=null!=t?gt(yt(t)):{},((t,e,o,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(var n,r=bt(e),a=0,s=r.length;ae[t]).bind(null,n),enumerable:!(i=vt(e,n))||i.enumerable});return t})(!e&&t&&t.__esModule?o:_t(o,"default",{value:t,enumerable:!0}),t)),xt=/* @__PURE__ */(t=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(t,{get:(t,e)=>("undefined"!=typeof require?require:t)[e]}):t)(function(t){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Calling `require` for "'+t+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")}),At=kt(()=>{t="5.2.1",e={type:"git",url:"https://github.com/piitaya/lovelace-mushroom"}}),St=kt(()=>{o=globalThis,i=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=/* @__PURE__ */new WeakMap,a=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const o=void 0!==e&&1===e.length;o&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&r.set(e,t))}return t}toString(){return this.cssText}},s=t=>new a("string"==typeof t?t:t+"",void 0,n),l=(t,...e)=>new a(1===t.length?t[0]:e.reduce((e,o,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+t[i+1],t[0]),t,n),c=(t,e)=>{if(i)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),n=o.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=i.cssText,t.appendChild(e)}},u=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const o of t.cssRules)e+=o.cssText;return s(e)})(t):t}),Tt=kt(()=>{St(),({is:f,defineProperty:g,getOwnPropertyDescriptor:_,getOwnPropertyNames:v,getOwnPropertySymbols:b,getPrototypeOf:y}=Object),w=globalThis,k=w.trustedTypes,C=k?k.emptyScript:"",$=w.reactiveElementPolyfillSupport,E=(t,e)=>t,x={toAttribute(t,e){switch(e){case Boolean:t=t?C:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let o=t;switch(e){case Boolean:o=null!==t;break;case Number:o=null===t?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t)}catch(t){o=null}}return o}},A=(t,e)=>!f(t,e),S={attribute:!0,type:String,converter:x,reflect:!1,useDefault:!1,hasChanged:A},null!==(d=(h=Symbol).metadata)&&void 0!==d||(h.metadata=Symbol("metadata")),null!==(p=w.litPropertyMetadata)&&void 0!==p||(w.litPropertyMetadata=/* @__PURE__ */new WeakMap),T=class extends HTMLElement{static addInitializer(t){var e;this._$Ei(),(null!==(e=this.l)&&void 0!==e?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const o=Symbol(),i=this.getPropertyDescriptor(t,o,e);void 0!==i&&g(this.prototype,t,i)}}static getPropertyDescriptor(t,e,o){var i;const{get:n,set:r}=null!==(i=_(this.prototype,t))&&void 0!==i?i:{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const i=null==n?void 0:n.call(this);null==r||r.call(this,e),this.requestUpdate(t,i,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return null!==(e=this.elementProperties.get(t))&&void 0!==e?e:S}static _$Ei(){if(this.hasOwnProperty(E("elementProperties")))return;const t=y(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(E("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(E("properties"))){const t=this.properties,e=[...v(t),...b(t)];for(const o of e)this.createProperty(o,t[o])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,o]of e)this.elementProperties.set(t,o)}this._$Eh=/* @__PURE__ */new Map;for(const[e,o]of this.elementProperties){const t=this._$Eu(e,o);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const o=new Set(t.flat(1/0).reverse());for(const t of o)e.unshift(u(t))}else void 0!==t&&e.push(u(t));return e}static _$Eu(t,e){const o=e.attribute;return!1===o?void 0:"string"==typeof o?o:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=/* @__PURE__ */new Map,this._$E_(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach(t=>t(this))}addController(t){var e,o;(null!==(e=this._$EO)&&void 0!==e?e:this._$EO=/* @__PURE__ */new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&(null===(o=t.hostConnected)||void 0===o||o.call(t))}removeController(t){var e;null===(e=this._$EO)||void 0===e||e.delete(t)}_$E_(){const t=/* @__PURE__ */new Map,e=this.constructor.elementProperties;for(const o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return c(e,this.constructor.elementStyles),e}connectedCallback(){var t,e;null!==(t=this.renderRoot)&&void 0!==t||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$EO)||void 0===e||e.forEach(t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$EO)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)})}attributeChangedCallback(t,e,o){this._$AK(t,o)}_$ET(t,e){const o=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,o);if(void 0!==i&&!0===o.reflect){var n;const r=(void 0!==(null===(n=o.converter)||void 0===n?void 0:n.toAttribute)?o.converter:x).toAttribute(e,o.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){const o=this.constructor,i=o._$Eh.get(t);if(void 0!==i&&this._$Em!==i){var n,r,a;const t=o.getPropertyOptions(i),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:x;this._$Em=i;const l=s.fromAttribute(e,t.type);this[i]=null!==(r=null!=l?l:null===(a=this._$Ej)||void 0===a?void 0:a.get(i))&&void 0!==r?r:l,this._$Em=null}}requestUpdate(t,e,o){if(void 0!==t){var i,n,r;const a=this.constructor,s=this[t];if(null!==(i=o)&&void 0!==i||(o=a.getPropertyOptions(t)),!((null!==(n=o.hasChanged)&&void 0!==n?n:A)(s,e)||o.useDefault&&o.reflect&&s===(null===(r=this._$Ej)||void 0===r?void 0:r.get(t))&&!this.hasAttribute(a._$Eu(t,o))))return;this.C(t,e,o)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:o,reflect:i,wrapped:n},r){var a,s,l;o&&!(null!==(a=this._$Ej)&&void 0!==a?a:this._$Ej=/* @__PURE__ */new Map).has(t)&&(this._$Ej.set(t,null!==(s=null!=r?r:e)&&void 0!==s?s:this[t]),!0!==n||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(null!==(l=this._$Eq)&&void 0!==l?l:this._$Eq=/* @__PURE__ */new Set).add(t))}async _$EP(){var t=this;t.isUpdatePending=!0;try{await t._$ES}catch(e){Promise.reject(e)}const e=t.scheduleUpdate();return null!=e&&await e,!t.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){var t;if(null!==(t=this.renderRoot)&&void 0!==t||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,o]of e){const{wrapped:e}=o,i=this[t];!0!==e||this._$AL.has(t)||void 0===i||this.C(t,void 0,o,i)}}let e=!1;const o=this._$AL;try{var i;e=this.shouldUpdate(o),e?(this.willUpdate(o),null===(i=this._$EO)||void 0===i||i.forEach(t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)}),this.update(o)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(o)}willUpdate(t){}_$AE(t){var e;null===(e=this._$EO)||void 0===e||e.forEach(t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=/* @__PURE__ */new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}},T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[E("elementProperties")]=/* @__PURE__ */new Map,T[E("finalized")]=/* @__PURE__ */new Map,null==$||$({ReactiveElement:T}),(null!==(m=w.reactiveElementVersions)&&void 0!==m?m:w.reactiveElementVersions=[]).push("2.1.1")});function Mt(t,e){if(!R(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(e):e}function It(t,e,o=t,i){var n,r,a;if(e===tt)return e;let s=void 0!==i?null===(n=o._$Co)||void 0===n?void 0:n[i]:o._$Cl;const l=H(e)?void 0:e._$litDirective$;return(null==s?void 0:s.constructor)!==l&&(null==s||null===(r=s._$AO)||void 0===r||r.call(s,!1),void 0===l?s=void 0:(s=new l(t),s._$AT(t,o,i)),void 0!==i?(null!==(a=o._$Co)&&void 0!==a?a:o._$Co=[])[i]=s:o._$Cl=s),void 0!==s&&(e=It(t,s._$AS(t,e.values),s,i)),e}var zt,Pt,Nt,Ot,Bt,Lt,Dt,jt,Ht=kt(()=>{I=globalThis,z=I.trustedTypes,P=z?z.createPolicy("lit-html",{createHTML:t=>t}):void 0,N="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,L=`<${B="?"+O}>`,D=document,j=()=>D.createComment(""),H=t=>null===t||"object"!=typeof t&&"function"!=typeof t,R=Array.isArray,U=t=>R(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),V="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,G=/-->/g,K=/>/g,Y=RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,W=/"/g,X=/^(?:script|style|textarea|title)$/i,Z=t=>(e,...o)=>({_$litType$:t,strings:e,values:o}),J=Z(1),Q=Z(2),Z(3),tt=Symbol.for("lit-noChange"),et=Symbol.for("lit-nothing"),ot=/* @__PURE__ */new WeakMap,it=D.createTreeWalker(D,129),nt=(t,e)=>{const o=t.length-1,i=[];let n,r=2===e?"":3===e?"":"",a=F;for(let l=0;l"===c[0]?(a=null!==(s=n)&&void 0!==s?s:F,u=-1):void 0===c[1]?u=-2:(u=a.lastIndex-c[2].length,o=c[1],a=void 0===c[3]?Y:'"'===c[3]?W:q):a===W||a===q?a=Y:a===G||a===K?a=F:(a=Y,n=void 0);const d=a===Y&&t[l+1].startsWith("/>")?" ":"";r+=a===F?e+L:u>=0?(i.push(o),e.slice(0,u)+N+e.slice(u)+O+d):e+O+(-2===u?l:d)}return[Mt(t,r+(t[o]||"")+(2===e?"":3===e?"":"")),i]},rt=class t{constructor({strings:e,_$litType$:o},i){let n;this.parts=[];let r=0,a=0;const s=e.length-1,l=this.parts,[c,u]=nt(e,o);if(this.el=t.createElement(c,i),it.currentNode=this.el.content,2===o||3===o){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=it.nextNode())&&l.length0){n.textContent=z?z.emptyScript:"";for(let o=0;o2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(/* @__PURE__ */new String),this.strings=o):this._$AH=et}_$AI(t,e=this,o,i){const n=this.strings;let r=!1;if(void 0===n)t=It(this,t,e,0),r=!H(t)||t!==this._$AH&&t!==tt,r&&(this._$AH=t);else{var a;const i=t;let s,l;for(t=n[0],s=0;s{var i;const n=null!==(i=null==o?void 0:o.renderBefore)&&void 0!==i?i:e;let r=n._$litPart$;if(void 0===r){var a;const t=null!==(a=null==o?void 0:o.renderBefore)&&void 0!==a?a:null;n._$litPart$=r=new st(e.insertBefore(j(),t),t,void 0,null!=o?o:{})}return r._$AI(t),r}}),Rt=kt(()=>{Tt(),Tt(),Ht(),Ht(),Nt=globalThis,Ot=class extends T{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const o=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=o.firstChild),o}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ft(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return tt}},Ot._$litElement$=!0,Ot.finalized=!0,null===(zt=Nt.litElementHydrateSupport)||void 0===zt||zt.call(Nt,{LitElement:Ot}),null==(Bt=Nt.litElementPolyfillSupport)||Bt({LitElement:Ot}),(null!==(Pt=Nt.litElementVersions)&&void 0!==Pt?Pt:Nt.litElementVersions=[]).push("4.2.1")}),Ut=kt(()=>{}),Vt=kt(()=>{Tt(),Ht(),Rt(),Ut()}),Ft=kt(()=>{Lt=t=>(e,o)=>{void 0!==o?o.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)}});function Gt(t){return(e,o)=>"object"==typeof o?jt(t,e,o):((t,e,o)=>{const i=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),i?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}var Kt=kt(()=>{Tt(),Dt={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:A},jt=(t=Dt,e,o)=>{const{kind:i,metadata:n}=o;let r=globalThis.litPropertyMetadata.get(n);if(void 0===r&&globalThis.litPropertyMetadata.set(n,r=/* @__PURE__ */new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),r.set(o.name,t),"accessor"===i){const{name:i}=o;return{set(o){const n=e.get.call(this);e.set.call(this,o),this.requestUpdate(i,n,t)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=o;return function(o){const n=this[i];e.call(this,o),this.requestUpdate(i,n,t)}}throw Error("Unsupported decorator location: "+i)}});function Yt(t){return Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yt(t)}var qt=kt(()=>{});var Wt=kt(()=>{qt()});function Xt(t){var e=function(t,e){if("object"!=Yt(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,e||"default");if("object"!=Yt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Yt(e)?e:e+""}var Zt=kt(()=>{qt(),Wt()});function Jt(t,e,o){return(e=Xt(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var Qt=kt(()=>{Zt()});function te(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)}return o}function ee(t){for(var e=1;e{Qt()});function ie(t){return Gt(ee(ee({},t),{},{state:!0,attribute:!1}))}var ne,re=kt(()=>{Kt(),oe()}),ae=kt(()=>{}),se=kt(()=>{ne=(t,e,o)=>(o.configurable=!0,o.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,o),o)});function le(t,e){return(o,i,n)=>{const r=e=>{var o,i;return null!==(o=null===(i=e.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==o?o:null};if(e){const{get:t,set:e}="object"==typeof i?o:null!=n?n:(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return ne(o,i,{get(){let o=t.call(this);return void 0===o&&(o=r(this),(null!==o||this.hasUpdated)&&e.call(this,o)),o}})}return ne(o,i,{get(){return r(this)}})}}var ce,ue,he,de,pe,me,fe,ge,_e,ve,be,ye,we,ke,Ce,$e,Ee,xe,Ae,Se,Te,Me,Ie=kt(()=>{se()}),ze=kt(()=>{}),Pe=kt(()=>{}),Ne=kt(()=>{}),Oe=kt(()=>{}),Be=kt(()=>{Ft(),Kt(),re(),ae(),Ie(),ze(),Pe(),Ne(),Oe()}),Le=kt(()=>{ce={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ue=t=>(...e)=>({_$litDirective$:t,values:e}),he=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}}),De=kt(()=>{Ht(),Le(),de=ue(class extends he{constructor(t){var e;if(super(t),t.type!==ce.ATTRIBUTE||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){var o;this.st=/* @__PURE__ */new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!(null===(o=this.nt)||void 0===o?void 0:o.has(t))&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const r of this.st)r in e||(i.remove(r),this.st.delete(r));for(const r in e){var n;const t=!!e[r];t===this.st.has(r)||null!==(n=this.nt)&&void 0!==n&&n.has(r)||(t?(i.add(r),this.st.add(r)):(i.remove(r),this.st.delete(r)))}return tt}})}),je=kt(()=>{De()}),He=kt(()=>{Ht(),Le(),me=" !"+(pe="important"),fe=ue(class extends he{constructor(t){var e;if(super(t),t.type!==ce.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,o)=>{const i=t[o];return null==i?e:e+`${o=o.includes("-")?o:o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(t,[e]){const{style:o}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)null==e[i]&&(this.ft.delete(i),i.includes("-")?o.removeProperty(i):o[i]=null);for(const i in e){const t=e[i];if(null!=t){this.ft.add(i);const e="string"==typeof t&&t.endsWith(me);i.includes("-")||e?o.setProperty(i,e?t.slice(0,-11):t,e?pe:""):o[i]=t}}return tt}})}),Re=kt(()=>{He()}),Ue=kt(()=>{ge=(t,e,o,i)=>{const[n,r,a]=t.split(".",3);return Number(n)>e||Number(n)===e&&(void 0===i?Number(r)>=o:Number(r)>o||Number(r)===o&&Number(a)>=i)}}),Ve=kt(()=>{_e=new Set(["fan","input_boolean","light","switch","group","automation","humidifier","valve"])}),Fe=kt(()=>{ve=(t,e,o,i)=>{i=i||{},o=null==o?{}:o;const n=new Event(e,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return n.detail=o,t.dispatchEvent(n),n}}),Ge=kt(()=>{0}),Ke=kt(()=>{Ge(),"ha-main-window"===window.name?window:"ha-main-window"===parent.name?parent:top}),Ye=kt(()=>{be=t=>t.substr(0,t.indexOf("."))}),qe=kt(()=>{Ye(),ye=t=>be(t.entity_id)}),We=kt(()=>{we=(t,e)=>ke(t.attributes,e),ke=(t,e)=>0!==(t.supported_features&e)}),Xe=kt(()=>{Ce=(t,e,o)=>Math.min(Math.max(t,e),o),$e=(t,e,o)=>{let i;return i=e?Math.max(t,e):t,i=o?Math.min(i,o):i,i}}),Ze=kt(()=>{Ee=/* @__PURE__ */function(t){return t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none",t}({})}),Je=kt(()=>{xe=(t,e=2)=>Math.round(t*10**e)/10**e}),Qe=kt(()=>{Ze(),Je(),oe(),Ae=t=>{switch(t.number_format){case Ee.comma_decimal:return["en-US","en"];case Ee.decimal_comma:return["de","es","it"];case Ee.space_comma:return["fr","sv","cs"];case Ee.system:return;default:return t.language}},Se=(t,e,o)=>{const i=e?Ae(e):void 0;if(Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},(null==e?void 0:e.number_format)!==Ee.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(i,Me(t,o)).format(Number(t))}catch(n){return console.error(n),new Intl.NumberFormat(void 0,Me(t,o)).format(Number(t))}return"string"==typeof t?t:`${xe(t,null==o?void 0:o.maximumFractionDigits).toString()}${"currency"===(null==o?void 0:o.style)?` ${o.currency}`:""}`},Te=(t,e)=>{var o;const i=null==e?void 0:e.display_precision;return null!=i?{maximumFractionDigits:i,minimumFractionDigits:i}:Number.isInteger(Number(null===(o=t.attributes)||void 0===o?void 0:o.step))&&Number.isInteger(Number(t.state))?{maximumFractionDigits:0}:null!=t.attributes.step?{maximumFractionDigits:Math.ceil(Math.log10(1/t.attributes.step))}:void 0},Me=(t,e)=>{const o=ee({maximumFractionDigits:2},e);if("string"!=typeof t)return o;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;o.minimumFractionDigits=e,o.maximumFractionDigits=e}return o}});var to=kt(()=>{});var eo,oo,io,no=kt(()=>{to()});function ro(t){return"object"==typeof t&&null!=t}function ao(t){return ro(t)&&!Array.isArray(t)}function so(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function lo(t,e,o,i){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:n,branch:r}=e,{type:a}=o,{refinement:s,message:l=`Expected a value of type \`${a}\`${s?` with refinement \`${s}\``:""}, but received: \`${so(i)}\``}=t;return ee(ee({value:i,type:a,refinement:s,key:n[n.length-1],path:n,branch:r},t),{},{message:l})}function*co(t,e,o,i){(function(t){return ro(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const n of t){const t=lo(n,e,o,i);t&&(yield t)}}function*uo(t,e,o={}){const{path:i=[],branch:n=[t],coerce:r=!1,mask:a=!1}=o,s={path:i,branch:n,mask:a};r&&(t=e.coercer(t,s));let l="valid";for(const c of e.validator(t,s))c.explanation=o.message,l="not_valid",yield[c,void 0];for(let[c,u,h]of e.entries(t,s)){const e=uo(u,h,{path:void 0===c?i:[...i,c],branch:void 0===c?n:[...n,u],coerce:r,mask:a,message:o.message});for(const o of e)o[0]?(l=null!=o[0].refinement?"not_refined":"not_valid",yield[o[0],void 0]):r&&(u=o[1],void 0===c?t=u:t instanceof Map?t.set(c,u):t instanceof Set?t.add(u):ro(t)&&(void 0!==u||c in t)&&(t[c]=u))}if("not_valid"!==l)for(const c of e.refiner(t,s))c.explanation=o.message,l="not_refined",yield[c,void 0];"valid"===l&&(yield[void 0,t])}function ho(t,e,o){const i=po(t,e,{message:o});if(i[0])throw i[0]}function po(t,e,o={}){const i=uo(t,e,o),n=function(t){const{done:e,value:o}=t.next();return e?void 0:o}(i);return n[0]?[new oo(n[0],function*(){for(const t of i)t[0]&&(yield t[0])}),void 0]:[void 0,n[1]]}function mo(...t){const e="type"===t[0].type,o=t.map(t=>t.schema),i=Object.assign({},...o);return e?xo(i):Co(i)}function fo(t,e){return new io({type:t,schema:null,validator:e})}function go(t){return new io({type:"dynamic",schema:null,*entries(e,o){yield*t(e,o).entries(e,o)},validator:(e,o)=>t(e,o).validator(e,o),coercer:(e,o)=>t(e,o).coercer(e,o),refiner:(e,o)=>t(e,o).refiner(e,o)})}function _o(){return fo("any",()=>!0)}function vo(t){return new io({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[o,i]of e.entries())yield[o,i,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${so(t)}`})}function bo(){return fo("boolean",t=>"boolean"==typeof t)}function yo(t){const e={},o=t.map(t=>so(t)).join();for(const i of t)e[i]=i;return new io({type:"enums",schema:e,validator:e=>t.includes(e)||`Expected one of \`${o}\`, but received: ${so(e)}`})}function wo(t){const e=so(t),o=typeof t;return new io({type:"literal",schema:"string"===o||"number"===o||"boolean"===o?t:null,validator:o=>o===t||`Expected the literal \`${e}\`, but received: ${so(o)}`})}function ko(){return fo("number",t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${so(t)}`)}function Co(t){const e=t?Object.keys(t):[],o=fo("never",()=>!1);return new io({type:"object",schema:t||null,*entries(i){if(t&&ro(i)){const n=new Set(Object.keys(i));for(const o of e)n.delete(o),yield[o,i[o],t[o]];for(const t of n)yield[t,i[t],o]}},validator:t=>ao(t)||`Expected an object, but received: ${so(t)}`,coercer(e,o){if(!ao(e))return e;const i=ee({},e);if(o.mask&&t)for(const n in i)void 0===t[n]&&delete i[n];return i}})}function $o(t){return new io(ee(ee({},t),{},{validator:(e,o)=>void 0===e||t.validator(e,o),refiner:(e,o)=>void 0===e||t.refiner(e,o)}))}function Eo(){return fo("string",t=>"string"==typeof t||`Expected a string, but received: ${so(t)}`)}function xo(t){const e=Object.keys(t);return new io({type:"type",schema:t,*entries(o){if(ro(o))for(const i of e)yield[i,o[i],t[i]]},validator:t=>ao(t)||`Expected an object, but received: ${so(t)}`,coercer:t=>ao(t)?ee({},t):t})}function Ao(t){const e=t.map(t=>t.type).join(" | ");return new io({type:"union",schema:null,coercer(e,o){for(const i of t){const[t,n]=i.validate(e,{coerce:!0,mask:o.mask});if(!t)return n}return e},validator(o,i){const n=[];for(const e of t){const[...t]=uo(o,e,i),[r]=t;if(!r[0])return[];for(const[e]of t)e&&n.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${so(o)}`,...n]}})}var So,To=kt(()=>{no(),oe(),eo=["message","explanation"],oo=class extends TypeError{constructor(t,e){let o;const{message:i,explanation:n}=t,r=function(t,e){if(null==t)return{};var o,i,n=function(t,e){if(null==t)return{};var o={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;o[i]=t[i]}return o}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i{var i;return null!==(i=o)&&void 0!==i?i:o=[t,...e()]}}},io=class{constructor(t){const{type:e,schema:o,validator:i,refiner:n,coercer:r=t=>t,entries:a=function*(){}}=t;this.type=e,this.schema=o,this.entries=a,this.coercer=r,this.validator=i?(t,e)=>co(i(t,e),e,this,t):()=>[],this.refiner=n?(t,e)=>co(n(t,e),e,this,t):()=>[]}assert(t,e){return ho(t,this,e)}create(t,e){return function(t,e,o){const i=po(t,e,{coerce:!0,message:o});if(i[0])throw i[0];return i[1]}(t,this,e)}is(t){return function(t,e){return!po(t,e)[0]}(t,this)}mask(t,e){return function(t,e,o){const i=po(t,e,{coerce:!0,mask:!0,message:o});if(i[0])throw i[0];return i[1]}(t,this,e)}validate(t,e={}){return po(t,this,e)}}}),Mo=kt(()=>{To(),So=(t,e)=>{if(!(e instanceof oo))return{warnings:[e.message],errors:void 0};const o=[],i=[];for(const n of e.failures())if(void 0===n.value)o.push(t.localize("ui.errors.config.key_missing","key",n.path.join(".")));else if("never"===n.type)i.push(t.localize("ui.errors.config.key_not_expected","key",n.path.join(".")));else{if("union"===n.type)continue;"enums"===n.type?i.push(t.localize("ui.errors.config.key_wrong_type","key",n.path.join("."),"type_correct",n.message.replace("Expected ","").split(", ")[0],"type_wrong",JSON.stringify(n.value))):i.push(t.localize("ui.errors.config.key_wrong_type","key",n.path.join("."),"type_correct",n.refinement||n.type,"type_wrong",JSON.stringify(n.value)))}return{warnings:i,errors:o}}}),Io=kt(()=>{});function zo(t){const e=t.language||"en";return t.translationMetadata.translations[e]&&t.translationMetadata.translations[e].isRTL||!1}var Po,No,Oo,Bo,Lo,Do=kt(()=>{}),jo=kt(()=>{Po=(t,e,o=!1)=>{let i;const n=(...n)=>{const r=o&&!i;clearTimeout(i),i=window.setTimeout(()=>{i=void 0,o||t(...n)},e),r&&t(...n)};return n.cancel=()=>{clearTimeout(i)},n}}),Ho=kt(()=>{No=(t,e)=>{if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let o,i;if(Array.isArray(t)){if(i=t.length,i!==e.length)return!1;for(o=i;0!==o--;)if(!No(t[o],e[o]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(o of t.entries())if(!e.has(o[0]))return!1;for(o of t.entries())if(!No(o[1],e.get(o[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(o of t.entries())if(!e.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(i=t.length,i!==e.length)return!1;for(o=i;0!==o--;)if(t[o]!==e[o])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const n=Object.keys(t);if(i=n.length,i!==Object.keys(e).length)return!1;for(o=i;0!==o--;)if(!Object.prototype.hasOwnProperty.call(e,n[o]))return!1;for(o=i;0!==o--;){const i=n[o];if(!No(t[i],e[i]))return!1}return!0}return t!=t&&e!=e}}),Ro=kt(()=>{}),Uo=kt(()=>{Oo={auto:1,heat_cool:2,heat:3,cool:4,dry:5,fan_only:6,off:7},Bo=(t,e)=>Oo[t]-Oo[e],Lo=/* @__PURE__ */function(t){return t[t.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",t[t.TARGET_TEMPERATURE_RANGE=2]="TARGET_TEMPERATURE_RANGE",t[t.TARGET_HUMIDITY=4]="TARGET_HUMIDITY",t[t.FAN_MODE=8]="FAN_MODE",t[t.PRESET_MODE=16]="PRESET_MODE",t[t.SWING_MODE=32]="SWING_MODE",t[t.AUX_HEAT=64]="AUX_HEAT",t[t.TURN_OFF=128]="TURN_OFF",t[t.TURN_ON=256]="TURN_ON",t[t.SWING_HORIZONTAL_MODE=512]="SWING_HORIZONTAL_MODE",t}({})});var Vo,Fo,Go,Ko=kt(()=>{});function Yo(t){const e=be(t.entity_id),o=t.state;if(["button","input_button","scene"].includes(e))return o!==Vo;if(Go.includes(o))return!1;switch(e){case"cover":case"valve":return!["closed","closing"].includes(o);case"device_tracker":case"person":return"not_home"!==o;case"media_player":return"standby"!==o;case"vacuum":return!["idle","docked","paused"].includes(o);case"plant":return"problem"===o;default:return!0}}function qo(t){return t.state!==Vo}function Wo(t){return"off"===t.state}function Xo(t){return t.attributes.entity_picture_local||t.attributes.entity_picture}var Zo,Jo,Qo,ti,ei,oi,ii,ni,ri,ai,si,li=kt(()=>{Ye(),Go=[Vo="unavailable",Fo="unknown","off"]}),ci=kt(()=>{}),ui=kt(()=>{}),hi=kt(()=>{}),di=kt(()=>{Jo=[(Zo=/* @__PURE__ */function(t){return t.UNKNOWN="unknown",t.ONOFF="onoff",t.BRIGHTNESS="brightness",t.COLOR_TEMP="color_temp",t.HS="hs",t.XY="xy",t.RGB="rgb",t.RGBW="rgbw",t.RGBWW="rgbww",t.WHITE="white",t}({})).HS,Zo.XY,Zo.RGB,Zo.RGBW,Zo.RGBWW],Qo=[...Jo,Zo.COLOR_TEMP,Zo.BRIGHTNESS,Zo.WHITE],ti=t=>{var e;return(null===(e=t.attributes.supported_color_modes)||void 0===e?void 0:e.some(t=>Jo.includes(t)))||!1},ei=t=>{var e;return(null===(e=t.attributes.supported_color_modes)||void 0===e?void 0:e.some(t=>Qo.includes(t)))||!1}}),pi=kt(()=>{oi="locked",ii="locking",ni="unlocked",ri="unlocking"}),mi=kt(()=>{}),fi=kt(()=>{ai=t=>{let e;switch(t.attributes.media_content_type){case"music":case"image":e=t.attributes.media_artist;break;case"playlist":e=t.attributes.media_playlist;break;case"tvshow":e=t.attributes.media_series_title,t.attributes.media_season&&(e+=" S"+t.attributes.media_season,t.attributes.media_episode&&(e+="E"+t.attributes.media_episode));break;default:e=t.attributes.app_name||""}return e}});function gi(t,e){return t===e||!(!si(t)||!si(e))}function _i(t,e){if(t.length!==e.length)return!1;for(var o=0;o{si=Number.isNaN||function(t){return"number"==typeof t&&t!=t}}),Bi=kt(()=>{Oi(),vi(t=>new Intl.Collator(t)),vi(t=>new Intl.Collator(t,{sensitivity:"accent"}))}),Li=kt(()=>{We(),Bi(),bi=t=>yi(t.attributes),yi=t=>ke(t,4)&&"number"==typeof t.in_progress,wi=t=>bi(t)||!!t.attributes.in_progress}),Di=kt(()=>{ki="cleaning",Ci="docked",$i="idle",Ei="returning",xi=1024,Ai=8192}),ji=kt(()=>{oe(),Si=(t,e,o)=>t.subscribeMessage(t=>e(t),ee({type:"render_template"},o))}),Hi=kt(()=>{}),Ri=kt(()=>{}),Ui=kt(()=>{Le()}),Vi=kt(()=>{Vt(),Ui(),Fe(),Ho(),Ti="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,Mi=class extends HTMLElement{constructor(...t){super(...t),this.holdTime=500,this.held=!1,this.cancelled=!1}connectedCallback(){Object.assign(this.style,{position:"fixed",width:Ti?"100px":"50px",height:Ti?"100px":"50px",transform:"translate(-50%, -50%) scale(0)",pointerEvents:"none",zIndex:"999",background:"var(--primary-color)",display:null,opacity:"0.2",borderRadius:"50%",transition:"transform 180ms ease-in-out"}),["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach(t=>{document.addEventListener(t,()=>{this.cancelled=!0,this.timer&&(this._stopAnimation(),clearTimeout(this.timer),this.timer=void 0)},{passive:!0})})}bind(t,e={}){t.actionHandler&&No(e,t.actionHandler.options)||(t.actionHandler?(t.removeEventListener("touchstart",t.actionHandler.start),t.removeEventListener("touchend",t.actionHandler.end),t.removeEventListener("touchcancel",t.actionHandler.end),t.removeEventListener("mousedown",t.actionHandler.start),t.removeEventListener("click",t.actionHandler.end),t.removeEventListener("keydown",t.actionHandler.handleKeyDown)):t.addEventListener("contextmenu",t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1}),t.actionHandler={options:e},e.disabled||(t.actionHandler.start=t=>{let o,i;this.cancelled=!1,t.touches?(o=t.touches[0].clientX,i=t.touches[0].clientY):(o=t.clientX,i=t.clientY),e.hasHold&&(this.held=!1,this.timer=window.setTimeout(()=>{this._startAnimation(o,i),this.held=!0},this.holdTime))},t.actionHandler.end=t=>{if("touchcancel"===t.type||"touchend"===t.type&&this.cancelled)return;const o=t.target;t.cancelable&&t.preventDefault(),e.hasHold&&(clearTimeout(this.timer),this._stopAnimation(),this.timer=void 0),e.hasHold&&this.held?ve(o,"action",{action:"hold"}):e.hasDoubleClick?"click"===t.type&&t.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout(()=>{this.dblClickTimeout=void 0,!1!==e.hasTap&&ve(o,"action",{action:"tap"})},250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,ve(o,"action",{action:"double_tap"})):!1!==e.hasTap&&ve(o,"action",{action:"tap"})},t.actionHandler.handleKeyDown=t=>{["Enter"," "].includes(t.key)&&t.currentTarget.actionHandler.end(t)},t.addEventListener("touchstart",t.actionHandler.start,{passive:!0}),t.addEventListener("touchend",t.actionHandler.end),t.addEventListener("touchcancel",t.actionHandler.end),t.addEventListener("mousedown",t.actionHandler.start,{passive:!0}),t.addEventListener("click",t.actionHandler.end),t.addEventListener("keydown",t.actionHandler.handleKeyDown)))}_startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,transform:"translate(-50%, -50%) scale(1)"})}_stopAnimation(){Object.assign(this.style,{left:null,top:null,transform:"translate(-50%, -50%) scale(0)"})}},Ii=()=>{const t=document.body;if(t.querySelector("action-handler"))return t.querySelector("action-handler");customElements.get("action-handler")||customElements.define("action-handler",Mi);const e=document.createElement("action-handler");return t.appendChild(e),e},zi=(t,e)=>{const o=Ii();o&&o.bind(t,e)},Pi=ue(class extends he{update(t,[e]){return zi(t.element,e),tt}render(t){}})}),Fi=kt(()=>{}),Gi=kt(()=>{}),Ki=kt(()=>{Fe(),Ni=async(t,e,o,i)=>{ve(t,"hass-action",{config:o,action:i})}});function Yi(t){return void 0!==t&&"none"!==t.action}var qi,Wi,Xi,Zi,Ji,Qi,tn,en,on,nn,rn,an=kt(()=>{}),sn=kt(()=>{}),ln=kt(()=>{To(),qi=Co({user:Eo()}),Wi=Ao([bo(),Co({text:$o(Eo()),excemptions:$o(vo(qi))})]),Xi=Co({action:wo("url"),url_path:Eo(),confirmation:$o(Wi)}),Zi=Co({action:yo(["call-service","perform-action"]),service:$o(Eo()),perform_action:$o(Eo()),service_data:$o(Co()),data:$o(Co()),target:$o(Co({entity_id:$o(Ao([Eo(),vo(Eo())])),device_id:$o(Ao([Eo(),vo(Eo())])),area_id:$o(Ao([Eo(),vo(Eo())])),floor_id:$o(Ao([Eo(),vo(Eo())])),label_id:$o(Ao([Eo(),vo(Eo())]))})),confirmation:$o(Wi)}),Ji=Co({action:wo("navigate"),navigation_path:Eo(),confirmation:$o(Wi)}),Qi=xo({action:wo("assist"),pipeline_id:$o(Eo()),start_listening:$o(bo())}),tn=xo({action:wo("fire-dom-event")}),en=Co({action:yo(["none","toggle","more-info","call-service","perform-action","url","navigate","assist"]),confirmation:$o(Wi)}),on=go(t=>{if(t&&"object"==typeof t&&"action"in t)switch(t.action){case"call-service":case"perform-action":return Zi;case"fire-dom-event":return tn;case"navigate":return Ji;case"url":return Xi;case"assist":return Qi}return en})}),cn=kt(()=>{}),un=kt(()=>{Vt(),nn=l` +var t,e,o,i,n,r,a,s,l,c,u,h,d,p,m,f,g,_,v,b,y,w,k,C,$,E,x,A,S,T,M,I,z,P,N,O,B,L,D,j,H,R,U,V,F,G,K,Y,q,W,X,Z,J,Q,tt,et,ot,it,nt,rt,at,st,lt,ct,ut,ht,dt,pt,mt,ft,gt=Object.create,_t=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,bt=Object.getOwnPropertyNames,yt=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty,kt=(t,e)=>()=>(t&&(e=t(t=0)),e),Ct=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),$t=(t,e)=>{let o={};for(var i in t)_t(o,i,{get:t[i],enumerable:!0});return e||_t(o,Symbol.toStringTag,{value:"Module"}),o},Et=(t,e,o)=>(o=null!=t?gt(yt(t)):{},((t,e,o,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(var n,r=bt(e),a=0,s=r.length;ae[t]).bind(null,n),enumerable:!(i=vt(e,n))||i.enumerable});return t})(!e&&t&&t.__esModule?o:_t(o,"default",{value:t,enumerable:!0}),t)),xt=/* @__PURE__ */(t=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(t,{get:(t,e)=>("undefined"!=typeof require?require:t)[e]}):t)(function(t){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Calling `require` for "'+t+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")}),At=kt(()=>{t="5.2.2",e={type:"git",url:"https://github.com/piitaya/lovelace-mushroom"}}),St=kt(()=>{o=globalThis,i=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=/* @__PURE__ */new WeakMap,a=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const o=void 0!==e&&1===e.length;o&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&r.set(e,t))}return t}toString(){return this.cssText}},s=t=>new a("string"==typeof t?t:t+"",void 0,n),l=(t,...e)=>new a(1===t.length?t[0]:e.reduce((e,o,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+t[i+1],t[0]),t,n),c=(t,e)=>{if(i)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),n=o.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=i.cssText,t.appendChild(e)}},u=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const o of t.cssRules)e+=o.cssText;return s(e)})(t):t}),Tt=kt(()=>{St(),({is:f,defineProperty:g,getOwnPropertyDescriptor:_,getOwnPropertyNames:v,getOwnPropertySymbols:b,getPrototypeOf:y}=Object),w=globalThis,k=w.trustedTypes,C=k?k.emptyScript:"",$=w.reactiveElementPolyfillSupport,E=(t,e)=>t,x={toAttribute(t,e){switch(e){case Boolean:t=t?C:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let o=t;switch(e){case Boolean:o=null!==t;break;case Number:o=null===t?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t)}catch(t){o=null}}return o}},A=(t,e)=>!f(t,e),S={attribute:!0,type:String,converter:x,reflect:!1,useDefault:!1,hasChanged:A},null!==(d=(h=Symbol).metadata)&&void 0!==d||(h.metadata=Symbol("metadata")),null!==(p=w.litPropertyMetadata)&&void 0!==p||(w.litPropertyMetadata=/* @__PURE__ */new WeakMap),T=class extends HTMLElement{static addInitializer(t){var e;this._$Ei(),(null!==(e=this.l)&&void 0!==e?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const o=Symbol(),i=this.getPropertyDescriptor(t,o,e);void 0!==i&&g(this.prototype,t,i)}}static getPropertyDescriptor(t,e,o){var i;const{get:n,set:r}=null!==(i=_(this.prototype,t))&&void 0!==i?i:{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){const i=null==n?void 0:n.call(this);null==r||r.call(this,e),this.requestUpdate(t,i,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return null!==(e=this.elementProperties.get(t))&&void 0!==e?e:S}static _$Ei(){if(this.hasOwnProperty(E("elementProperties")))return;const t=y(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(E("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(E("properties"))){const t=this.properties,e=[...v(t),...b(t)];for(const o of e)this.createProperty(o,t[o])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,o]of e)this.elementProperties.set(t,o)}this._$Eh=/* @__PURE__ */new Map;for(const[e,o]of this.elementProperties){const t=this._$Eu(e,o);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const o=new Set(t.flat(1/0).reverse());for(const t of o)e.unshift(u(t))}else void 0!==t&&e.push(u(t));return e}static _$Eu(t,e){const o=e.attribute;return!1===o?void 0:"string"==typeof o?o:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=/* @__PURE__ */new Map,this._$E_(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach(t=>t(this))}addController(t){var e,o;(null!==(e=this._$EO)&&void 0!==e?e:this._$EO=/* @__PURE__ */new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&(null===(o=t.hostConnected)||void 0===o||o.call(t))}removeController(t){var e;null===(e=this._$EO)||void 0===e||e.delete(t)}_$E_(){const t=/* @__PURE__ */new Map,e=this.constructor.elementProperties;for(const o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return c(e,this.constructor.elementStyles),e}connectedCallback(){var t,e;null!==(t=this.renderRoot)&&void 0!==t||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$EO)||void 0===e||e.forEach(t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$EO)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)})}attributeChangedCallback(t,e,o){this._$AK(t,o)}_$ET(t,e){const o=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,o);if(void 0!==i&&!0===o.reflect){var n;const r=(void 0!==(null===(n=o.converter)||void 0===n?void 0:n.toAttribute)?o.converter:x).toAttribute(e,o.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){const o=this.constructor,i=o._$Eh.get(t);if(void 0!==i&&this._$Em!==i){var n,r,a;const t=o.getPropertyOptions(i),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:x;this._$Em=i;const l=s.fromAttribute(e,t.type);this[i]=null!==(r=null!=l?l:null===(a=this._$Ej)||void 0===a?void 0:a.get(i))&&void 0!==r?r:l,this._$Em=null}}requestUpdate(t,e,o){if(void 0!==t){var i,n,r;const a=this.constructor,s=this[t];if(null!==(i=o)&&void 0!==i||(o=a.getPropertyOptions(t)),!((null!==(n=o.hasChanged)&&void 0!==n?n:A)(s,e)||o.useDefault&&o.reflect&&s===(null===(r=this._$Ej)||void 0===r?void 0:r.get(t))&&!this.hasAttribute(a._$Eu(t,o))))return;this.C(t,e,o)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:o,reflect:i,wrapped:n},r){var a,s,l;o&&!(null!==(a=this._$Ej)&&void 0!==a?a:this._$Ej=/* @__PURE__ */new Map).has(t)&&(this._$Ej.set(t,null!==(s=null!=r?r:e)&&void 0!==s?s:this[t]),!0!==n||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(null!==(l=this._$Eq)&&void 0!==l?l:this._$Eq=/* @__PURE__ */new Set).add(t))}async _$EP(){var t=this;t.isUpdatePending=!0;try{await t._$ES}catch(e){Promise.reject(e)}const e=t.scheduleUpdate();return null!=e&&await e,!t.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){var t;if(null!==(t=this.renderRoot)&&void 0!==t||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,o]of e){const{wrapped:e}=o,i=this[t];!0!==e||this._$AL.has(t)||void 0===i||this.C(t,void 0,o,i)}}let e=!1;const o=this._$AL;try{var i;e=this.shouldUpdate(o),e?(this.willUpdate(o),null===(i=this._$EO)||void 0===i||i.forEach(t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)}),this.update(o)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(o)}willUpdate(t){}_$AE(t){var e;null===(e=this._$EO)||void 0===e||e.forEach(t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=/* @__PURE__ */new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}},T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[E("elementProperties")]=/* @__PURE__ */new Map,T[E("finalized")]=/* @__PURE__ */new Map,null==$||$({ReactiveElement:T}),(null!==(m=w.reactiveElementVersions)&&void 0!==m?m:w.reactiveElementVersions=[]).push("2.1.1")});function Mt(t,e){if(!R(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(e):e}function It(t,e,o=t,i){var n,r,a;if(e===tt)return e;let s=void 0!==i?null===(n=o._$Co)||void 0===n?void 0:n[i]:o._$Cl;const l=H(e)?void 0:e._$litDirective$;return(null==s?void 0:s.constructor)!==l&&(null==s||null===(r=s._$AO)||void 0===r||r.call(s,!1),void 0===l?s=void 0:(s=new l(t),s._$AT(t,o,i)),void 0!==i?(null!==(a=o._$Co)&&void 0!==a?a:o._$Co=[])[i]=s:o._$Cl=s),void 0!==s&&(e=It(t,s._$AS(t,e.values),s,i)),e}var zt,Pt,Nt,Ot,Bt,Lt,Dt,jt,Ht=kt(()=>{I=globalThis,z=I.trustedTypes,P=z?z.createPolicy("lit-html",{createHTML:t=>t}):void 0,N="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,L=`<${B="?"+O}>`,D=document,j=()=>D.createComment(""),H=t=>null===t||"object"!=typeof t&&"function"!=typeof t,R=Array.isArray,U=t=>R(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),V="[ \t\n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,G=/-->/g,K=/>/g,Y=RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,W=/"/g,X=/^(?:script|style|textarea|title)$/i,Z=t=>(e,...o)=>({_$litType$:t,strings:e,values:o}),J=Z(1),Q=Z(2),Z(3),tt=Symbol.for("lit-noChange"),et=Symbol.for("lit-nothing"),ot=/* @__PURE__ */new WeakMap,it=D.createTreeWalker(D,129),nt=(t,e)=>{const o=t.length-1,i=[];let n,r=2===e?"":3===e?"":"",a=F;for(let l=0;l"===c[0]?(a=null!==(s=n)&&void 0!==s?s:F,u=-1):void 0===c[1]?u=-2:(u=a.lastIndex-c[2].length,o=c[1],a=void 0===c[3]?Y:'"'===c[3]?W:q):a===W||a===q?a=Y:a===G||a===K?a=F:(a=Y,n=void 0);const d=a===Y&&t[l+1].startsWith("/>")?" ":"";r+=a===F?e+L:u>=0?(i.push(o),e.slice(0,u)+N+e.slice(u)+O+d):e+O+(-2===u?l:d)}return[Mt(t,r+(t[o]||"")+(2===e?"":3===e?"":"")),i]},rt=class t{constructor({strings:e,_$litType$:o},i){let n;this.parts=[];let r=0,a=0;const s=e.length-1,l=this.parts,[c,u]=nt(e,o);if(this.el=t.createElement(c,i),it.currentNode=this.el.content,2===o||3===o){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=it.nextNode())&&l.length0){n.textContent=z?z.emptyScript:"";for(let o=0;o2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(/* @__PURE__ */new String),this.strings=o):this._$AH=et}_$AI(t,e=this,o,i){const n=this.strings;let r=!1;if(void 0===n)t=It(this,t,e,0),r=!H(t)||t!==this._$AH&&t!==tt,r&&(this._$AH=t);else{var a;const i=t;let s,l;for(t=n[0],s=0;s{var i;const n=null!==(i=null==o?void 0:o.renderBefore)&&void 0!==i?i:e;let r=n._$litPart$;if(void 0===r){var a;const t=null!==(a=null==o?void 0:o.renderBefore)&&void 0!==a?a:null;n._$litPart$=r=new st(e.insertBefore(j(),t),t,void 0,null!=o?o:{})}return r._$AI(t),r}}),Rt=kt(()=>{Tt(),Tt(),Ht(),Ht(),Nt=globalThis,Ot=class extends T{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const o=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=o.firstChild),o}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ft(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return tt}},Ot._$litElement$=!0,Ot.finalized=!0,null===(zt=Nt.litElementHydrateSupport)||void 0===zt||zt.call(Nt,{LitElement:Ot}),null==(Bt=Nt.litElementPolyfillSupport)||Bt({LitElement:Ot}),(null!==(Pt=Nt.litElementVersions)&&void 0!==Pt?Pt:Nt.litElementVersions=[]).push("4.2.1")}),Ut=kt(()=>{}),Vt=kt(()=>{Tt(),Ht(),Rt(),Ut()}),Ft=kt(()=>{Lt=t=>(e,o)=>{void 0!==o?o.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)}});function Gt(t){return(e,o)=>"object"==typeof o?jt(t,e,o):((t,e,o)=>{const i=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),i?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}var Kt=kt(()=>{Tt(),Dt={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:A},jt=(t=Dt,e,o)=>{const{kind:i,metadata:n}=o;let r=globalThis.litPropertyMetadata.get(n);if(void 0===r&&globalThis.litPropertyMetadata.set(n,r=/* @__PURE__ */new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),r.set(o.name,t),"accessor"===i){const{name:i}=o;return{set(o){const n=e.get.call(this);e.set.call(this,o),this.requestUpdate(i,n,t)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=o;return function(o){const n=this[i];e.call(this,o),this.requestUpdate(i,n,t)}}throw Error("Unsupported decorator location: "+i)}});function Yt(t){return Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yt(t)}var qt=kt(()=>{});var Wt=kt(()=>{qt()});function Xt(t){var e=function(t,e){if("object"!=Yt(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,e||"default");if("object"!=Yt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Yt(e)?e:e+""}var Zt=kt(()=>{qt(),Wt()});function Jt(t,e,o){return(e=Xt(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var Qt=kt(()=>{Zt()});function te(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,i)}return o}function ee(t){for(var e=1;e{Qt()});function ie(t){return Gt(ee(ee({},t),{},{state:!0,attribute:!1}))}var ne,re=kt(()=>{Kt(),oe()}),ae=kt(()=>{}),se=kt(()=>{ne=(t,e,o)=>(o.configurable=!0,o.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,o),o)});function le(t,e){return(o,i,n)=>{const r=e=>{var o,i;return null!==(o=null===(i=e.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==o?o:null};if(e){const{get:t,set:e}="object"==typeof i?o:null!=n?n:(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return ne(o,i,{get(){let o=t.call(this);return void 0===o&&(o=r(this),(null!==o||this.hasUpdated)&&e.call(this,o)),o}})}return ne(o,i,{get(){return r(this)}})}}var ce,ue,he,de,pe,me,fe,ge,_e,ve,be,ye,we,ke,Ce,$e,Ee,xe,Ae,Se,Te,Me,Ie=kt(()=>{se()}),ze=kt(()=>{}),Pe=kt(()=>{}),Ne=kt(()=>{}),Oe=kt(()=>{}),Be=kt(()=>{Ft(),Kt(),re(),ae(),Ie(),ze(),Pe(),Ne(),Oe()}),Le=kt(()=>{ce={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ue=t=>(...e)=>({_$litDirective$:t,values:e}),he=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}}),De=kt(()=>{Ht(),Le(),de=ue(class extends he{constructor(t){var e;if(super(t),t.type!==ce.ATTRIBUTE||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){var o;this.st=/* @__PURE__ */new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!(null===(o=this.nt)||void 0===o?void 0:o.has(t))&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const r of this.st)r in e||(i.remove(r),this.st.delete(r));for(const r in e){var n;const t=!!e[r];t===this.st.has(r)||null!==(n=this.nt)&&void 0!==n&&n.has(r)||(t?(i.add(r),this.st.add(r)):(i.remove(r),this.st.delete(r)))}return tt}})}),je=kt(()=>{De()}),He=kt(()=>{Ht(),Le(),me=" !"+(pe="important"),fe=ue(class extends he{constructor(t){var e;if(super(t),t.type!==ce.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,o)=>{const i=t[o];return null==i?e:e+`${o=o.includes("-")?o:o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(t,[e]){const{style:o}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)null==e[i]&&(this.ft.delete(i),i.includes("-")?o.removeProperty(i):o[i]=null);for(const i in e){const t=e[i];if(null!=t){this.ft.add(i);const e="string"==typeof t&&t.endsWith(me);i.includes("-")||e?o.setProperty(i,e?t.slice(0,-11):t,e?pe:""):o[i]=t}}return tt}})}),Re=kt(()=>{He()}),Ue=kt(()=>{ge=(t,e,o,i)=>{const[n,r,a]=t.split(".",3);return Number(n)>e||Number(n)===e&&(void 0===i?Number(r)>=o:Number(r)>o||Number(r)===o&&Number(a)>=i)}}),Ve=kt(()=>{_e=new Set(["fan","input_boolean","light","switch","group","automation","humidifier","valve"])}),Fe=kt(()=>{ve=(t,e,o,i)=>{i=i||{},o=null==o?{}:o;const n=new Event(e,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return n.detail=o,t.dispatchEvent(n),n}}),Ge=kt(()=>{0}),Ke=kt(()=>{Ge(),"ha-main-window"===window.name?window:"ha-main-window"===parent.name?parent:top}),Ye=kt(()=>{be=t=>t.substr(0,t.indexOf("."))}),qe=kt(()=>{Ye(),ye=t=>be(t.entity_id)}),We=kt(()=>{we=(t,e)=>ke(t.attributes,e),ke=(t,e)=>0!==(t.supported_features&e)}),Xe=kt(()=>{Ce=(t,e,o)=>Math.min(Math.max(t,e),o),$e=(t,e,o)=>{let i;return i=e?Math.max(t,e):t,i=o?Math.min(i,o):i,i}}),Ze=kt(()=>{Ee=/* @__PURE__ */function(t){return t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none",t}({})}),Je=kt(()=>{xe=(t,e=2)=>Math.round(t*10**e)/10**e}),Qe=kt(()=>{Ze(),Je(),oe(),Ae=t=>{switch(t.number_format){case Ee.comma_decimal:return["en-US","en"];case Ee.decimal_comma:return["de","es","it"];case Ee.space_comma:return["fr","sv","cs"];case Ee.system:return;default:return t.language}},Se=(t,e,o)=>{const i=e?Ae(e):void 0;if(Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},(null==e?void 0:e.number_format)!==Ee.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(i,Me(t,o)).format(Number(t))}catch(n){return console.error(n),new Intl.NumberFormat(void 0,Me(t,o)).format(Number(t))}return"string"==typeof t?t:`${xe(t,null==o?void 0:o.maximumFractionDigits).toString()}${"currency"===(null==o?void 0:o.style)?` ${o.currency}`:""}`},Te=(t,e)=>{var o;const i=null==e?void 0:e.display_precision;return null!=i?{maximumFractionDigits:i,minimumFractionDigits:i}:Number.isInteger(Number(null===(o=t.attributes)||void 0===o?void 0:o.step))&&Number.isInteger(Number(t.state))?{maximumFractionDigits:0}:null!=t.attributes.step?{maximumFractionDigits:Math.ceil(Math.log10(1/t.attributes.step))}:void 0},Me=(t,e)=>{const o=ee({maximumFractionDigits:2},e);if("string"!=typeof t)return o;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;o.minimumFractionDigits=e,o.maximumFractionDigits=e}return o}});var to=kt(()=>{});var eo,oo,io,no=kt(()=>{to()});function ro(t){return"object"==typeof t&&null!=t}function ao(t){return ro(t)&&!Array.isArray(t)}function so(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function lo(t,e,o,i){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:n,branch:r}=e,{type:a}=o,{refinement:s,message:l=`Expected a value of type \`${a}\`${s?` with refinement \`${s}\``:""}, but received: \`${so(i)}\``}=t;return ee(ee({value:i,type:a,refinement:s,key:n[n.length-1],path:n,branch:r},t),{},{message:l})}function*co(t,e,o,i){(function(t){return ro(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const n of t){const t=lo(n,e,o,i);t&&(yield t)}}function*uo(t,e,o={}){const{path:i=[],branch:n=[t],coerce:r=!1,mask:a=!1}=o,s={path:i,branch:n,mask:a};r&&(t=e.coercer(t,s));let l="valid";for(const c of e.validator(t,s))c.explanation=o.message,l="not_valid",yield[c,void 0];for(let[c,u,h]of e.entries(t,s)){const e=uo(u,h,{path:void 0===c?i:[...i,c],branch:void 0===c?n:[...n,u],coerce:r,mask:a,message:o.message});for(const o of e)o[0]?(l=null!=o[0].refinement?"not_refined":"not_valid",yield[o[0],void 0]):r&&(u=o[1],void 0===c?t=u:t instanceof Map?t.set(c,u):t instanceof Set?t.add(u):ro(t)&&(void 0!==u||c in t)&&(t[c]=u))}if("not_valid"!==l)for(const c of e.refiner(t,s))c.explanation=o.message,l="not_refined",yield[c,void 0];"valid"===l&&(yield[void 0,t])}function ho(t,e,o){const i=po(t,e,{message:o});if(i[0])throw i[0]}function po(t,e,o={}){const i=uo(t,e,o),n=function(t){const{done:e,value:o}=t.next();return e?void 0:o}(i);return n[0]?[new oo(n[0],function*(){for(const t of i)t[0]&&(yield t[0])}),void 0]:[void 0,n[1]]}function mo(...t){const e="type"===t[0].type,o=t.map(t=>t.schema),i=Object.assign({},...o);return e?xo(i):Co(i)}function fo(t,e){return new io({type:t,schema:null,validator:e})}function go(t){return new io({type:"dynamic",schema:null,*entries(e,o){yield*t(e,o).entries(e,o)},validator:(e,o)=>t(e,o).validator(e,o),coercer:(e,o)=>t(e,o).coercer(e,o),refiner:(e,o)=>t(e,o).refiner(e,o)})}function _o(){return fo("any",()=>!0)}function vo(t){return new io({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[o,i]of e.entries())yield[o,i,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${so(t)}`})}function bo(){return fo("boolean",t=>"boolean"==typeof t)}function yo(t){const e={},o=t.map(t=>so(t)).join();for(const i of t)e[i]=i;return new io({type:"enums",schema:e,validator:e=>t.includes(e)||`Expected one of \`${o}\`, but received: ${so(e)}`})}function wo(t){const e=so(t),o=typeof t;return new io({type:"literal",schema:"string"===o||"number"===o||"boolean"===o?t:null,validator:o=>o===t||`Expected the literal \`${e}\`, but received: ${so(o)}`})}function ko(){return fo("number",t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${so(t)}`)}function Co(t){const e=t?Object.keys(t):[],o=fo("never",()=>!1);return new io({type:"object",schema:t||null,*entries(i){if(t&&ro(i)){const n=new Set(Object.keys(i));for(const o of e)n.delete(o),yield[o,i[o],t[o]];for(const t of n)yield[t,i[t],o]}},validator:t=>ao(t)||`Expected an object, but received: ${so(t)}`,coercer(e,o){if(!ao(e))return e;const i=ee({},e);if(o.mask&&t)for(const n in i)void 0===t[n]&&delete i[n];return i}})}function $o(t){return new io(ee(ee({},t),{},{validator:(e,o)=>void 0===e||t.validator(e,o),refiner:(e,o)=>void 0===e||t.refiner(e,o)}))}function Eo(){return fo("string",t=>"string"==typeof t||`Expected a string, but received: ${so(t)}`)}function xo(t){const e=Object.keys(t);return new io({type:"type",schema:t,*entries(o){if(ro(o))for(const i of e)yield[i,o[i],t[i]]},validator:t=>ao(t)||`Expected an object, but received: ${so(t)}`,coercer:t=>ao(t)?ee({},t):t})}function Ao(t){const e=t.map(t=>t.type).join(" | ");return new io({type:"union",schema:null,coercer(e,o){for(const i of t){const[t,n]=i.validate(e,{coerce:!0,mask:o.mask});if(!t)return n}return e},validator(o,i){const n=[];for(const e of t){const[...t]=uo(o,e,i),[r]=t;if(!r[0])return[];for(const[e]of t)e&&n.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${so(o)}`,...n]}})}var So,To=kt(()=>{no(),oe(),eo=["message","explanation"],oo=class extends TypeError{constructor(t,e){let o;const{message:i,explanation:n}=t,r=function(t,e){if(null==t)return{};var o,i,n=function(t,e){if(null==t)return{};var o={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;o[i]=t[i]}return o}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i{var i;return null!==(i=o)&&void 0!==i?i:o=[t,...e()]}}},io=class{constructor(t){const{type:e,schema:o,validator:i,refiner:n,coercer:r=t=>t,entries:a=function*(){}}=t;this.type=e,this.schema=o,this.entries=a,this.coercer=r,this.validator=i?(t,e)=>co(i(t,e),e,this,t):()=>[],this.refiner=n?(t,e)=>co(n(t,e),e,this,t):()=>[]}assert(t,e){return ho(t,this,e)}create(t,e){return function(t,e,o){const i=po(t,e,{coerce:!0,message:o});if(i[0])throw i[0];return i[1]}(t,this,e)}is(t){return function(t,e){return!po(t,e)[0]}(t,this)}mask(t,e){return function(t,e,o){const i=po(t,e,{coerce:!0,mask:!0,message:o});if(i[0])throw i[0];return i[1]}(t,this,e)}validate(t,e={}){return po(t,this,e)}}}),Mo=kt(()=>{To(),So=(t,e)=>{if(!(e instanceof oo))return{warnings:[e.message],errors:void 0};const o=[],i=[];for(const n of e.failures())if(void 0===n.value)o.push(t.localize("ui.errors.config.key_missing","key",n.path.join(".")));else if("never"===n.type)i.push(t.localize("ui.errors.config.key_not_expected","key",n.path.join(".")));else{if("union"===n.type)continue;"enums"===n.type?i.push(t.localize("ui.errors.config.key_wrong_type","key",n.path.join("."),"type_correct",n.message.replace("Expected ","").split(", ")[0],"type_wrong",JSON.stringify(n.value))):i.push(t.localize("ui.errors.config.key_wrong_type","key",n.path.join("."),"type_correct",n.refinement||n.type,"type_wrong",JSON.stringify(n.value)))}return{warnings:i,errors:o}}}),Io=kt(()=>{});function zo(t){const e=t.language||"en";return t.translationMetadata.translations[e]&&t.translationMetadata.translations[e].isRTL||!1}var Po,No,Oo,Bo,Lo,Do=kt(()=>{}),jo=kt(()=>{Po=(t,e,o=!1)=>{let i;const n=(...n)=>{const r=o&&!i;clearTimeout(i),i=window.setTimeout(()=>{i=void 0,o||t(...n)},e),r&&t(...n)};return n.cancel=()=>{clearTimeout(i)},n}}),Ho=kt(()=>{No=(t,e)=>{if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let o,i;if(Array.isArray(t)){if(i=t.length,i!==e.length)return!1;for(o=i;0!==o--;)if(!No(t[o],e[o]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(o of t.entries())if(!e.has(o[0]))return!1;for(o of t.entries())if(!No(o[1],e.get(o[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(o of t.entries())if(!e.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(i=t.length,i!==e.length)return!1;for(o=i;0!==o--;)if(t[o]!==e[o])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const n=Object.keys(t);if(i=n.length,i!==Object.keys(e).length)return!1;for(o=i;0!==o--;)if(!Object.prototype.hasOwnProperty.call(e,n[o]))return!1;for(o=i;0!==o--;){const i=n[o];if(!No(t[i],e[i]))return!1}return!0}return t!=t&&e!=e}}),Ro=kt(()=>{}),Uo=kt(()=>{Oo={auto:1,heat_cool:2,heat:3,cool:4,dry:5,fan_only:6,off:7},Bo=(t,e)=>Oo[t]-Oo[e],Lo=/* @__PURE__ */function(t){return t[t.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",t[t.TARGET_TEMPERATURE_RANGE=2]="TARGET_TEMPERATURE_RANGE",t[t.TARGET_HUMIDITY=4]="TARGET_HUMIDITY",t[t.FAN_MODE=8]="FAN_MODE",t[t.PRESET_MODE=16]="PRESET_MODE",t[t.SWING_MODE=32]="SWING_MODE",t[t.AUX_HEAT=64]="AUX_HEAT",t[t.TURN_OFF=128]="TURN_OFF",t[t.TURN_ON=256]="TURN_ON",t[t.SWING_HORIZONTAL_MODE=512]="SWING_HORIZONTAL_MODE",t}({})});var Vo,Fo,Go,Ko=kt(()=>{});function Yo(t){const e=be(t.entity_id),o=t.state;if(["button","input_button","scene"].includes(e))return o!==Vo;if(Go.includes(o))return!1;switch(e){case"cover":case"valve":return!["closed","closing"].includes(o);case"device_tracker":case"person":return"not_home"!==o;case"media_player":return"standby"!==o;case"vacuum":return!["idle","docked","paused"].includes(o);case"plant":return"problem"===o;default:return!0}}function qo(t){return t.state!==Vo}function Wo(t){return"off"===t.state}function Xo(t){return t.attributes.entity_picture_local||t.attributes.entity_picture}var Zo,Jo,Qo,ti,ei,oi,ii,ni,ri,ai,si,li=kt(()=>{Ye(),Go=[Vo="unavailable",Fo="unknown","off"]}),ci=kt(()=>{}),ui=kt(()=>{}),hi=kt(()=>{}),di=kt(()=>{Jo=[(Zo=/* @__PURE__ */function(t){return t.UNKNOWN="unknown",t.ONOFF="onoff",t.BRIGHTNESS="brightness",t.COLOR_TEMP="color_temp",t.HS="hs",t.XY="xy",t.RGB="rgb",t.RGBW="rgbw",t.RGBWW="rgbww",t.WHITE="white",t}({})).HS,Zo.XY,Zo.RGB,Zo.RGBW,Zo.RGBWW],Qo=[...Jo,Zo.COLOR_TEMP,Zo.BRIGHTNESS,Zo.WHITE],ti=t=>{var e;return(null===(e=t.attributes.supported_color_modes)||void 0===e?void 0:e.some(t=>Jo.includes(t)))||!1},ei=t=>{var e;return(null===(e=t.attributes.supported_color_modes)||void 0===e?void 0:e.some(t=>Qo.includes(t)))||!1}}),pi=kt(()=>{oi="locked",ii="locking",ni="unlocked",ri="unlocking"}),mi=kt(()=>{}),fi=kt(()=>{ai=t=>{let e;switch(t.attributes.media_content_type){case"music":case"image":e=t.attributes.media_artist;break;case"playlist":e=t.attributes.media_playlist;break;case"tvshow":e=t.attributes.media_series_title,t.attributes.media_season&&(e+=" S"+t.attributes.media_season,t.attributes.media_episode&&(e+="E"+t.attributes.media_episode));break;default:e=t.attributes.app_name||""}return e}});function gi(t,e){return t===e||!(!si(t)||!si(e))}function _i(t,e){if(t.length!==e.length)return!1;for(var o=0;o{si=Number.isNaN||function(t){return"number"==typeof t&&t!=t}}),Bi=kt(()=>{Oi(),vi(t=>new Intl.Collator(t)),vi(t=>new Intl.Collator(t,{sensitivity:"accent"}))}),Li=kt(()=>{We(),Bi(),bi=t=>yi(t.attributes),yi=t=>ke(t,4)&&"number"==typeof t.in_progress,wi=t=>bi(t)||!!t.attributes.in_progress}),Di=kt(()=>{ki="cleaning",Ci="docked",$i="idle",Ei="returning",xi=1024,Ai=8192}),ji=kt(()=>{oe(),Si=(t,e,o)=>t.subscribeMessage(t=>e(t),ee({type:"render_template"},o))}),Hi=kt(()=>{}),Ri=kt(()=>{}),Ui=kt(()=>{Le()}),Vi=kt(()=>{Vt(),Ui(),Fe(),Ho(),Ti="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,Mi=class extends HTMLElement{constructor(...t){super(...t),this.holdTime=500,this.held=!1,this.cancelled=!1}connectedCallback(){Object.assign(this.style,{position:"fixed",width:Ti?"100px":"50px",height:Ti?"100px":"50px",transform:"translate(-50%, -50%) scale(0)",pointerEvents:"none",zIndex:"999",background:"var(--primary-color)",display:null,opacity:"0.2",borderRadius:"50%",transition:"transform 180ms ease-in-out"}),["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach(t=>{document.addEventListener(t,()=>{this.cancelled=!0,this.timer&&(this._stopAnimation(),clearTimeout(this.timer),this.timer=void 0)},{passive:!0})})}bind(t,e={}){t.actionHandler&&No(e,t.actionHandler.options)||(t.actionHandler?(t.removeEventListener("touchstart",t.actionHandler.start),t.removeEventListener("touchend",t.actionHandler.end),t.removeEventListener("touchcancel",t.actionHandler.end),t.removeEventListener("mousedown",t.actionHandler.start),t.removeEventListener("click",t.actionHandler.end),t.removeEventListener("keydown",t.actionHandler.handleKeyDown)):t.addEventListener("contextmenu",t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1}),t.actionHandler={options:e},e.disabled||(t.actionHandler.start=t=>{let o,i;this.cancelled=!1,t.touches?(o=t.touches[0].clientX,i=t.touches[0].clientY):(o=t.clientX,i=t.clientY),e.hasHold&&(this.held=!1,this.timer=window.setTimeout(()=>{this._startAnimation(o,i),this.held=!0},this.holdTime))},t.actionHandler.end=t=>{if("touchcancel"===t.type||"touchend"===t.type&&this.cancelled)return;const o=t.target;t.cancelable&&t.preventDefault(),e.hasHold&&(clearTimeout(this.timer),this._stopAnimation(),this.timer=void 0),e.hasHold&&this.held?ve(o,"action",{action:"hold"}):e.hasDoubleClick?"click"===t.type&&t.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout(()=>{this.dblClickTimeout=void 0,!1!==e.hasTap&&ve(o,"action",{action:"tap"})},250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,ve(o,"action",{action:"double_tap"})):!1!==e.hasTap&&ve(o,"action",{action:"tap"})},t.actionHandler.handleKeyDown=t=>{["Enter"," "].includes(t.key)&&t.currentTarget.actionHandler.end(t)},t.addEventListener("touchstart",t.actionHandler.start,{passive:!0}),t.addEventListener("touchend",t.actionHandler.end),t.addEventListener("touchcancel",t.actionHandler.end),t.addEventListener("mousedown",t.actionHandler.start,{passive:!0}),t.addEventListener("click",t.actionHandler.end),t.addEventListener("keydown",t.actionHandler.handleKeyDown)))}_startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,transform:"translate(-50%, -50%) scale(1)"})}_stopAnimation(){Object.assign(this.style,{left:null,top:null,transform:"translate(-50%, -50%) scale(0)"})}},Ii=()=>{const t=document.body;if(t.querySelector("action-handler"))return t.querySelector("action-handler");customElements.get("action-handler")||customElements.define("action-handler",Mi);const e=document.createElement("action-handler");return t.appendChild(e),e},zi=(t,e)=>{const o=Ii();o&&o.bind(t,e)},Pi=ue(class extends he{update(t,[e]){return zi(t.element,e),tt}render(t){}})}),Fi=kt(()=>{}),Gi=kt(()=>{}),Ki=kt(()=>{Fe(),Ni=async(t,e,o,i)=>{ve(t,"hass-action",{config:o,action:i})}});function Yi(t){return void 0!==t&&"none"!==t.action}var qi,Wi,Xi,Zi,Ji,Qi,tn,en,on,nn,rn,an=kt(()=>{}),sn=kt(()=>{}),ln=kt(()=>{To(),qi=Co({user:Eo()}),Wi=Ao([bo(),Co({text:$o(Eo()),excemptions:$o(vo(qi))})]),Xi=Co({action:wo("url"),url_path:Eo(),confirmation:$o(Wi)}),Zi=Co({action:yo(["call-service","perform-action"]),service:$o(Eo()),perform_action:$o(Eo()),service_data:$o(Co()),data:$o(Co()),target:$o(Co({entity_id:$o(Ao([Eo(),vo(Eo())])),device_id:$o(Ao([Eo(),vo(Eo())])),area_id:$o(Ao([Eo(),vo(Eo())])),floor_id:$o(Ao([Eo(),vo(Eo())])),label_id:$o(Ao([Eo(),vo(Eo())]))})),confirmation:$o(Wi)}),Ji=Co({action:wo("navigate"),navigation_path:Eo(),confirmation:$o(Wi)}),Qi=xo({action:wo("assist"),pipeline_id:$o(Eo()),start_listening:$o(bo())}),tn=xo({action:wo("fire-dom-event")}),en=Co({action:yo(["none","toggle","more-info","call-service","perform-action","url","navigate","assist"]),confirmation:$o(Wi)}),on=go(t=>{if(t&&"object"==typeof t&&"action"in t)switch(t.action){case"call-service":case"perform-action":return Zi;case"fire-dom-event":return tn;case"navigate":return Ji;case"url":return Xi;case"assist":return Qi}return en})}),cn=kt(()=>{}),un=kt(()=>{Vt(),nn=l` #sortable a:nth-of-type(2n) paper-icon-item { animation-name: keyframes1; animation-iteration-count: infinite; @@ -3099,7 +3099,7 @@ var t,e,o,i,n,r,a,s,l,c,u,h,d,p,m,f,g,_,v,b,y,w,k,C,$,E,x,A,S,T,M,I,z,P,N,O,B,L, margin-top: 8px; border-radius: 8px; } - `]}},gn([Gt({attribute:!1})],xT.prototype,"hass",void 0),gn([ie()],xT.prototype,"_config",void 0),gn([ie()],xT.prototype,"_legacyConfig",void 0),xT=gn([Lt("mushroom-template-card-editor")],xT)}),GT=kt(()=>{Vt(),Be(),je(),gT(),Re(),Oi(),AT=/* @__PURE__ */Et(hv()),pn(),HT(),RT(),dv(),cg(),UT(),pv(),__(),vn(),oe(),TT=t=>{const e=be(t);return _e.has(e)||["button","input_button","scene"].includes(e)?"toggle":"none"},tg({type:"mushroom-template-card",name:"Mushroom Template",description:"Build your own Mushroom card using templates"}),MT=new R_(1e3),IT=["icon","color","primary","secondary","picture","badge_icon","badge_color","badge_text"],(ST=class extends Ot{constructor(...t){super(...t),this._unsubRenderTemplates=/* @__PURE__ */new Map,this._featureContext=vi(t=>({entity_id:t.entity,area_id:t.area})),this._featurePosition=vi(t=>t.vertical?"bottom":t.features_position||"bottom"),this._displayedFeatures=vi(t=>{const e=t.features||[];return"inline"===this._featurePosition(t)?e.slice(0,1):e})}static async getConfigElement(){return await Promise.resolve().then(()=>(FT(),VT)),document.createElement("mushroom-template-card-editor")}static getStubConfig(){return{type:"custom:mushroom-template-card",primary:"Hello, {{user}}",secondary:"How are you?",icon:"mdi:mushroom"}}connectedCallback(){super.connectedCallback(),this._tryConnect()}disconnectedCallback(){if(super.disconnectedCallback(),this._tryDisconnect(),this._config&&this._templateResults){const t=this._computeCacheKey();MT.set(t,this._templateResults)}}_computeCacheKey(){return(0,AT.default)(this._config)}willUpdate(t){if(super.willUpdate(t),this._config&&!this._templateResults){const t=this._computeCacheKey();MT.has(t)?this._templateResults=MT.get(t):this._templateResults={}}}updated(t){super.updated(t),this._config&&this.hass&&this._tryConnect()}_getTemplateKeyValue(t){var e;return this._config&&null!==(e=this._config[t])&&void 0!==e?e:""}async _tryConnect(){var t=this;IT.forEach(e=>{t._tryConnectKey(e)})}async _tryConnectKey(t){var e=this;if(void 0!==e._unsubRenderTemplates.get(t)||!e.hass||!e._config)return;const o=e._getTemplateKeyValue(t);if(bT(o))try{const i=Si(e.hass.connection,o=>{e._templateResults=ee(ee({},e._templateResults),{},{[t]:o})},{template:o,entity_ids:e._config.entity_id,variables:{config:e._config,user:e.hass.user.name,entity:e._config.entity,area:e._config.area},strict:!0});e._unsubRenderTemplates.set(t,i),await i}catch(n){var i;const o={result:null!==(i=e._config[t])&&void 0!==i?i:"",listeners:{all:!1,domains:[],entities:[],time:!1}};e._templateResults=ee(ee({},e._templateResults),{},{[t]:o}),e._unsubRenderTemplates.delete(t)}}async _tryDisconnect(){var t=this;IT.forEach(e=>{t._tryDisconnectKey(e)})}async _tryDisconnectKey(t){const e=this._unsubRenderTemplates.get(t);if(e){this._unsubRenderTemplates.delete(t);try{await(await e)()}catch(o){if("not_found"!==o.code&&"template_error"!==o.code)throw o}}}setConfig(t){this._config=wT(t),this._config.entity&&(this._config.tap_action||(this._config.tap_action={action:"more-info"}),this._config.icon_tap_action||(this._config.icon_tap_action={action:TT(this._config.entity)}))}getValue(t){var e;const o=this._getTemplateKeyValue(t);return bT(o)?null===(e=this._templateResults)||void 0===e||null===(e=e[t])||void 0===e||null===(e=e.result)||void 0===e?void 0:e.toString():o}getCardSize(){var t,e,o,i,n,r;const a=this._config&&this._featurePosition(this._config),s=(null===(t=this._config)||void 0===t||null===(t=t.features)||void 0===t?void 0:t.length)||0;return(Boolean((null===(e=this._config)||void 0===e?void 0:e.icon)||(null===(o=this._config)||void 0===o?void 0:o.picture)||(null===(i=this._config)||void 0===i?void 0:i.primary)||(null===(n=this._config)||void 0===n?void 0:n.secondary))||"inline"===a?1:0)+((null===(r=this._config)||void 0===r?void 0:r.vertical)?1:0)+("inline"===a?0:s)}getGridOptions(){var t,e,o,i,n,r,a;let s=6,l=0;l=Boolean((null===(t=this._config)||void 0===t?void 0:t.icon)||(null===(e=this._config)||void 0===e?void 0:e.picture)||(null===(o=this._config)||void 0===o?void 0:o.primary)||(null===(i=this._config)||void 0===i?void 0:i.secondary))?1:0;const c=this._config&&this._featurePosition(this._config),u=(null===(n=this._config)||void 0===n||null===(n=n.features)||void 0===n?void 0:n.length)||0;return u&&("inline"===c?(s=12,l=1):l+=u),(null===(r=this._config)||void 0===r?void 0:r.vertical)&&(s=3,(this._config.primary||this._config.secondary&&!this._config.icon)&&l++),(null===(a=this._config)||void 0===a?void 0:a.multiline_secondary)?{columns:6,min_columns:s}:{columns:6,rows:l,min_columns:s,min_rows:l}}_handleAction(t){Ni(this,this.hass,this._config,t.detail.action)}_handleIconAction(t){t.stopPropagation();const e={entity:this._config.entity,tap_action:this._config.icon_tap_action,hold_action:this._config.icon_hold_action,double_tap_action:this._config.icon_double_tap_action};Ni(this,this.hass,e,t.detail.action)}get _hasCardAction(){var t,e,o;return Yi(null===(t=this._config)||void 0===t?void 0:t.tap_action)||Yi(null===(e=this._config)||void 0===e?void 0:e.hold_action)||Yi(null===(o=this._config)||void 0===o?void 0:o.double_tap_action)}get _hasIconAction(){var t,e,o;return Yi(null===(t=this._config)||void 0===t?void 0:t.icon_tap_action)||Yi(null===(e=this._config)||void 0===e?void 0:e.icon_hold_action)||Yi(null===(o=this._config)||void 0===o?void 0:o.icon_double_tap_action)}render(){var t;if(!this._config||!this.hass)return et;const e=this.getValue("icon"),o=this.getValue("color"),i=o?_T(o):void 0,n=this.getValue("primary"),r=this.getValue("secondary"),a=this.getValue("picture"),s=this.getValue("badge_icon"),l=this.getValue("badge_color"),c=this.getValue("badge_text"),u=l?_T(l):void 0,h=V_(e),d={"--tile-color":i},p=this._featurePosition(this._config),m=this._displayedFeatures(this._config),f=this._config.multiline_secondary,g=this._featureContext(this._config),_=m.length>0&&!e&&!a&&!n&&!r,v=de({horizontal:"inline"===p,"feature-only":_}),{haVersion:b}=this.hass.connection,y=rn(b,2026,2),w=rn(b,2026,8)&&"grid"===this.layout&&"auto"!==(null===(t=this._config.grid_options)||void 0===t?void 0:t.rows),k=de({vertical:Boolean(this._config.vertical),"fixed-info-height":w}),C={disabled:!this._hasIconAction,hasHold:Yi(this._config.icon_hold_action),hasDoubleClick:Yi(this._config.icon_double_tap_action)};return J` + `]}},gn([Gt({attribute:!1})],xT.prototype,"hass",void 0),gn([ie()],xT.prototype,"_config",void 0),gn([ie()],xT.prototype,"_legacyConfig",void 0),xT=gn([Lt("mushroom-template-card-editor")],xT)}),GT=kt(()=>{Vt(),Be(),je(),gT(),Re(),Oi(),AT=/* @__PURE__ */Et(hv()),pn(),HT(),RT(),dv(),cg(),UT(),pv(),__(),vn(),oe(),TT=t=>{const e=be(t);return _e.has(e)||["button","input_button","scene"].includes(e)?"toggle":"none"},tg({type:"mushroom-template-card",name:"Mushroom Template",description:"Build your own Mushroom card using templates"}),MT=new R_(1e3),IT=["icon","color","primary","secondary","picture","badge_icon","badge_color","badge_text"],(ST=class extends Ot{constructor(...t){super(...t),this._unsubRenderTemplates=/* @__PURE__ */new Map,this._featureContext=vi(t=>({entity_id:t.entity,area_id:t.area})),this._featurePosition=vi(t=>t.vertical?"bottom":t.features_position||"bottom"),this._displayedFeatures=vi(t=>{const e=t.features||[];return"inline"===this._featurePosition(t)?e.slice(0,1):e})}static async getConfigElement(){return await Promise.resolve().then(()=>(FT(),VT)),document.createElement("mushroom-template-card-editor")}static getStubConfig(){return{type:"custom:mushroom-template-card",primary:"Hello, {{user}}",secondary:"How are you?",icon:"mdi:mushroom"}}connectedCallback(){super.connectedCallback(),this._tryConnect()}disconnectedCallback(){if(super.disconnectedCallback(),this._tryDisconnect(),this._config&&this._templateResults){const t=this._computeCacheKey();MT.set(t,this._templateResults)}}_computeCacheKey(){return(0,AT.default)(this._config)}willUpdate(t){if(super.willUpdate(t),this._config&&!this._templateResults){const t=this._computeCacheKey();MT.has(t)?this._templateResults=MT.get(t):this._templateResults={}}}updated(t){super.updated(t),this._config&&this.hass&&this._tryConnect()}_getTemplateKeyValue(t){var e;return this._config&&null!==(e=this._config[t])&&void 0!==e?e:""}async _tryConnect(){var t=this;IT.forEach(e=>{t._tryConnectKey(e)})}async _tryConnectKey(t){var e=this;if(void 0!==e._unsubRenderTemplates.get(t)||!e.hass||!e._config)return;const o=e._getTemplateKeyValue(t);if(bT(o))try{const i=Si(e.hass.connection,o=>{e._templateResults=ee(ee({},e._templateResults),{},{[t]:o})},{template:o,entity_ids:e._config.entity_id,variables:{config:e._config,user:e.hass.user.name,entity:e._config.entity,area:e._config.area},strict:!0});e._unsubRenderTemplates.set(t,i),await i}catch(n){var i;const o={result:null!==(i=e._config[t])&&void 0!==i?i:"",listeners:{all:!1,domains:[],entities:[],time:!1}};e._templateResults=ee(ee({},e._templateResults),{},{[t]:o}),e._unsubRenderTemplates.delete(t)}}async _tryDisconnect(){var t=this;IT.forEach(e=>{t._tryDisconnectKey(e)})}async _tryDisconnectKey(t){const e=this._unsubRenderTemplates.get(t);if(e){this._unsubRenderTemplates.delete(t);try{await(await e)()}catch(o){if("not_found"!==o.code&&"template_error"!==o.code)throw o}}}setConfig(t){this._config=wT(t),this._config.entity&&(this._config.tap_action||(this._config.tap_action={action:"more-info"}),this._config.icon_tap_action||(this._config.icon_tap_action={action:TT(this._config.entity)}))}getValue(t){var e;const o=this._getTemplateKeyValue(t);return bT(o)?null===(e=this._templateResults)||void 0===e||null===(e=e[t])||void 0===e||null===(e=e.result)||void 0===e?void 0:e.toString():o}getCardSize(){var t,e,o,i,n,r;const a=this._config&&this._featurePosition(this._config),s=(null===(t=this._config)||void 0===t||null===(t=t.features)||void 0===t?void 0:t.length)||0;return(Boolean((null===(e=this._config)||void 0===e?void 0:e.icon)||(null===(o=this._config)||void 0===o?void 0:o.picture)||(null===(i=this._config)||void 0===i?void 0:i.primary)||(null===(n=this._config)||void 0===n?void 0:n.secondary))||"inline"===a?1:0)+((null===(r=this._config)||void 0===r?void 0:r.vertical)?1:0)+("inline"===a?0:s)}getGridOptions(){var t,e,o,i,n,r,a;let s=6,l=0;l=Boolean((null===(t=this._config)||void 0===t?void 0:t.icon)||(null===(e=this._config)||void 0===e?void 0:e.picture)||(null===(o=this._config)||void 0===o?void 0:o.primary)||(null===(i=this._config)||void 0===i?void 0:i.secondary))?1:0;const c=this._config&&this._featurePosition(this._config),u=(null===(n=this._config)||void 0===n||null===(n=n.features)||void 0===n?void 0:n.length)||0;return u&&("inline"===c?(s=12,l=1):l+=u),(null===(r=this._config)||void 0===r?void 0:r.vertical)&&(this._config.primary||this._config.secondary&&!this._config.icon)&&l++,(null===(a=this._config)||void 0===a?void 0:a.multiline_secondary)?{columns:s}:{columns:s,rows:l}}_handleAction(t){Ni(this,this.hass,this._config,t.detail.action)}_handleIconAction(t){t.stopPropagation();const e={entity:this._config.entity,tap_action:this._config.icon_tap_action,hold_action:this._config.icon_hold_action,double_tap_action:this._config.icon_double_tap_action};Ni(this,this.hass,e,t.detail.action)}get _hasCardAction(){var t,e,o;return Yi(null===(t=this._config)||void 0===t?void 0:t.tap_action)||Yi(null===(e=this._config)||void 0===e?void 0:e.hold_action)||Yi(null===(o=this._config)||void 0===o?void 0:o.double_tap_action)}get _hasIconAction(){var t,e,o;return Yi(null===(t=this._config)||void 0===t?void 0:t.icon_tap_action)||Yi(null===(e=this._config)||void 0===e?void 0:e.icon_hold_action)||Yi(null===(o=this._config)||void 0===o?void 0:o.icon_double_tap_action)}render(){var t;if(!this._config||!this.hass)return et;const e=this.getValue("icon"),o=this.getValue("color"),i=o?_T(o):void 0,n=this.getValue("primary"),r=this.getValue("secondary"),a=this.getValue("picture"),s=this.getValue("badge_icon"),l=this.getValue("badge_color"),c=this.getValue("badge_text"),u=l?_T(l):void 0,h=V_(e),d={"--tile-color":i},p=this._featurePosition(this._config),m=this._displayedFeatures(this._config),f=this._config.multiline_secondary,g=this._featureContext(this._config),_=m.length>0&&!e&&!a&&!n&&!r,v=de({horizontal:"inline"===p,"feature-only":_}),{haVersion:b}=this.hass.connection,y=rn(b,2026,2),w=rn(b,2026,8)&&"grid"===this.layout&&"auto"!==(null===(t=this._config.grid_options)||void 0===t?void 0:t.rows),k=de({vertical:Boolean(this._config.vertical),"fixed-info-height":w}),C={disabled:!this._hasIconAction,hasHold:Yi(this._config.icon_hold_action),hasDoubleClick:Yi(this._config.icon_double_tap_action)};return J`