57 lines
158 KiB
JavaScript
57 lines
158 KiB
JavaScript
var t,e,n,i,o,r,a,u,s,c,l,d,h,f,v,p,m,g,_,y,b,D,A,w,C,E,k,F,O,j,S,T;function B(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function $(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function x(t,e,n){return(e=nt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M(t,e,n,i){var o=P(Z(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function P(){return P="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Z(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},P.apply(null,arguments)}function H(t){return function(t){if(Array.isArray(t))return J(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||X(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,o,r,a,u=[],s=!0,c=!1;try{if(r=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=r.call(n)).done)&&(u.push(i.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||X(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var t,e,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function r(n,i,o,r){var s=i&&i.prototype instanceof u?i:u,c=Object.create(s.prototype);return N(c,"_invoke",function(n,i,o){var r,u,s,c=0,l=o||[],d=!1,h={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,n){return r=e,u=0,s=t,h.n=n,a}};function f(n,i){for(u=n,s=i,e=0;!d&&c&&!o&&e<l.length;e++){var o,r=l[e],f=h.p,v=r[2];n>3?(o=v===i)&&(s=r[(u=r[4])?5:(u=3,3)],r[4]=r[5]=t):r[0]<=f&&((o=n<2&&f<r[1])?(u=0,h.v=i,h.n=r[1]):f<v&&(o=n<3||r[0]>i||i>v)&&(r[4]=n,r[5]=i,h.n=v,u=0))}if(o||n>1)return a;throw d=!0,i}return function(o,l,v){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,v),u=l,s=v;(e=u<2?t:s)||!d;){r||(u?u<3?(u>1&&(h.n=-1),f(u,s)):h.n=s:h.v=s);try{if(c=2,r){if(u||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,u<2&&(u=0)}else 1===u&&(e=r.return)&&e.call(r),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);r=t}else if((e=(d=h.n<0)?s:n.call(i,h))!==a)break}catch(e){r=t,u=1,s=e}finally{c=1}}return{value:e,done:d}}}(n,o,r),!0),c}var a={};function u(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][i]?e(e([][i]())):(N(e={},i,(function(){return this})),e),d=c.prototype=u.prototype=Object.create(l);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,N(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return s.prototype=c,N(d,"constructor",c),N(c,"constructor",s),s.displayName="GeneratorFunction",N(c,o,"GeneratorFunction"),N(d),N(d,o,"Generator"),N(d,i,(function(){return this})),N(d,"toString",(function(){return"[object Generator]"})),(R=function(){return{w:r,m:h}})()}function N(t,e,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}N=function(t,e,n,i){function r(e,n){N(t,e,(function(t){return this._invoke(e,n,t)}))}e?o?o(t,e,{value:n,enumerable:!i,configurable:!i,writable:!i}):t[e]=n:(r("next",0),r("throw",1),r("return",2))},N(t,e,n,i)}function V(t,e,n,i,o,r,a){try{var u=t[r](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(i,o)}function z(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var r=t.apply(e,n);function a(t){V(r,i,o,a,u,"next",t)}function u(t){V(r,i,o,a,u,"throw",t)}a(void 0)}))}}function L(t,e,n){return e=Z(e),function(t,e){if(e&&("object"==it(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return U(t)}(t,W()?Reflect.construct(e,n||[],Z(t).constructor):e.apply(t,n))}function U(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function G(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Y(t,e)}function q(t){var e="function"==typeof Map?new Map:void 0;return q=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(Te){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(W())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var o=new(t.bind.apply(t,i));return n&&Y(o,n.prototype),o}(t,arguments,Z(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Y(n,t)},q(t)}function W(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(W=function(){return!!t})()}function Y(t,e){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Y(t,e)}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Z(t)}function K(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=X(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},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 r,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,r=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw r}}}}function X(t,e){if(t){if("string"==typeof t)return J(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J(t,e):void 0}}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,nt(i.key),i)}}function et(t,e,n){return e&&tt(t.prototype,e),n&&tt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function nt(t){var e=function(t,e){if("object"!=it(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=it(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==it(e)?e:e+""}function it(t){return it="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},it(t)}function ot(t,e,n,i){var o,r=arguments.length,a=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===("undefined"==typeof Reflect?"undefined":it(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(r<3?o(a):r>3?o(e,n,a):o(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}"function"==typeof SuppressedError&&SuppressedError;
|
||
/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/
|
||
var rt=globalThis,at=rt.ShadowRoot&&(void 0===rt.ShadyCSS||rt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ut=Symbol(),st=new WeakMap,ct=function(){return et((function t(e,n,i){if(Q(this,t),this._$cssResult$=!0,i!==ut)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}),[{key:"styleSheet",get:function(){var t=this.o,e=this.t;if(at&&void 0===t){var n=void 0!==e&&1===e.length;n&&(t=st.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&st.set(e,t))}return t}},{key:"toString",value:function(){return this.cssText}}])}(),lt=at?function(t){return t}:function(t){return t instanceof CSSStyleSheet?function(t){var e,n="",i=K(t.cssRules);try{for(i.s();!(e=i.n()).done;){n+=e.value.cssText}}catch(o){i.e(o)}finally{i.f()}return function(t){return new ct("string"==typeof t?t:t+"",void 0,ut)}(n)}(t):t},dt=Object.is,ht=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,vt=Object.getOwnPropertyNames,pt=Object.getOwnPropertySymbols,mt=Object.getPrototypeOf,gt=globalThis,_t=gt.trustedTypes,yt=_t?_t.emptyScript:"",bt=gt.reactiveElementPolyfillSupport,Dt=function(t,e){return t},At={toAttribute:function(t,e){switch(e){case Boolean:t=t?yt:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute:function(t,e){var n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},wt=function(t,e){return!dt(t,e)},Ct={attribute:!0,type:String,converter:At,reflect:!1,useDefault:!1,hasChanged:wt};null!==(t=Symbol.metadata)&&void 0!==t||(Symbol.metadata=Symbol("metadata")),null!==(e=gt.litPropertyMetadata)&&void 0!==e||(gt.litPropertyMetadata=new WeakMap);var Et=function(t){function e(){var t;return Q(this,e),(t=L(this,e))._$Ep=void 0,t.isUpdatePending=!1,t.hasUpdated=!1,t._$Em=null,t._$Ev(),t}return G(e,q(HTMLElement)),et(e,[{key:"_$Ev",value:function(){var t,e=this;this._$ES=new Promise((function(t){return e.enableUpdating=t})),this._$AL=new Map,this._$E_(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((function(t){return t(e)}))}},{key:"addController",value:function(t){var e,n;(null!==(e=this._$EO)&&void 0!==e?e:this._$EO=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}},{key:"removeController",value:function(t){var e;null===(e=this._$EO)||void 0===e||e.delete(t)}},{key:"_$E_",value:function(){var t,e=new Map,n=K(this.constructor.elementProperties.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value;this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i])}}catch(o){n.e(o)}finally{n.f()}e.size>0&&(this._$Ep=e)}},{key:"createRenderRoot",value:function(){var t,e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return function(t,e){if(at)t.adoptedStyleSheets=e.map((function(t){return t instanceof CSSStyleSheet?t:t.styleSheet}));else{var n,i=K(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,r=document.createElement("style"),a=rt.litNonce;void 0!==a&&r.setAttribute("nonce",a),r.textContent=o.cssText,t.appendChild(r)}}catch(u){i.e(u)}finally{i.f()}}}(e,this.constructor.elementStyles),e}},{key:"connectedCallback",value:function(){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((function(t){var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}},{key:"enableUpdating",value:function(t){}},{key:"disconnectedCallback",value:function(){var t;null===(t=this._$EO)||void 0===t||t.forEach((function(t){var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}},{key:"attributeChangedCallback",value:function(t,e,n){this._$AK(t,n)}},{key:"_$ET",value:function(t,e){var n=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,n);if(void 0!==i&&!0===n.reflect){var o,r=(void 0!==(null===(o=n.converter)||void 0===o?void 0:o.toAttribute)?n.converter:At).toAttribute(e,n.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}},{key:"_$AK",value:function(t,e){var n=this.constructor,i=n._$Eh.get(t);if(void 0!==i&&this._$Em!==i){var o,r,a,u=n.getPropertyOptions(i),s="function"==typeof u.converter?{fromAttribute:u.converter}:void 0!==(null===(o=u.converter)||void 0===o?void 0:o.fromAttribute)?u.converter:At;this._$Em=i;var c=s.fromAttribute(e,u.type);this[i]=null!==(r=null!=c?c:null===(a=this._$Ej)||void 0===a?void 0:a.get(i))&&void 0!==r?r:c,this._$Em=null}}},{key:"requestUpdate",value:function(t,e,n){if(void 0!==t){var i,o,r=this.constructor,a=this[t];if(null!=n||(n=r.getPropertyOptions(t)),!((null!==(i=n.hasChanged)&&void 0!==i?i:wt)(a,e)||n.useDefault&&n.reflect&&a===(null===(o=this._$Ej)||void 0===o?void 0:o.get(t))&&!this.hasAttribute(r._$Eu(t,n))))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}},{key:"C",value:function(t,e,n,i){var o,r,a,u=n.useDefault,s=n.reflect,c=n.wrapped;u&&!(null!==(o=this._$Ej)&&void 0!==o?o:this._$Ej=new Map).has(t)&&(this._$Ej.set(t,null!==(r=null!=i?i:e)&&void 0!==r?r:this[t]),!0!==c||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||u||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(null!==(a=this._$Eq)&&void 0!==a?a:this._$Eq=new Set).add(t))}},{key:"_$EP",value:(n=z(R().m((function t(){var e,n;return R().w((function(t){for(;;)switch(t.p=t.n){case 0:return this.isUpdatePending=!0,t.p=1,t.n=2,this._$ES;case 2:t.n=4;break;case 3:t.p=3,n=t.v,Promise.reject(n);case 4:if(null==(e=this.scheduleUpdate())){t.n=5;break}return t.n=5,e;case 5:return t.a(2,!this.isUpdatePending)}}),t,this,[[1,3]])}))),function(){return n.apply(this,arguments)})},{key:"scheduleUpdate",value:function(){return this.performUpdate()}},{key:"performUpdate",value:function(){if(this.isUpdatePending){if(!this.hasUpdated){var t;if(null!==(t=this.renderRoot)&&void 0!==t||(this.renderRoot=this.createRenderRoot()),this._$Ep){var e,n=K(this._$Ep);try{for(n.s();!(e=n.n()).done;){var i=I(e.value,2),o=i[0],r=i[1];this[o]=r}}catch(g){n.e(g)}finally{n.f()}this._$Ep=void 0}var a=this.constructor.elementProperties;if(a.size>0){var u,s=K(a);try{for(s.s();!(u=s.n()).done;){var c=I(u.value,2),l=c[0],d=c[1],h=d.wrapped,f=this[l];!0!==h||this._$AL.has(l)||void 0===f||this.C(l,void 0,d,f)}}catch(g){s.e(g)}finally{s.f()}}}var v=!1,p=this._$AL;try{var m;(v=this.shouldUpdate(p))?(this.willUpdate(p),null!==(m=this._$EO)&&void 0!==m&&m.forEach((function(t){var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(p)):this._$EM()}catch(p){throw v=!1,this._$EM(),p}v&&this._$AE(p)}}},{key:"willUpdate",value:function(t){}},{key:"_$AE",value:function(t){var e;null!==(e=this._$EO)&&void 0!==e&&e.forEach((function(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)}},{key:"_$EM",value:function(){this._$AL=new Map,this.isUpdatePending=!1}},{key:"updateComplete",get:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._$ES}},{key:"shouldUpdate",value:function(t){return!0}},{key:"update",value:function(t){var e=this;this._$Eq&&(this._$Eq=this._$Eq.forEach((function(t){return e._$ET(t,e[t])}))),this._$EM()}},{key:"updated",value:function(t){}},{key:"firstUpdated",value:function(t){}}],[{key:"addInitializer",value:function(t){var e;this._$Ei(),(null!==(e=this.l)&&void 0!==e?e:this.l=[]).push(t)}},{key:"observedAttributes",get:function(){return this.finalize(),this._$Eh&&H(this._$Eh.keys())}},{key:"createProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ct;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){var n=Symbol(),i=this.getPropertyDescriptor(t,n,e);void 0!==i&&ht(this.prototype,t,i)}}},{key:"getPropertyDescriptor",value:function(t,e,n){var i,o=null!==(i=ft(this.prototype,t))&&void 0!==i?i:{get:function(){return this[e]},set:function(t){this[e]=t}},r=o.get,a=o.set;return{get:r,set:function(e){var i=null==r?void 0:r.call(this);null!=a&&a.call(this,e),this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(t){var e;return null!==(e=this.elementProperties.get(t))&&void 0!==e?e:Ct}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(Dt("elementProperties"))){var t=mt(this);t.finalize(),void 0!==t.l&&(this.l=H(t.l)),this.elementProperties=new Map(t.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(Dt("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Dt("properties"))){var t,e=this.properties,n=K([].concat(H(vt(e)),H(pt(e))));try{for(n.s();!(t=n.n()).done;){var i=t.value;this.createProperty(i,e[i])}}catch(g){n.e(g)}finally{n.f()}}var o=this[Symbol.metadata];if(null!==o){var r=litPropertyMetadata.get(o);if(void 0!==r){var a,u=K(r);try{for(u.s();!(a=u.n()).done;){var s=I(a.value,2),c=s[0],l=s[1];this.elementProperties.set(c,l)}}catch(g){u.e(g)}finally{u.f()}}}this._$Eh=new Map;var d,h=K(this.elementProperties);try{for(h.s();!(d=h.n()).done;){var f=I(d.value,2),v=f[0],p=f[1],m=this._$Eu(v,p);void 0!==m&&this._$Eh.set(m,v)}}catch(g){h.e(g)}finally{h.f()}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(t){var e=[];if(Array.isArray(t)){var n,i=K(new Set(t.flat(1/0).reverse()));try{for(i.s();!(n=i.n()).done;){var o=n.value;e.unshift(lt(o))}}catch(r){i.e(r)}finally{i.f()}}else void 0!==t&&e.push(lt(t));return e}},{key:"_$Eu",value:function(t,e){var n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}}]);var n}();Et.elementStyles=[],Et.shadowRootOptions={mode:"open"},Et[Dt("elementProperties")]=new Map,Et[Dt("finalized")]=new Map,null!=bt&&bt({ReactiveElement:Et}),(null!==(n=gt.reactiveElementVersions)&&void 0!==n?n:gt.reactiveElementVersions=[]).push("2.1.1");
|
||
/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/
|
||
var kt=globalThis,Ft=kt.trustedTypes,Ot=Ft?Ft.createPolicy("lit-html",{createHTML:function(t){return t}}):void 0,jt="$lit$",St="lit$".concat(Math.random().toFixed(9).slice(2),"$"),Tt="?"+St,Bt="<".concat(Tt,">"),$t=document,xt=function(){return $t.createComment("")},Mt=function(t){return null===t||"object"!=it(t)&&"function"!=typeof t},Pt=Array.isArray,Ht="[ \t\n\f\r]",It=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Rt=/-->/g,Nt=/>/g,Vt=RegExp(">|".concat(Ht,"(?:([^\\s\"'>=/]+)(").concat(Ht,"*=").concat(Ht,"*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),zt=/'/g,Lt=/"/g,Ut=/^(?:script|style|textarea|title)$/i,Gt=function(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return{_$litType$:t,strings:e,values:i}}}(1),qt=Symbol.for("lit-noChange"),Wt=Symbol.for("lit-nothing"),Yt=new WeakMap,Zt=$t.createTreeWalker($t,129);function Kt(t,e){if(!Pt(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Ot?Ot.createHTML(e):e}var Xt=function(t,e){for(var n,i=t.length-1,o=[],r=2===e?"<svg>":3===e?"<math>":"",a=It,u=0;u<i;u++){for(var s=t[u],c=void 0,l=void 0,d=-1,h=0;h<s.length&&(a.lastIndex=h,null!==(l=a.exec(s)));)h=a.lastIndex,a===It?"!--"===l[1]?a=Rt:void 0!==l[1]?a=Nt:void 0!==l[2]?(Ut.test(l[2])&&(n=RegExp("</"+l[2],"g")),a=Vt):void 0!==l[3]&&(a=Vt):a===Vt?">"===l[0]?(a=null!=n?n:It,d=-1):void 0===l[1]?d=-2:(d=a.lastIndex-l[2].length,c=l[1],a=void 0===l[3]?Vt:'"'===l[3]?Lt:zt):a===Lt||a===zt?a=Vt:a===Rt||a===Nt?a=It:(a=Vt,n=void 0);var f=a===Vt&&t[u+1].startsWith("/>")?" ":"";r+=a===It?s+Bt:d>=0?(o.push(c),s.slice(0,d)+jt+s.slice(d)+St+f):s+St+(-2===d?u:f)}return[Kt(t,r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]},Jt=function(){return et((function t(e,n){var i,o=e.strings,r=e._$litType$;Q(this,t),this.parts=[];var a=0,u=0,s=o.length-1,c=this.parts,l=I(Xt(o,r),2),d=l[0],h=l[1];if(this.el=t.createElement(d,n),Zt.currentNode=this.el.content,2===r||3===r){var f=this.el.content.firstChild;f.replaceWith.apply(f,H(f.childNodes))}for(;null!==(i=Zt.nextNode())&&c.length<s;){if(1===i.nodeType){if(i.hasAttributes()){var v,p=K(i.getAttributeNames());try{for(p.s();!(v=p.n()).done;){var m=v.value;if(m.endsWith(jt)){var g=h[u++],_=i.getAttribute(m).split(St),y=/([.?@])?(.*)/.exec(g);c.push({type:1,index:a,name:y[2],strings:_,ctor:"."===y[1]?ie:"?"===y[1]?oe:"@"===y[1]?re:ne}),i.removeAttribute(m)}else m.startsWith(St)&&(c.push({type:6,index:a}),i.removeAttribute(m))}}catch(C){p.e(C)}finally{p.f()}}if(Ut.test(i.tagName)){var b=i.textContent.split(St),D=b.length-1;if(D>0){i.textContent=Ft?Ft.emptyScript:"";for(var A=0;A<D;A++)i.append(b[A],xt()),Zt.nextNode(),c.push({type:2,index:++a});i.append(b[D],xt())}}}else if(8===i.nodeType)if(i.data===Tt)c.push({type:2,index:a});else for(var w=-1;-1!==(w=i.data.indexOf(St,w+1));)c.push({type:7,index:a}),w+=St.length-1;a++}}),null,[{key:"createElement",value:function(t,e){var n=$t.createElement("template");return n.innerHTML=t,n}}])}();function Qt(t,e){var n,i,o,r,a,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,s=arguments.length>3?arguments[3]:void 0;if(e===qt)return e;var c=void 0!==s?null===(n=u._$Co)||void 0===n?void 0:n[s]:u._$Cl,l=Mt(e)?void 0:e._$litDirective$;return(null===(i=c)||void 0===i?void 0:i.constructor)!==l&&(null!==(o=c)&&void 0!==o&&null!==(r=o._$AO)&&void 0!==r&&r.call(o,!1),void 0===l?c=void 0:(c=new l(t))._$AT(t,u,s),void 0!==s?(null!==(a=u._$Co)&&void 0!==a?a:u._$Co=[])[s]=c:u._$Cl=c),void 0!==c&&(e=Qt(t,c._$AS(t,e.values),c,s)),e}var te=function(){return et((function t(e,n){Q(this,t),this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}),[{key:"parentNode",get:function(){return this._$AM.parentNode}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"u",value:function(t){var e,n=this._$AD,i=n.el.content,o=n.parts,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:$t).importNode(i,!0);Zt.currentNode=r;for(var a=Zt.nextNode(),u=0,s=0,c=o[0];void 0!==c;){var l;if(u===c.index){var d=void 0;2===c.type?d=new ee(a,a.nextSibling,this,t):1===c.type?d=new c.ctor(a,c.name,c.strings,this,t):6===c.type&&(d=new ae(a,this,t)),this._$AV.push(d),c=o[++s]}u!==(null===(l=c)||void 0===l?void 0:l.index)&&(a=Zt.nextNode(),u++)}return Zt.currentNode=$t,r}},{key:"p",value:function(t){var e,n=0,i=K(this._$AV);try{for(i.s();!(e=i.n()).done;){var o=e.value;void 0!==o&&(void 0!==o.strings?(o._$AI(t,o,n),n+=o.strings.length-2):o._$AI(t[n])),n++}}catch(r){i.e(r)}finally{i.f()}}}])}(),ee=function(){function t(e,n,i,o){var r;Q(this,t),this.type=2,this._$AH=Wt,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=o,this._$Cv=null===(r=null==o?void 0:o.isConnected)||void 0===r||r}return et(t,[{key:"_$AU",get:function(){var t,e;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cv}},{key:"parentNode",get:function(){var t,e=this._$AA.parentNode,n=this._$AM;return void 0!==n&&11===(null===(t=e)||void 0===t?void 0:t.nodeType)&&(e=n.parentNode),e}},{key:"startNode",get:function(){return this._$AA}},{key:"endNode",get:function(){return this._$AB}},{key:"_$AI",value:function(t){t=Qt(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),Mt(t)?t===Wt||null==t||""===t?(this._$AH!==Wt&&this._$AR(),this._$AH=Wt):t!==this._$AH&&t!==qt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):function(t){return Pt(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator])}(t)?this.k(t):this._(t)}},{key:"O",value:function(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}},{key:"T",value:function(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}},{key:"_",value:function(t){this._$AH!==Wt&&Mt(this._$AH)?this._$AA.nextSibling.data=t:this.T($t.createTextNode(t)),this._$AH=t}},{key:"$",value:function(t){var e,n=t.values,i=t._$litType$,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Jt.createElement(Kt(i.h,i.h[0]),this.options)),i);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.p(n);else{var r=new te(o,this),a=r.u(this.options);r.p(n),this.T(a),this._$AH=r}}},{key:"_$AC",value:function(t){var e=Yt.get(t.strings);return void 0===e&&Yt.set(t.strings,e=new Jt(t)),e}},{key:"k",value:function(e){Pt(this._$AH)||(this._$AH=[],this._$AR());var n,i,o=this._$AH,r=0,a=K(e);try{for(a.s();!(i=a.n()).done;){var u=i.value;r===o.length?o.push(n=new t(this.O(xt()),this.O(xt()),this,this.options)):n=o[r],n._$AI(u),r++}}catch(s){a.e(s)}finally{a.f()}r<o.length&&(this._$AR(n&&n._$AB.nextSibling,r),o.length=r)}},{key:"_$AR",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,e);t!==this._$AB;){var n,i=t.nextSibling;t.remove(),t=i}}},{key:"setConnected",value:function(t){var e;void 0===this._$AM&&(this._$Cv=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}])}(),ne=function(){return et((function t(e,n,i,o,r){Q(this,t),this.type=1,this._$AH=Wt,this._$AN=void 0,this.element=e,this.name=n,this._$AM=o,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Wt}),[{key:"tagName",get:function(){return this.element.tagName}},{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=this.strings,r=!1;if(void 0===o)t=Qt(this,t,e,0),(r=!Mt(t)||t!==this._$AH&&t!==qt)&&(this._$AH=t);else{var a,u,s=t;for(t=o[0],a=0;a<o.length-1;a++)(u=Qt(this,s[n+a],e,a))===qt&&(u=this._$AH[a]),r||(r=!Mt(u)||u!==this._$AH[a]),u===Wt?t=Wt:t!==Wt&&(t+=(null!=u?u:"")+o[a+1]),this._$AH[a]=u}r&&!i&&this.j(t)}},{key:"j",value:function(t){t===Wt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}])}(),ie=function(t){function e(){var t;return Q(this,e),(t=L(this,e,arguments)).type=3,t}return G(e,ne),et(e,[{key:"j",value:function(t){this.element[this.name]=t===Wt?void 0:t}}])}(),oe=function(t){function e(){var t;return Q(this,e),(t=L(this,e,arguments)).type=4,t}return G(e,ne),et(e,[{key:"j",value:function(t){this.element.toggleAttribute(this.name,!!t&&t!==Wt)}}])}(),re=function(t){function e(t,n,i,o,r){var a;return Q(this,e),(a=L(this,e,[t,n,i,o,r])).type=5,a}return G(e,ne),et(e,[{key:"_$AI",value:function(t){var e;if((t=null!==(e=Qt(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0))&&void 0!==e?e:Wt)!==qt){var n=this._$AH,i=t===Wt&&n!==Wt||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==Wt&&(n===Wt||i);i&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}}},{key:"handleEvent",value:function(t){var e,n;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(n=this.options)||void 0===n?void 0:n.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}])}(),ae=function(){return et((function t(e,n,i){Q(this,t),this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}),[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(t){Qt(this,t)}}])}(),ue=kt.litHtmlPolyfillSupport;null!=ue&&ue(Jt,ee),(null!==(i=kt.litHtmlVersions)&&void 0!==i?i:kt.litHtmlVersions=[]).push("3.3.1");var se=globalThis,ce=function(t){function e(){var t;return Q(this,e),(t=L(this,e,arguments)).renderOptions={host:U(t)},t._$Do=void 0,t}return G(e,Et),et(e,[{key:"createRenderRoot",value:function(){var t,n,i=M(e,"createRenderRoot",this,3)([]);return null!==(n=(t=this.renderOptions).renderBefore)&&void 0!==n||(t.renderBefore=i.firstChild),i}},{key:"update",value:function(t){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),M(e,"update",this,3)([t]),this._$Do=function(t,e,n){var i,o=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:e,r=o._$litPart$;if(void 0===r){var a,u=null!==(a=null==n?void 0:n.renderBefore)&&void 0!==a?a:null;o._$litPart$=r=new ee(e.insertBefore(xt(),u),u,void 0,null!=n?n:{})}return r._$AI(t),r}(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var t;M(e,"connectedCallback",this,3)([]),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var t;M(e,"disconnectedCallback",this,3)([]),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}},{key:"render",value:function(){return qt}}])}();
|
||
/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/ce._$litElement$=!0,ce.finalized=!0,null===(o=se.litElementHydrateSupport)||void 0===o||o.call(se,{LitElement:ce});var le=se.litElementPolyfillSupport;null==le||le({LitElement:ce}),(null!==(r=se.litElementVersions)&&void 0!==r?r:se.litElementVersions=[]).push("4.2.1");
|
||
/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/
|
||
var de={attribute:!0,type:String,converter:At,reflect:!1,hasChanged:wt};
|
||
/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/function he(t){return function(e,n){return"object"==it(n)?function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=n.kind,o=n.metadata,r=globalThis.litPropertyMetadata.get(o);if(void 0===r&&globalThis.litPropertyMetadata.set(o,r=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),r.set(n.name,t),"accessor"===i){var a=n.name;return{set:function(n){var i=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,i,t)},init:function(e){return void 0!==e&&this.C(a,void 0,t,e),e}}}if("setter"===i){var u=n.name;return function(n){var i=this[u];e.call(this,n),this.requestUpdate(u,i,t)}}throw Error("Unsupported decorator location: "+i)}(t,e,n):function(t,e,n){var i=e.hasOwnProperty(n);return e.constructor.createProperty(n,t),i?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}}
|
||
/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/
|
||
/**
|
||
* @license
|
||
* Copyright 2018 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/
|
||
var fe=function(t){return null!=t?t:Wt},ve=1,pe=2,me=function(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return{_$litDirective$:t,values:n}}},ge=function(){return et((function t(e){Q(this,t)}),[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AT",value:function(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}},{key:"_$AS",value:function(t,e){return this.update(t,e)}},{key:"update",value:function(t,e){return this.render.apply(this,H(e))}}])}(),_e=function(t,e){var n=t._$AN;if(void 0===n)return!1;var i,o=K(n);try{for(o.s();!(i=o.n()).done;){var r,a=i.value;null!==(r=a._$AO)&&void 0!==r&&r.call(a,e,!1),_e(a,e)}}catch(u){o.e(u)}finally{o.f()}return!0},ye=function(t){var e,n;do{var i;if(void 0===(e=t._$AM))break;(n=e._$AN).delete(t),t=e}while(0===(null===(i=n)||void 0===i?void 0:i.size))},be=function(t){for(var e;e=t._$AM;t=e){var n=e._$AN;if(void 0===n)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),we(e)}};
|
||
/**
|
||
* @license
|
||
* Copyright 2020 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/function De(t){void 0!==this._$AN?(ye(this),this._$AM=t,be(this)):this._$AM=t}function Ae(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(e)if(Array.isArray(i))for(var r=n;r<i.length;r++)_e(i[r],!1),ye(i[r]);else null!=i&&(_e(i,!1),ye(i));else _e(this,t)}var we=function(t){var e,n;t.type==pe&&(null!==(e=t._$AP)&&void 0!==e||(t._$AP=Ae),null!==(n=t._$AQ)&&void 0!==n||(t._$AQ=De))},Ce=function(t){function e(){var t;return Q(this,e),(t=L(this,e,arguments))._$AN=void 0,t}return G(e,ge),et(e,[{key:"_$AT",value:function(t,n,i){M(e,"_$AT",this,3)([t,n,i]),be(this),this.isConnected=t._$AU}},{key:"_$AO",value:function(t){var e,n,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t!==this.isConnected&&(this.isConnected=t,t?null===(e=this.reconnected)||void 0===e||e.call(this):null===(n=this.disconnected)||void 0===n||n.call(this)),i&&(_e(this,t),ye(this))}},{key:"setValue",value:function(t){if(function(t){return void 0===t.strings}(this._$Ct))this._$Ct._$AI(t,this);else{var e=H(this._$Ct._$AH);e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}},{key:"disconnected",value:function(){}},{key:"reconnected",value:function(){}}])}(),Ee=function(){return et((function t(e){Q(this,t),this.G=e}),[{key:"disconnect",value:function(){this.G=void 0}},{key:"reconnect",value:function(t){this.G=t}},{key:"deref",value:function(){return this.G}}])}(),ke=function(){return et((function t(){Q(this,t),this.Y=void 0,this.Z=void 0}),[{key:"get",value:function(){return this.Y}},{key:"pause",value:function(){var t,e=this;null!==(t=this.Y)&&void 0!==t||(this.Y=new Promise((function(t){return e.Z=t})))}},{key:"resume",value:function(){var t;null!==(t=this.Z)&&void 0!==t&&t.call(this),this.Y=this.Z=void 0}}])}(),Fe=function(t){return!function(t){return null===t||"object"!=it(t)&&"function"!=typeof t}(t)&&"function"==typeof t.then},Oe=1073741823,je=function(t){function e(){var t;return Q(this,e),(t=L(this,e,arguments))._$Cwt=Oe,t._$Cbt=[],t._$CK=new Ee(U(t)),t._$CX=new ke,t}return G(e,Ce),et(e,[{key:"render",value:function(){for(var t,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return null!==(t=n.find((function(t){return!Fe(t)})))&&void 0!==t?t:qt}},{key:"update",value:function(t,e){var n=this,i=this._$Cbt,o=i.length;this._$Cbt=e;var r=this._$CK,a=this._$CX;this.isConnected||this.disconnected();for(var u,s=function(){var t=e[c];if(!Fe(t))return{v:(n._$Cwt=c,t)};c<o&&t===i[c]||(n._$Cwt=Oe,o=0,Promise.resolve(t).then(function(){var e=z(R().m((function e(n){var i,o;return R().w((function(e){for(;;)switch(e.n){case 0:if(!a.get()){e.n=2;break}return e.n=1,a.get();case 1:e.n=0;break;case 2:void 0!==(i=r.deref())&&(o=i._$Cbt.indexOf(t))>-1&&o<i._$Cwt&&(i._$Cwt=o,i.setValue(n));case 3:return e.a(2)}}),e)})));return function(t){return e.apply(this,arguments)}}()))},c=0;c<e.length&&!(c>this._$Cwt);c++)if(u=s())return u.v;return qt}},{key:"disconnected",value:function(){this._$CK.disconnect(),this._$CX.pause()}},{key:"reconnected",value:function(){this._$CK.reconnect(this),this._$CX.resume()}}])}(),Se=me(je),Te="important",Be=" !"+Te,$e=me(function(t){function e(t){var n,i;if(Q(this,e),i=L(this,e,[t]),t.type!==ve||"style"!==t.name||(null===(n=t.strings)||void 0===n?void 0:n.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");return i}return G(e,ge),et(e,[{key:"render",value:function(t){return Object.keys(t).reduce((function(e,n){var i=t[n];return null==i?e:e+"".concat(n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),":").concat(i,";")}),"")}},{key:"update",value:function(t,e){var n=I(e,1)[0],i=t.element.style;if(void 0===this.ft)return this.ft=new Set(Object.keys(n)),this.render(n);var o,r=K(this.ft);try{for(r.s();!(o=r.n()).done;){var a=o.value;null==n[a]&&(this.ft.delete(a),a.includes("-")?i.removeProperty(a):i[a]=null)}}catch(l){r.e(l)}finally{r.f()}for(var u in n){var s=n[u];if(null!=s){this.ft.add(u);var c="string"==typeof s&&s.endsWith(Be);u.includes("-")||c?i.setProperty(u,c?s.slice(0,-11):s,c?Te:""):i[u]=s}}return qt}}])}()),xe=function(t){function e(t){var n;if(Q(this,e),(n=L(this,e,[t])).it=Wt,t.type!==pe)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}return G(e,ge),et(e,[{key:"render",value:function(t){if(t===Wt||null==t)return this._t=void 0,this.it=t;if(t===qt)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;var e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}])}();xe.directiveName="unsafeHTML",xe.resultType=1;var Me=me(xe),Pe=me(function(t){function e(t){var n,i;if(Q(this,e),i=L(this,e,[t]),t.type!==ve||"class"!==t.name||(null===(n=t.strings)||void 0===n?void 0:n.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");return i}return G(e,ge),et(e,[{key:"render",value:function(t){return" "+Object.keys(t).filter((function(e){return t[e]})).join(" ")+" "}},{key:"update",value:function(t,e){var n=I(e,1)[0];if(void 0===this.st){for(var i in this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((function(t){return""!==t})))),n){var o;n[i]&&(null===(o=this.nt)||void 0===o||!o.has(i))&&this.st.add(i)}return this.render(n)}var r,a=t.element.classList,u=K(this.st);try{for(u.s();!(r=u.n()).done;){var s=r.value;s in n||(a.remove(s),this.st.delete(s))}}catch(h){u.e(h)}finally{u.f()}for(var c in n){var l,d=!!n[c];d===this.st.has(c)||(null===(l=this.nt)||void 0===l?void 0:l.has(c))||(d?(a.add(c),this.st.add(c)):(a.remove(c),this.st.delete(c)))}return qt}}])}()),He=function(t,e,n,i){i=i||{},n=null==n?{}:n;var o=new Event(e,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return o.detail=n,t.dispatchEvent(o),o},Ie=function(t,e){if(t===e)return!0;if(t&&e&&"object"===it(t)&&"object"===it(e)){if(t.constructor!==e.constructor)return!1;var n,i;if(Array.isArray(t)){if((i=t.length)!==e.length)return!1;for(n=i;0!=n--;)if(!Ie(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;var o,r=K(t.entries());try{for(r.s();!(o=r.n()).done;)if(n=o.value,!e.has(n[0]))return!1}catch(h){r.e(h)}finally{r.f()}var a,u=K(t.entries());try{for(u.s();!(a=u.n()).done;)if(n=a.value,!Ie(n[1],e.get(n[0])))return!1}catch(h){u.e(h)}finally{u.f()}return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;var s,c=K(t.entries());try{for(c.s();!(s=c.n()).done;)if(n=s.value,!e.has(n[0]))return!1}catch(h){c.e(h)}finally{c.f()}return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if((i=t.length)!==e.length)return!1;for(n=i;0!=n--;)if(t[n]!==e[n])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();var l=Object.keys(t);if((i=l.length)!==Object.keys(e).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(e,l[n]))return!1;for(n=i;0!=n--;){var d=l[n];if(!Ie(t[d],e[d]))return!1}return!0}return t!=t&&e!=e},Re="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,Ne=function(t){function e(){var t;return Q(this,e),(t=L(this,e,arguments)).holdTime=500,t.held=!1,t.cancelled=!1,t.isRepeating=!1,t.repeatCount=0,t}return G(e,q(HTMLElement)),et(e,[{key:"connectedCallback",value:function(){var t=this;Object.assign(this.style,{position:"fixed",width:Re?"100px":"50px",height:Re?"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((function(e){document.addEventListener(e,(function(){t.cancelled=!0,t.timer&&(t.stopAnimation(),clearTimeout(t.timer),t.timer=void 0,t.isRepeating&&t.repeatTimeout&&(clearInterval(t.repeatTimeout),t.isRepeating=!1))}),{passive:!0})}))}},{key:"bind",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.actionHandler&&Ie(n,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",(function(t){var e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1})),t.actionHandler={options:n},n.disabled||(t.actionHandler.start=function(i){var o,r,a;if(!(null===(o=i.detail)||void 0===o?void 0:o.ignore))if(e.cancelled=!1,i.touches?(r=i.touches[0].clientX,a=i.touches[0].clientY):(r=i.clientX,a=i.clientY),n.isMomentary){if(!i.touches&&0!==i.button)return;He(t,"action",{action:"press"})}else n.hasHold&&(e.held=!1,e.timer=window.setTimeout((function(){e.startAnimation(r,a),e.held=!0,n.repeat&&!e.isRepeating&&(e.repeatCount=0,e.isRepeating=!0,e.repeatTimeout=setInterval((function(){He(t,"action",{action:"hold"}),e.repeatCount++,e.repeatTimeout&&n.repeatLimit&&e.repeatCount>=n.repeatLimit&&(clearInterval(e.repeatTimeout),e.isRepeating=!1)}),n.repeat))}),e.holdTime))},t.actionHandler.end=function(i){var o;if(!(null===(o=i.detail)||void 0===o?void 0:o.ignore)){if(["touchend","touchcancel"].includes(i.type)&&e.cancelled)return e.isRepeating&&e.repeatTimeout&&(clearInterval(e.repeatTimeout),e.isRepeating=!1),void(n.isMomentary&&He(t,"action",{action:"release"}));if("touchcancel"!=i.type){var r=i.target;i.cancelable&&i.preventDefault(),n.isMomentary?He(t,"action",{action:"release"}):(n.hasHold&&(clearTimeout(e.timer),e.isRepeating&&e.repeatTimeout&&clearInterval(e.repeatTimeout),e.isRepeating=!1,e.stopAnimation(),e.timer=void 0),n.hasHold&&e.held?n.repeat||He(r,"action",{action:"hold"}):n.hasDoubleClick?"click"===i.type&&i.detail<2||!e.dblClickTimeout?e.dblClickTimeout=window.setTimeout((function(){e.dblClickTimeout=void 0,He(r,"action",{action:"tap"})}),250):(clearTimeout(e.dblClickTimeout),e.dblClickTimeout=void 0,He(r,"action",{action:"double_tap"})):He(r,"action",{action:"tap"}))}}},t.actionHandler.handleTouchMove=function(t){"touchmove"==t.type&&n.hasHold&&e.held&&(t.stopPropagation(),t.preventDefault())},t.actionHandler.handleKeyDown=function(t){n.disableKbd||["Enter"," "].includes(t.key)&&t.currentTarget.actionHandler.end(t)},t.addEventListener("touchstart",t.actionHandler.start,{passive:!0}),t.addEventListener("touchmove",t.actionHandler.handleTouchMove),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)))}},{key:"startAnimation",value:function(t,e){Object.assign(this.style,{left:"".concat(t,"px"),top:"".concat(e,"px"),transform:"translate(-50%, -50%) scale(1)"})}},{key:"stopAnimation",value:function(){Object.assign(this.style,{left:null,top:null,transform:"translate(-50%, -50%) scale(0)"})}}])}();
|
||
/**
|
||
* @license
|
||
* Copyright 2018 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/customElements.define("button-card-action-handler",Ne);var Ve=function(t,e){var n=function(){var t=document.body;if(t.querySelector("button-card-action-handler"))return t.querySelector("button-card-action-handler");var e=document.createElement("button-card-action-handler");return t.appendChild(e),e}();n&&n.bind(t,e)},ze=me(function(t){function e(){return Q(this,e),L(this,e,arguments)}return G(e,ge),et(e,[{key:"update",value:function(t,e){var n=I(e,1)[0];return Ve(t.element,n),qt}},{key:"render",value:function(t){}}])}());function Le(t,e){(function(t){return"string"==typeof t&&-1!==t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function Ue(t){return Math.min(1,Math.max(0,t))}function Ge(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function qe(t){return Number(t)<=1?"".concat(100*Number(t),"%"):t}function We(t){return 1===t.length?"0"+t:String(t)}function Ye(t,e,n){t=Le(t,255),e=Le(e,255),n=Le(n,255);var i=Math.max(t,e,n),o=Math.min(t,e,n),r=0,a=0,u=(i+o)/2;if(i===o)a=0,r=0;else{var s=i-o;switch(a=u>.5?s/(2-i-o):s/(i+o),i){case t:r=(e-n)/s+(e<n?6:0);break;case e:r=(n-t)/s+2;break;case n:r=(t-e)/s+4}r/=6}return{h:r,s:a,l:u}}function Ze(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*n*(e-t):n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ke(t,e,n){t=Le(t,255),e=Le(e,255),n=Le(n,255);var i=Math.max(t,e,n),o=Math.min(t,e,n),r=0,a=i,u=i-o,s=0===i?0:u/i;if(i===o)r=0;else{switch(i){case t:r=(e-n)/u+(e<n?6:0);break;case e:r=(n-t)/u+2;break;case n:r=(t-e)/u+4}r/=6}return{h:r,s:s,v:a}}function Xe(t,e,n,i){var o=[We(Math.round(t).toString(16)),We(Math.round(e).toString(16)),We(Math.round(n).toString(16))];return i&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function Je(t,e,n){var i=1-t/255,o=1-e/255,r=1-n/255,a=Math.min(i,o,r);return 1===a?(i=0,o=0,r=0):(i=(i-a)/(1-a)*100,o=(o-a)/(1-a)*100,r=(r-a)/(1-a)*100),a*=100,{c:Math.round(i),m:Math.round(o),y:Math.round(r),k:Math.round(a)}}function Qe(t){return Math.round(255*parseFloat(t)).toString(16)}function tn(t){return en(t)/255}function en(t){return parseInt(t,16)}var nn={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function on(t){var e={r:0,g:0,b:0},n=1,i=null,o=null,r=null,a=!1,u=!1;return"string"==typeof t&&(t=function(t){if(t=t.trim().toLowerCase(),0===t.length)return!1;var e=!1;if(nn[t])t=nn[t],e=!0;else if("transparent"===t)return{r:0,g:0,b:0,a:0,format:"name"};var n=sn.rgb.exec(t);if(n)return{r:n[1],g:n[2],b:n[3]};if(n=sn.rgba.exec(t),n)return{r:n[1],g:n[2],b:n[3],a:n[4]};if(n=sn.hsl.exec(t),n)return{h:n[1],s:n[2],l:n[3]};if(n=sn.hsla.exec(t),n)return{h:n[1],s:n[2],l:n[3],a:n[4]};if(n=sn.hsv.exec(t),n)return{h:n[1],s:n[2],v:n[3]};if(n=sn.hsva.exec(t),n)return{h:n[1],s:n[2],v:n[3],a:n[4]};if(n=sn.cmyk.exec(t),n)return{c:n[1],m:n[2],y:n[3],k:n[4]};if(n=sn.hex8.exec(t),n)return{r:en(n[1]),g:en(n[2]),b:en(n[3]),a:tn(n[4]),format:e?"name":"hex8"};if(n=sn.hex6.exec(t),n)return{r:en(n[1]),g:en(n[2]),b:en(n[3]),format:e?"name":"hex"};if(n=sn.hex4.exec(t),n)return{r:en(n[1]+n[1]),g:en(n[2]+n[2]),b:en(n[3]+n[3]),a:tn(n[4]+n[4]),format:e?"name":"hex8"};if(n=sn.hex3.exec(t),n)return{r:en(n[1]+n[1]),g:en(n[2]+n[2]),b:en(n[3]+n[3]),format:e?"name":"hex"};return!1}(t)),"object"===it(t)&&(cn(t.r)&&cn(t.g)&&cn(t.b)?(e=function(t,e,n){return{r:255*Le(t,255),g:255*Le(e,255),b:255*Le(n,255)}}(t.r,t.g,t.b),a=!0,u="%"===String(t.r).substr(-1)?"prgb":"rgb"):cn(t.h)&&cn(t.s)&&cn(t.v)?(i=qe(t.s),o=qe(t.v),e=function(t,e,n){t=6*Le(t,360),e=Le(e,100),n=Le(n,100);var i=Math.floor(t),o=t-i,r=n*(1-e),a=n*(1-o*e),u=n*(1-(1-o)*e),s=i%6;return{r:255*[n,a,r,r,u,n][s],g:255*[u,n,n,a,r,r][s],b:255*[r,r,u,n,n,a][s]}}(t.h,i,o),a=!0,u="hsv"):cn(t.h)&&cn(t.s)&&cn(t.l)?(i=qe(t.s),r=qe(t.l),e=function(t,e,n){var i,o,r;if(t=Le(t,360),e=Le(e,100),n=Le(n,100),0===e)o=n,r=n,i=n;else{var a=n<.5?n*(1+e):n+e-n*e,u=2*n-a;i=Ze(u,a,t+1/3),o=Ze(u,a,t),r=Ze(u,a,t-1/3)}return{r:255*i,g:255*o,b:255*r}}(t.h,i,r),a=!0,u="hsl"):cn(t.c)&&cn(t.m)&&cn(t.y)&&cn(t.k)&&(e=function(t,e,n,i){var o=i/100;return{r:255*(1-t/100)*(1-o),g:255*(1-e/100)*(1-o),b:255*(1-n/100)*(1-o)}}(t.c,t.m,t.y,t.k),a=!0,u="cmyk"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=Ge(n),{ok:a,format:t.format||u,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var rn="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",an="[\\s|\\(]+("+rn+")[,|\\s]+("+rn+")[,|\\s]+("+rn+")\\s*\\)?",un="[\\s|\\(]+("+rn+")[,|\\s]+("+rn+")[,|\\s]+("+rn+")[,|\\s]+("+rn+")\\s*\\)?",sn={CSS_UNIT:new RegExp(rn),rgb:new RegExp("rgb"+an),rgba:new RegExp("rgba"+un),hsl:new RegExp("hsl"+an),hsla:new RegExp("hsla"+un),hsv:new RegExp("hsv"+an),hsva:new RegExp("hsva"+un),cmyk:new RegExp("cmyk"+un),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function cn(t){return"number"==typeof t?!Number.isNaN(t):sn.CSS_UNIT.test(t)}var ln,dn=function(){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Q(this,t),n instanceof t)return n;"number"==typeof n&&(n=function(t){return{r:t>>16,g:(65280&t)>>8,b:255&t}}(n)),this.originalInput=n;var o=on(n);this.originalInput=n,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(e=i.format)&&void 0!==e?e:o.format,this.gradientType=i.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return et(t,[{key:"isDark",value:function(){return this.getBrightness()<128}},{key:"isLight",value:function(){return!this.isDark()}},{key:"getBrightness",value:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3}},{key:"getLuminance",value:function(){var t=this.toRgb(),e=t.r/255,n=t.g/255,i=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))}},{key:"getAlpha",value:function(){return this.a}},{key:"setAlpha",value:function(t){return this.a=Ge(t),this.roundA=Math.round(100*this.a)/100,this}},{key:"isMonochrome",value:function(){return 0===this.toHsl().s}},{key:"toHsv",value:function(){var t=Ke(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}}},{key:"toHsvString",value:function(){var t=Ke(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.v);return 1===this.a?"hsv(".concat(e,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(e,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")}},{key:"toHsl",value:function(){var t=Ye(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}}},{key:"toHslString",value:function(){var t=Ye(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.l);return 1===this.a?"hsl(".concat(e,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(e,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")}},{key:"toHex",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Xe(this.r,this.g,this.b,t)}},{key:"toHexString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return"#"+this.toHex(t)}},{key:"toHex8",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t,e,n,i,o){var r=[We(Math.round(t).toString(16)),We(Math.round(e).toString(16)),We(Math.round(n).toString(16)),We(Qe(i))];return o&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))&&r[3].startsWith(r[3].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0)+r[3].charAt(0):r.join("")}(this.r,this.g,this.b,this.a,t)}},{key:"toHex8String",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return"#"+this.toHex8(t)}},{key:"toHexShortString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return 1===this.a?this.toHexString(t):this.toHex8String(t)}},{key:"toRgb",value:function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}},{key:"toRgbString",value:function(){var t=Math.round(this.r),e=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(t,", ").concat(e,", ").concat(n,")"):"rgba(".concat(t,", ").concat(e,", ").concat(n,", ").concat(this.roundA,")")}},{key:"toPercentageRgb",value:function(){var t=function(t){return"".concat(Math.round(100*Le(t,255)),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}},{key:"toPercentageRgbString",value:function(){var t=function(t){return Math.round(100*Le(t,255))};return 1===this.a?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")}},{key:"toCmyk",value:function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$(Object(n),!0).forEach((function(e){x(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Je(this.r,this.g,this.b))}},{key:"toCmykString",value:function(){var t=Je(this.r,this.g,this.b),e=t.c,n=t.m,i=t.y,o=t.k;return"cmyk(".concat(e,", ").concat(n,", ").concat(i,", ").concat(o,")")}},{key:"toName",value:function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var t="#"+Xe(this.r,this.g,this.b,!1),e=0,n=Object.entries(nn);e<n.length;e++){var i=I(n[e],2),o=i[0];if(t===i[1])return o}return!1}},{key:"toString",value:function(t){var e=Boolean(t);t=null!=t?t:this.format;var n=!1,i=this.a<1&&this.a>=0;return e||!i||!t.startsWith("hex")&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),"cmyk"===t&&(n=this.toCmykString()),n||this.toHexString()):"name"===t&&0===this.a?this.toName():this.toRgbString()}},{key:"toNumber",value:function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}},{key:"clone",value:function(){return new t(this.toString())}},{key:"lighten",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toHsl();return n.l+=e/100,n.l=Ue(n.l),new t(n)}},{key:"brighten",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),new t(n)}},{key:"darken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toHsl();return n.l-=e/100,n.l=Ue(n.l),new t(n)}},{key:"tint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix("white",t)}},{key:"shade",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix("black",t)}},{key:"desaturate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toHsl();return n.s-=e/100,n.s=Ue(n.s),new t(n)}},{key:"saturate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.toHsl();return n.s+=e/100,n.s=Ue(n.s),new t(n)}},{key:"greyscale",value:function(){return this.desaturate(100)}},{key:"spin",value:function(e){var n=this.toHsl(),i=(n.h+e)%360;return n.h=i<0?360+i:i,new t(n)}},{key:"mix",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,i=this.toRgb(),o=new t(e).toRgb(),r=n/100;return new t({r:(o.r-i.r)*r+i.r,g:(o.g-i.g)*r+i.g,b:(o.b-i.b)*r+i.b,a:(o.a-i.a)*r+i.a})}},{key:"analogous",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,i=this.toHsl(),o=360/n,r=[this];for(i.h=(i.h-(o*e>>1)+720)%360;--e;)i.h=(i.h+o)%360,r.push(new t(i));return r}},{key:"complement",value:function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)}},{key:"monochromatic",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,n=this.toHsv(),i=n.h,o=n.s,r=n.v,a=[],u=1/e;e--;)a.push(new t({h:i,s:o,v:r})),r=(r+u)%1;return a}},{key:"splitcomplement",value:function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]}},{key:"onBackground",value:function(e){var n=this.toRgb(),i=new t(e).toRgb(),o=n.a+i.a*(1-n.a);return new t({r:(n.r*n.a+i.r*i.a*(1-n.a))/o,g:(n.g*n.a+i.g*i.a*(1-n.a))/o,b:(n.b*n.a+i.b*i.a*(1-n.a))/o,a:o})}},{key:"triad",value:function(){return this.polyad(3)}},{key:"tetrad",value:function(){return this.polyad(4)}},{key:"polyad",value:function(e){for(var n=this.toHsl(),i=n.h,o=[this],r=360/e,a=1;a<e;a++)o.push(new t({h:(i+a*r)%360,s:n.s,l:n.l}));return o}},{key:"equals",value:function(e){var n=new t(e);return"cmyk"===this.format||"cmyk"===n.format?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}])}(),hn="sections",fn=[hn],vn="unavailable",pn=(ln=[vn,"unknown"],function(t,e){return ln.includes(t,e)}),mn=new Set(["fan","input_boolean","light","switch","group","automation","humidifier"]),gn=new Set(["input_button"]),_n=["auto","auto-no-temperature"],yn=["card","label-card"],bn=["--ha-card-background","--card-background-color"],Dn="var(--primary-text-color)",An={pin:"Incorrect PIN, action cancelled",password:"Incorrect password, action cancelled"},wn="tap_action";function Cn(t){return t.substr(0,t.indexOf("."))}function En(t,e){var n=[],i=e;return"var"===e.trim().substring(0,3)&&(e.split(",").forEach((function(t){var e=t.match(/var\(\s*([a-zA-Z0-9-]*)/);e&&n.push(e[1])})),n.some((function(e){var n=window.getComputedStyle(t).getPropertyValue(e);return!!n&&(i=n,!0)}))),i}function kn(){for(var t=function(t){return t&&"object"===it(t)},e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return n.reduce((function(e,n){return Object.keys(n).forEach((function(i){var o=e[i],r=n[i];Array.isArray(o)&&Array.isArray(r)?e[i]=o.concat.apply(o,H(r)):t(o)&&t(r)?e[i]=kn(o,r):e[i]=r})),e}),{})}function Fn(t,e){var n=[];return t&&t.forEach((function(t){var i=t;e&&e.forEach((function(e){e.id&&t.id&&e.id==t.id&&(i=kn(i,e))})),n.push(i)})),e&&(n=n.concat(e.filter((function(e){return!t||!t.find((function(t){return!(!t.id||!e.id)&&t.id==e.id}))})))),n}function On(){var t,e=document.querySelector("hc-main");if(e=(e=(e=(e=e&&e.shadowRoot)&&e.querySelector("hc-lovelace"))&&e.shadowRoot)&&(e.querySelector("hui-view")||e.querySelector("hui-panel-view"))){var n=e.lovelace;return n.current_view=null!==(t=null==e?void 0:e._curView)&&void 0!==t?t:0,n}return null}function jn(){var t,e=document.querySelector("home-assistant");if(e=(e=(e=(e=(e=(e=(e=(e=e&&e.shadowRoot)&&e.querySelector("home-assistant-main"))&&e.shadowRoot)&&e.querySelector("app-drawer-layout partial-panel-resolver, ha-drawer partial-panel-resolver"))&&e.shadowRoot||e)&&e.querySelector("ha-panel-lovelace"))&&e.shadowRoot)&&e.querySelector("hui-root")){var n=e.lovelace;return n.current_view=null!==(t=null==e?void 0:e._curView)&&void 0!==t?t:0,n}return null}var Sn=function(){var t,e=function(){var t,e=jn()||On();return(null==e?void 0:e.current_view)?null===(t=e.config)||void 0===t?void 0:t.views[e.current_view]:void 0}(),n=(null==(t=e)?void 0:t.type)?t.type:(null==t?void 0:t.panel)?"panel":(null==t?void 0:t.sections)?hn:(null==t?void 0:t.cards)?"masonry":hn;return fn.includes(n)};function Tn(t,e){if(void 0===t)return!1;var n=Cn(t.entity_id),i=void 0!==e?e:null==t?void 0:t.state;if(["button","event","input_button","scene"].includes(n))return i!==vn;if(pn(i))return!1;if("off"===i&&"alert"!==n)return!1;switch(n){case"alarm_control_panel":return"disarmed"!==i;case"alert":return"idle"!==i;case"cover":return"closed"!==i;case"device_tracker":case"person":return"not_home"!==i;case"lock":return"locked"!==i;case"media_player":return"standby"!==i;case"vacuum":return!["idle","docked","paused"].includes(i);case"plant":return"problem"===i;case"group":return["on","home","open","locked","problem"].includes(i);case"timer":return"active"===i;case"camera":return"streaming"===i}return!0}function Bn(t){return Array.isArray(t)?t.reverse().reduce((function(t,e){return"var(".concat(e).concat(t?", ".concat(t):"",")")}),void 0):"var(".concat(t,")")}function $n(t){var e=t.split(":").map(Number);return 3600*e[0]+60*e[1]+e[2]}var xn=function(t){return t<10?"0".concat(t):t};var Mn,Pn,Hn,In,Rn,Nn=function(t){return t.startsWith("media-source://")},Vn=function(t,e){return t.callWS({type:"media_source/resolve_media",media_content_id:e})},zn=function(t,e,n,i,o,r){var a=[];(null==o?void 0:o.length)&&a.push((function(t){return o.includes(Cn(t))}));var u=function(t,e,n){(!n||n>t.length)&&(n=t.length);for(var i=[],o=0;o<t.length&&i.length<n;o++){var r,a=!0,u=K(e);try{for(u.s();!(r=u.n()).done;)if(!(0,r.value)(t[o])){a=!1;break}}catch(s){u.e(s)}finally{u.f()}a&&i.push(t[o])}return i}(n,a,e);if(u.length<e&&i.length){var s=zn(t,e-u.length,i,[],o);u.push.apply(u,H(s))}return u},Ln=new Set(["call-service","divider","section","weblink","cast","select"]),Un={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},Gn=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var o=1===t.length?t[0]:n.reduce((function(e,n,i){return e+function(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.")}(n)+t[i+1]}),t[0]);return new ct(o,t,ut)}(a||(a=B(["\n :host {\n position: relative;\n display: block;\n --state-inactive-color: var(--state-icon-color);\n --button-card-ripple-icon-inset-padding: 12px;\n }\n\n :host(.section) {\n display: unset;\n position: static;\n }\n\n ha-card {\n cursor: pointer;\n overflow: hidden;\n box-sizing: border-box;\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n line-height: normal;\n\n --ha-ripple-color: var(--button-card-ripple-color);\n --ha-ripple-hover-color: var(--ha-ripple-color, var(--button-card-ripple-hover-color));\n --ha-ripple-pressed-color: var(--ha-ripple-color, var(--button-card-ripple-pressed-color));\n --ha-ripple-hover-opacity: var(--button-card-ripple-hover-opacity, 0.04);\n --ha-ripple-pressed-opacity: var(--button-card-ripple-pressed-opacity, 0.12);\n\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Old versions of Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none; /* Non-prefixed version, currently\n supported by Chrome, Opera and Firefox */\n }\n ha-card.disabled {\n pointer-events: none;\n cursor: default;\n }\n ha-card.section {\n height: 100%;\n }\n ha-ripple[icon] {\n inset: var(--button-card-ripple-icon-inset, var(--dynamic-ripple-icon-inset, 5px));\n border-radius: var(--button-card-ripple-icon-border-radius, var(--ha-card-border-radius, 12px));\n --md-ripple-color: var(--button-card-ripple-icon-color, var(--ha-ripple-color));\n --md-ripple-hover-color: var(--button-card-ripple-icon-color, var(--ha-ripple-hover-color));\n --md-ripple-pressed-color: var(--button-card-ripple-pressed-color, var(--ha-ripple-pressed-color));\n --md-ripple-hover-opacity: var(\n --button-card-ripple-icon-hover-opacity,\n calc(var(--ha-ripple-hover-opacity, 0.04) + 0.05)\n );\n --md-ripple-pressed-opacity: var(\n --button-card-ripple-icon-pressed-opacity,\n calc(var(--ha-ripple-pressed-opacity, 0.12) + 0.05)\n );\n }\n wa-tooltip {\n --wa-tooltip-background-color: var(--button-card-tooltip-background-color, var(--secondary-background-color));\n --wa-tooltip-content-color: var(--button-card-tooltip-content-color, var(--primary-text-color));\n --wa-tooltip-font-family: var(\n --button-card-tooltip-font-family,\n var(--ha-tooltip-font-family, var(--ha-font-family-body))\n );\n --wa-tooltip-font-size: var(--button-card-tooltip-font-size, var(--ha-tooltip-font-size, var(--ha-font-size-s)));\n --wa-tooltip-font-weight: var(\n --button-card-tooltip-font-weight,\n var(--ha-tooltip-font-weight, var(--ha-font-weight-normal))\n );\n --wa-tooltip-line-height: var(\n --button-card-tooltip-line-height,\n var(--ha-tooltip-line-height, var(--ha-line-height-condensed))\n );\n --wa-tooltip-padding: var(--button-card-tooltip-padding, 8px);\n --wa-tooltip-border-radius: var(\n --button-card-tooltip-border-radius,\n var(--ha-tooltip-border-radius, var(--ha-border-radius-sm))\n );\n --wa-tooltip-arrow-size: var(--button-card-tooltip-arrow-size, var(--ha-tooltip-arrow-size, 8px));\n --wa-tooltip-border-width: var(--button-card-tooltip-border-width);\n --wa-tooltip-border-color: var(--button-card-tooltip-border-color);\n --wa-tooltip-border-style: var(--button-card-tooltip-border-style);\n --max-width: var(--button-card-tooltip-max-width, 30ch);\n }\n wa-tooltip::part(base__popup) {\n --show-duration: var(--button-card-tooltip-show-duration, 100ms);\n --hide-duration: var(--button-card-tooltip-hide-duration, 100ms);\n opacity: var(--button-card-tooltip-opacity, 1);\n }\n wa-tooltip::part(body) {\n padding: var(--button-card-tooltip-padding, 0.25em 0.5em);\n box-shadow: var(--button-card-tooltip-box-shadow, var(--ha-card-box-shadow, none));\n font-weight: var(--button-card-tooltip-font-weight, var(--ha-tooltip-font-weight, normal));\n font-family: var(--button-card-tooltip-font-family, var(--ha-tooltip-font-family, inherit));\n text-align: var(--button-card-tooltip-text-align, center);\n text-decoration: var(--button-card-tooltip-text-decoration, none);\n text-transform: var(--button-card-tooltip-text-transform, none);\n overflow-wrap: var(--button-card-tooltip-overflow-wrap, normal);\n }\n :not(ha-state-icon) ha-icon,\n ha-state-icon {\n display: inline-block;\n margin: auto;\n --mdc-icon-size: 100%;\n --iron-icon-width: 100%;\n --iron-icon-height: 100%;\n }\n ha-card.button-card-main {\n padding: 4% 0px;\n text-transform: none;\n font-weight: 400;\n font-size: 1.2rem;\n align-items: center;\n text-align: center;\n letter-spacing: normal;\n width: 100%;\n }\n .ellipsis {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n #spinner {\n align-items: flex-start;\n justify-content: flex-start;\n padding: 8px 7px;\n --ha-spinner-indicator-color: var(--button-card-spinner-color, var(--button-card-color));\n --ha-spinner-size: var(--button-card-spinner-size, 1.5vw);\n /* DO NOT override items below */\n pointer-events: auto;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n }\n #spinner-background {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n opacity: var(--button-card-spinner-background-opacity, 0.4);\n background: var(--button-card-spinner-background-color, var(--card-background-color, white));\n }\n\n #overlay {\n align-items: flex-start;\n justify-content: flex-end;\n padding: 8px 7px;\n opacity: 0.5;\n /* DO NOT override items below */\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n }\n #lock {\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n margin: unset;\n width: 24px;\n }\n .invalid {\n animation: blink 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;\n }\n .hidden {\n visibility: hidden;\n opacity: 0;\n transition:\n visibility 0s 1s,\n opacity 1s linear;\n }\n @keyframes blink {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n @-webkit-keyframes rotating /* Safari and Chrome */ {\n from {\n -webkit-transform: rotate(0deg);\n -o-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n to {\n -webkit-transform: rotate(360deg);\n -o-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n @keyframes rotating {\n from {\n -ms-transform: rotate(0deg);\n -moz-transform: rotate(0deg);\n -webkit-transform: rotate(0deg);\n -o-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n to {\n -ms-transform: rotate(360deg);\n -moz-transform: rotate(360deg);\n -webkit-transform: rotate(360deg);\n -o-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n [rotating] {\n -webkit-animation: rotating 2s linear infinite;\n -moz-animation: rotating 2s linear infinite;\n -ms-animation: rotating 2s linear infinite;\n -o-animation: rotating 2s linear infinite;\n animation: rotating 2s linear infinite;\n }\n\n #container {\n display: grid;\n width: 100%;\n height: 100%;\n text-align: center;\n align-items: center;\n }\n .section #container {\n align-content: center;\n }\n #img-cell {\n display: flex;\n grid-area: i;\n height: 100%;\n width: 100%;\n max-width: 100%;\n max-height: 100%;\n align-self: center;\n justify-self: center;\n overflow: hidden;\n justify-content: center;\n align-items: center;\n position: relative;\n }\n\n ha-state-icon#icon {\n height: 100%;\n width: 100%;\n max-height: 100%;\n position: absolute;\n }\n ha-state-icon#icon.enabled,\n img#icon.enabled {\n pointer-events: auto;\n cursor: pointer;\n }\n img#icon {\n display: block;\n height: auto;\n width: 100%;\n position: absolute;\n }\n #name {\n grid-area: n;\n max-width: 100%;\n align-self: center;\n justify-self: center;\n /* margin: auto; */\n }\n #state {\n grid-area: s;\n max-width: 100%;\n align-self: center;\n justify-self: center;\n /* margin: auto; */\n }\n\n #label {\n grid-area: l;\n max-width: 100%;\n align-self: center;\n justify-self: center;\n }\n\n #container.vertical {\n grid-template-areas: 'i' 'n' 's' 'l';\n grid-template-columns: 1fr;\n grid-template-rows: 1fr min-content min-content min-content;\n }\n .section #container.vertical {\n grid-template-rows: auto min-content min-content min-content;\n }\n .section #container.vertical:not(.no-icon) #name {\n margin-top: 8px;\n }\n /* Vertical No Icon */\n #container.vertical.no-icon {\n grid-template-areas: 'n' 's' 'l';\n grid-template-columns: 1fr;\n grid-template-rows: 1fr min-content 1fr;\n }\n #container.vertical.no-icon #state {\n align-self: center;\n }\n #container.vertical.no-icon #name {\n align-self: end;\n }\n #container.vertical.no-icon #label {\n align-self: start;\n }\n\n /* Vertical No Icon No Name */\n #container.vertical.no-icon.no-name {\n grid-template-areas: 's' 'l';\n grid-template-columns: 1fr;\n grid-template-rows: 1fr 1fr;\n }\n #container.vertical.no-icon.no-name #state {\n align-self: end;\n }\n #container.vertical.no-icon.no-name #label {\n align-self: start;\n }\n\n /* Vertical No Icon No State */\n #container.vertical.no-icon.no-state {\n grid-template-areas: 'n' 'l';\n grid-template-columns: 1fr;\n grid-template-rows: 1fr 1fr;\n }\n #container.vertical.no-icon.no-state #name {\n align-self: end;\n }\n #container.vertical.no-icon.no-state #label {\n align-self: start;\n }\n\n /* Vertical No Icon No Label */\n #container.vertical.no-icon.no-label {\n grid-template-areas: 'n' 's';\n grid-template-columns: 1fr;\n grid-template-rows: 1fr 1fr;\n }\n #container.vertical.no-icon.no-label #name {\n align-self: end;\n }\n #container.vertical.no-icon.no-label #state {\n align-self: start;\n }\n\n /* Vertical No Icon No Label No Name */\n #container.vertical.no-icon.no-label.no-name {\n grid-template-areas: 's';\n grid-template-columns: 1fr;\n grid-template-rows: 1fr;\n }\n #container.vertical.no-icon.no-label.no-name #state {\n align-self: center;\n }\n /* Vertical No Icon No Label No State */\n #container.vertical.no-icon.no-label.no-state {\n grid-template-areas: 'n';\n grid-template-columns: 1fr;\n grid-template-rows: 1fr;\n }\n #container.vertical.no-icon.no-label.no-state #name {\n align-self: center;\n }\n\n /* Vertical No Icon No Name No State */\n #container.vertical.no-icon.no-name.no-state {\n grid-template-areas: 'l';\n grid-template-columns: 1fr;\n grid-template-rows: 1fr;\n }\n #container.vertical.no-icon.no-name.no-state #label {\n align-self: center;\n }\n\n #container.icon_name_state {\n grid-template-areas: 'i n' 'l l';\n grid-template-columns: 40% 1fr;\n grid-template-rows: 1fr min-content;\n }\n\n #container.icon_name {\n grid-template-areas: 'i n' 's s' 'l l';\n grid-template-columns: 40% 1fr;\n grid-template-rows: 1fr min-content min-content;\n }\n .section #container.icon_name {\n grid-template-rows: auto min-content min-content;\n }\n #container.icon_state {\n grid-template-areas: 'i s' 'n n' 'l l';\n grid-template-columns: 40% 1fr;\n grid-template-rows: 1fr min-content min-content;\n }\n .section #container.icon_state {\n grid-template-rows: auto min-content min-content;\n }\n\n #container.name_state {\n grid-template-areas: 'i' 'n' 'l';\n grid-template-columns: 1fr;\n grid-template-rows: 1fr min-content min-content;\n }\n .section #container.name_state {\n grid-template-rows: auto min-content min-content;\n }\n #container.name_state.no-icon {\n grid-template-areas: 'n' 'l';\n grid-template-columns: 1fr;\n grid-template-rows: 1fr 1fr;\n }\n #container.name_state.no-icon #name {\n align-self: end;\n }\n .section #container.name_state:not(.no-icon) #name {\n margin-top: 8px;\n }\n #container.name_state.no-icon #label {\n align-self: start;\n }\n\n #container.name_state.no-icon.no-label {\n grid-template-areas: 'n';\n grid-template-columns: 1fr;\n grid-template-rows: 1fr;\n }\n #container.name_state.no-icon.no-label #name {\n align-self: center;\n }\n\n /* icon_name_state2nd default */\n #container.icon_name_state2nd {\n grid-template-areas: 'i n' 'i s' 'i l';\n grid-template-columns: 40% 1fr;\n grid-template-rows: 1fr min-content 1fr;\n }\n #container.icon_name_state2nd #name {\n align-self: end;\n }\n #container.icon_name_state2nd #state {\n align-self: center;\n }\n #container.icon_name_state2nd #label {\n align-self: start;\n }\n\n /* icon_name_state2nd No Label */\n #container.icon_name_state2nd.no-label {\n grid-template-areas: 'i n' 'i s';\n grid-template-columns: 40% 1fr;\n grid-template-rows: 1fr 1fr;\n }\n #container.icon_name_state2nd #name {\n align-self: end;\n }\n #container.icon_name_state2nd #state {\n align-self: start;\n }\n\n /* icon_state_name2nd Default */\n #container.icon_state_name2nd {\n grid-template-areas: 'i s' 'i n' 'i l';\n grid-template-columns: 40% 1fr;\n grid-template-rows: 1fr min-content 1fr;\n }\n #container.icon_state_name2nd #state {\n align-self: end;\n }\n #container.icon_state_name2nd #name {\n align-self: center;\n }\n #container.icon_state_name2nd #label {\n align-self: start;\n }\n\n /* icon_state_name2nd No Label */\n #container.icon_state_name2nd.no-label {\n grid-template-areas: 'i s' 'i n';\n grid-template-columns: 40% 1fr;\n grid-template-rows: 1fr 1fr;\n }\n #container.icon_state_name2nd #state {\n align-self: end;\n }\n #container.icon_state_name2nd #name {\n align-self: start;\n }\n\n #container.icon_label {\n grid-template-areas: 'i l' 'n n' 's s';\n grid-template-columns: 40% 1fr;\n grid-template-rows: 1fr min-content min-content;\n }\n\n [style*='--aspect-ratio'] > :first-child {\n width: 100%;\n }\n [style*='--aspect-ratio'] > img {\n height: auto;\n }\n @supports (--custom: property) {\n [style*='--aspect-ratio'] {\n position: relative;\n }\n [style*='--aspect-ratio']::before {\n content: '';\n display: block;\n padding-bottom: calc(100% / (var(--aspect-ratio)));\n }\n [style*='--aspect-ratio'] > :first-child {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n }\n }\n"])));!function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(Mn||(Mn={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(Pn||(Pn={})),function(t){t.local="local",t.server="server"}(Hn||(Hn={})),function(t){t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD"}(In||(In={})),function(t){t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday"}(Rn||(Rn={}));var qn,Wn,Yn,Zn,Kn,Xn=function(t,e,n){var i=e?function(t){switch(t.number_format){case Mn.comma_decimal:return["en-US","en"];case Mn.decimal_comma:return["de","es","it"];case Mn.space_comma:return["fr","sv","cs"];case Mn.system:return;default:return t.language}}(e):void 0;if(Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},(null==e?void 0:e.number_format)!==Mn.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(i,Qn(t,n)).format(Number(t))}catch(o){return console.error(o),new Intl.NumberFormat(void 0,Qn(t,n)).format(Number(t))}return"string"==typeof t?t:"".concat(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Math.round(t*Math.pow(10,e))/Math.pow(10,e)}(t,null==n?void 0:n.maximumFractionDigits).toString()).concat("currency"===(null==n?void 0:n.style)?" ".concat(n.currency):"")},Jn=function(t,e,n){var i,o=null==n?void 0:n.display_precision;return void 0!==e&&(o=e),null!=o?{maximumFractionDigits:o,minimumFractionDigits:o}:Number.isInteger(Number(null===(i=t.attributes)||void 0===i?void 0:i.step))&&Number.isInteger(Number(t.state))?{maximumFractionDigits:0}:null!=t.attributes.step?{maximumFractionDigits:Math.ceil(Math.log10(1/t.attributes.step))}:void 0},Qn=function(t,e){var n=Object.assign({maximumFractionDigits:2},e);if("string"!=typeof t)return n;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){var i=t.indexOf(".")>-1?t.split(".")[1].length:0;n.minimumFractionDigits=i,n.maximumFractionDigits=i}return n};!function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(qn||(qn={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(Wn||(Wn={})),function(t){t.local="local",t.server="server"}(Yn||(Yn={})),function(t){t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD"}(Zn||(Zn={})),function(t){t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday"}(Kn||(Kn={}));var ti=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=""+t,i=1;i<e;i++)n=parseInt(n)<Math.pow(10,i)?"0".concat(n):n;return n};var ei={ms:1,s:1e3,min:6e4,h:36e5,d:864e5},ni=function(t,e){return function(t){var e=Math.floor(t/1e3/3600),n=Math.floor(t/1e3%3600/60),i=Math.floor(t/1e3%3600%60),o=Math.floor(t%1e3);return e>0?"".concat(e,":").concat(ti(n),":").concat(ti(i)):n>0?"".concat(n,":").concat(ti(i)):i>0||o>0?"".concat(i).concat(o>0?".".concat(ti(o,3)):""):null}(parseFloat(t)*ei[e])||"0"},ii=Number.isNaN||function(t){return"number"==typeof t&&t!=t};function oi(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(i=t[n],o=e[n],!(i===o||ii(i)&&ii(o)))return!1;var i,o;return!0}function ri(t,e){void 0===e&&(e=oi);var n=null;function i(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&e(i,n.lastArgs))return n.lastResult;var r=t.apply(this,i);return n={lastResult:r,lastArgs:i,lastThis:this},r}return i.clear=function(){n=null},i}var ai=ri((function(t,e){return new Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric",timeZone:"server"===t.time_zone?e:void 0})})),ui=function(t,e,n){return si(e,n.time_zone).format(t)},si=ri((function(t,e){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",timeZone:"server"===t.time_zone?e:void 0})})),ci=function(t,e,n){var i,o,r,a,u=li(e,n.time_zone);if(e.date_format===In.language||e.date_format===In.system)return u.format(t);var s=u.formatToParts(t),c=null===(i=s.find((function(t){return"literal"===t.type})))||void 0===i?void 0:i.value,l=null===(o=s.find((function(t){return"day"===t.type})))||void 0===o?void 0:o.value,d=null===(r=s.find((function(t){return"month"===t.type})))||void 0===r?void 0:r.value,h=null===(a=s.find((function(t){return"year"===t.type})))||void 0===a?void 0:a.value,f=s[s.length-1],v="literal"===(null==f?void 0:f.type)?null==f?void 0:f.value:"";return"bg"===e.language&&e.date_format===In.YMD&&(v=""),x(x(x({},In.DMY,"".concat(l).concat(c).concat(d).concat(c).concat(h).concat(v)),In.MDY,"".concat(d).concat(c).concat(l).concat(c).concat(h).concat(v)),In.YMD,"".concat(h).concat(c).concat(d).concat(c).concat(l).concat(v))[e.date_format]},li=ri((function(t,e){var n=t.date_format===In.system?void 0:t.language;return t.date_format===In.language||(t.date_format,In.system),new Intl.DateTimeFormat(n,{year:"numeric",month:"numeric",day:"numeric",timeZone:"server"===t.time_zone?e:void 0})})),di=ri((function(t,e){return new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short",timeZone:"server"===t.time_zone?e:void 0})})),hi=ri((function(t,e){return new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric",timeZone:"server"===t.time_zone?e:void 0})})),fi=ri((function(t,e){return new Intl.DateTimeFormat(t.language,{month:"long",timeZone:"server"===t.time_zone?e:void 0})})),vi=ri((function(t,e){return new Intl.DateTimeFormat(t.language,{year:"numeric",timeZone:"server"===t.time_zone?e:void 0})})),pi=ri((function(t,e){return new Intl.DateTimeFormat(t.language,{weekday:"long",timeZone:"server"===t.time_zone?e:void 0})})),mi=ri((function(t,e){return new Intl.DateTimeFormat(t.language,{weekday:"short",timeZone:"server"===t.time_zone?e:void 0})})),gi=ri((function(t){if(t.time_format===Pn.language||t.time_format===Pn.system){var e=t.time_format===Pn.language?t.language:void 0,n=(new Date).toLocaleString(e);return n.includes("AM")||n.includes("PM")}return t.time_format===Pn.am_pm})),_i=function(t,e,n){return yi(e,n.time_zone).format(t)},yi=ri((function(t,e){return new Intl.DateTimeFormat("en"!==t.language||gi(t)?t.language:"en-u-hc-h23",{hour:"numeric",minute:"2-digit",hour12:gi(t),timeZone:"server"===t.time_zone?e:void 0})})),bi=ri((function(t,e){return new Intl.DateTimeFormat("en"!==t.language||gi(t)?t.language:"en-u-hc-h23",{hour:gi(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:gi(t),timeZone:"server"===t.time_zone?e:void 0})})),Di=ri((function(t,e){return new Intl.DateTimeFormat("en"!==t.language||gi(t)?t.language:"en-u-hc-h23",{weekday:"long",hour:gi(t)?"numeric":"2-digit",minute:"2-digit",hour12:gi(t),timeZone:"server"===t.time_zone?e:void 0})})),Ai=ri((function(t,e){return new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:"server"===t.time_zone?e:void 0})})),wi=function(t,e,n){return Ci(e,n.time_zone).format(t)},Ci=ri((function(t,e){return new Intl.DateTimeFormat("en"!==t.language||gi(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:gi(t)?"numeric":"2-digit",minute:"2-digit",hour12:gi(t),timeZone:"server"===t.time_zone?e:void 0})})),Ei=ri((function(t,e){return new Intl.DateTimeFormat("en"!==t.language||gi(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"short",day:"numeric",hour:gi(t)?"numeric":"2-digit",minute:"2-digit",hour12:gi(t),timeZone:"server"===t.time_zone?e:void 0})})),ki=ri((function(t,e){return new Intl.DateTimeFormat("en"!==t.language||gi(t)?t.language:"en-u-hc-h23",{month:"short",day:"numeric",hour:gi(t)?"numeric":"2-digit",minute:"2-digit",hour12:gi(t),timeZone:"server"===t.time_zone?e:void 0})})),Fi=ri((function(t,e){return new Intl.DateTimeFormat("en"!==t.language||gi(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:gi(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:gi(t),timeZone:"server"===t.time_zone?e:void 0})})),Oi=function(t,e){return 0!=(t.supported_features&e)},ji=function(t){return function(t){return Oi(t,4)&&"number"==typeof t.in_progress}(t)||!!t.in_progress},Si=function(t,e,n,i,o,r,a){var u=o[e.entity_id];return Ti(t,n,i,u,e.entity_id,e.attributes,r,void 0!==a?a:e.state)},Ti=function(t,e,n,i,o,r,a,u){var s;if("unknown"===u||"unavailable"===u)return t("state.default.".concat(u));if(function(t){return!!t.unit_of_measurement||!!t.state_class}(r)){if("duration"===r.device_class&&r.unit_of_measurement&&ei[r.unit_of_measurement])try{return ni(u,r.unit_of_measurement)}catch(p){}if("monetary"===r.device_class)try{return Xn(u,e,Object.assign({style:"currency",currency:(null==a?void 0:a.units)||r.unit_of_measurement,minimumFractionDigits:2},Jn({state:u,attributes:r},null==a?void 0:a.numeric_precision,i)))}catch(p){}var c=(null==a?void 0:a.show_units)?(null==a?void 0:a.units)?null==a?void 0:a.units:r.unit_of_measurement:void 0,l=c?"%"===c?function(t){switch(t.language){case"cz":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}(e)+"%":" ".concat(c):"";return"".concat(Xn(u,e,Jn({state:u,attributes:r},null==a?void 0:a.numeric_precision,i))).concat(l)}var d=Cn(o);if("datetime"===d){var h=new Date(u);return wi(h,e,n)}if(["date","input_datetime","time"].includes(d))try{var f=u.split(" ");if(2===f.length)return wi(new Date(f.join("T")),Object.assign(Object.assign({},e),{time_zone:Yn.local}),n);if(1===f.length){if(u.includes("-"))return ui(new Date("".concat(u,"T00:00")),Object.assign(Object.assign({},e),{time_zone:Yn.local}),n);if(u.includes(":")){var v=new Date;return _i(new Date("".concat(v.toISOString().split("T")[0],"T").concat(u)),Object.assign(Object.assign({},e),{time_zone:Yn.local}),n)}}return u}catch(m){return u}if("counter"===d||"number"===d||"input_number"===d)return Xn(u,e,Jn({state:u,attributes:r},null==a?void 0:a.numeric_precision,i));if(["button","event","input_button","scene","stt","tts"].includes(d)||"sensor"===d&&"timestamp"===r.device_class)try{return wi(new Date(u),e,n)}catch(p){return u}return"update"===d?"on"===u?ji(r)?Oi(r,4)&&"number"==typeof r.in_progress?t("ui.card.update.installing_with_progress",{progress:r.in_progress}):t("ui.card.update.installing"):r.latest_version:r.skipped_version===r.latest_version?null!==(s=r.latest_version)&&void 0!==s?s:t("state.default.unavailable"):t("ui.card.update.up_to_date"):(null==i?void 0:i.translation_key)&&t("component.".concat(i.platform,".entity.").concat(d,".").concat(i.translation_key,".state.").concat(u))||r.device_class&&t("component.".concat(d,".entity_component.").concat(r.device_class,".state.").concat(u))||t("component.".concat(d,".entity_component._.state.").concat(u))||u},Bi=Function.prototype.toString,$i=Object.create,xi=Object.prototype.toString,Mi=function(){function t(){this._keys=[],this._values=[]}return t.prototype.has=function(t){return!!~this._keys.indexOf(t)},t.prototype.get=function(t){return this._values[this._keys.indexOf(t)]},t.prototype.set=function(t,e){this._keys.push(t),this._values.push(e)},t}();var Pi="undefined"!=typeof WeakMap?function(){return new WeakMap}:function(){return new Mi};function Hi(t){if(!t)return $i(null);var e=t.constructor;if(e===Object)return t===Object.prototype?{}:$i(t);if(e&&~Bi.call(e).indexOf("[native code]"))try{return new e}catch(Gi){}return $i(t)}var Ii="g"===/test/g.flags?function(t){return t.flags}:function(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e};function Ri(t){var e=xi.call(t);return e.substring(8,e.length-1)}var Ni="undefined"!=typeof Symbol?function(t){return t[Symbol.toStringTag]||Ri(t)}:Ri,Vi=Object.defineProperty,zi=Object.getOwnPropertyDescriptor,Li=Object.getOwnPropertyNames,Ui=Object.getOwnPropertySymbols,Gi=Object.prototype,qi=Gi.hasOwnProperty,Wi=Gi.propertyIsEnumerable,Yi="function"==typeof Ui;var Zi=Yi?function(t){return Li(t).concat(Ui(t))}:Li;function Ki(t,e,n){for(var i=Zi(t),o=0,r=i.length,a=void 0,u=void 0;o<r;++o)if("callee"!==(a=i[o])&&"caller"!==a)if(u=zi(t,a)){u.get||u.set||(u.value=n.copier(u.value,n));try{Vi(e,a,u)}catch(s){e[a]=u.value}}else e[a]=n.copier(t[a],n);return e}function Xi(t,e){return t.slice(0)}function Ji(t,e){var n=new e.Constructor;return e.cache.set(t,n),t.forEach((function(t,i){n.set(i,e.copier(t,e))})),n}var Qi=Yi?function(t,e){var n=Hi(e.prototype);for(var i in e.cache.set(t,n),t)qi.call(t,i)&&(n[i]=e.copier(t[i],e));for(var o=Ui(t),r=0,a=o.length,u=void 0;r<a;++r)u=o[r],Wi.call(t,u)&&(n[u]=e.copier(t[u],e));return n}:function(t,e){var n=Hi(e.prototype);for(var i in e.cache.set(t,n),t)qi.call(t,i)&&(n[i]=e.copier(t[i],e));return n};function to(t,e){return new e.Constructor(t.valueOf())}function eo(t,e){return t}function no(t,e){var n=new e.Constructor;return e.cache.set(t,n),t.forEach((function(t){n.add(e.copier(t,e))})),n}var io=Array.isArray,oo=Object.assign,ro=Object.getPrototypeOf||function(t){return t.__proto__},ao={array:function(t,e){var n=new e.Constructor;e.cache.set(t,n);for(var i=0,o=t.length;i<o;++i)n[i]=e.copier(t[i],e);return n},arrayBuffer:Xi,blob:function(t,e){return t.slice(0,t.size,t.type)},dataView:function(t,e){return new e.Constructor(Xi(t.buffer))},date:function(t,e){return new e.Constructor(t.getTime())},error:eo,map:Ji,object:Qi,regExp:function(t,e){var n=new e.Constructor(t.source,Ii(t));return n.lastIndex=t.lastIndex,n},set:no},uo=oo({},ao,{array:function(t,e){var n=new e.Constructor;return e.cache.set(t,n),Ki(t,n,e)},map:function(t,e){return Ki(t,Ji(t,e),e)},object:function(t,e){var n=Hi(e.prototype);return e.cache.set(t,n),Ki(t,n,e)},set:function(t,e){return Ki(t,no(t,e),e)}});function so(t){var e=function(t){return{Arguments:t.object,Array:t.array,ArrayBuffer:t.arrayBuffer,Blob:t.blob,Boolean:to,DataView:t.dataView,Date:t.date,Error:t.error,Float32Array:t.arrayBuffer,Float64Array:t.arrayBuffer,Int8Array:t.arrayBuffer,Int16Array:t.arrayBuffer,Int32Array:t.arrayBuffer,Map:t.map,Number:to,Object:t.object,Promise:eo,RegExp:t.regExp,Set:t.set,String:to,WeakMap:eo,WeakSet:eo,Uint8Array:t.arrayBuffer,Uint8ClampedArray:t.arrayBuffer,Uint16Array:t.arrayBuffer,Uint32Array:t.arrayBuffer,Uint64Array:t.arrayBuffer}}(oo({},ao,t)),n=e.Array,i=e.Object;function o(t,o){if(o.prototype=o.Constructor=void 0,!t||"object"!==it(t))return t;if(o.cache.has(t))return o.cache.get(t);if(o.prototype=ro(t),o.Constructor=o.prototype&&o.prototype.constructor,!o.Constructor||o.Constructor===Object)return i(t,o);if(io(t))return n(t,o);var r=e[Ni(t)];return r?r(t,o):"function"==typeof t.then?t:i(t,o)}return function(t){return o(t,{Constructor:void 0,cache:Pi(),copier:o,prototype:void 0})}}so(oo({},uo,{}));var co=so({}),lo=new Set(["alarm_control_panel","alert","automation","binary_sensor","calendar","camera","climate","cover","device_tracker","fan","group","humidifier","input_boolean","light","lock","media_player","person","plant","remote","schedule","script","siren","sun","switch","timer","update","vacuum"]),ho=function(t,e,n){if((void 0!==e?e:null==t?void 0:t.state)===vn)return"var(--state-unavailable-color)";var i=vo(t,e,n);return i?Bn(i):void 0},fo=function(t,e,n,i){var o=void 0!==n?n:e.state,r=Tn(e,n),a=[],u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_",n="àáäâãåăæąçćčđďèéěėëêęğǵḧìíïîįłḿǹńňñòóöôœøṕŕřßşśšșťțùúüûǘůűūųẃẍÿýźžż·/_,:;",i="aaaaaaaaacccddeeeeeeegghiiiiilmnnnnooooooprrsssssttuuuuuuuuuwxyyzzz".concat(e).concat(e).concat(e).concat(e).concat(e).concat(e),o=new RegExp(n.split("").join("|"),"g");return t.toString().toLowerCase().replace(/\s+/g,e).replace(o,(function(t){return i.charAt(n.indexOf(t))})).replace(/&/g,"".concat(e,"and").concat(e)).replace(/[^\w-]+/g,"").replace(/-/g,e).replace(new RegExp("(".concat(e,")\\1+"),"g"),"$1").replace(new RegExp("^".concat(e,"+")),"").replace(new RegExp("".concat(e,"+$")),"")}(o,"_"),s=r?"active":"inactive";if(i&&yn.includes(i)&&"inactive"==s)return bn;var c=e.attributes.device_class;return c&&a.push("--state-".concat(t,"-").concat(c,"-").concat(u,"-color")),a.push("--state-".concat(t,"-").concat(u,"-color"),"--state-".concat(t,"-").concat(s,"-color"),"--state-".concat(s,"-color")),a},vo=function(t,e,n){var i=void 0!==e?e:null==t?void 0:t.state,o=Cn(t.entity_id),r=t.attributes.device_class;if("sensor"===o&&"battery"===r){var a=function(t){var e=Number(t);if(!isNaN(e))return e>=70?"--state-sensor-battery-high-color":e>=30?"--state-sensor-battery-medium-color":"--state-sensor-battery-low-color"}(i);if(a)return[a]}if("group"===o){var u=function(t){var e=t.attributes.entity_id||[],n=H(new Set(e.map((function(t){return Cn(t)}))));return 1===n.length?n[0]:void 0}(t);if(u&&lo.has(u))return fo(u,t,e,n)}return lo.has(o)?fo(o,t,e,n):n&&yn.includes(n)?bn:void 0},po=function(){var t=z(R().m((function t(e,n,i,o){return R().w((function(t){for(;;)switch(t.n){case 0:He(e,"hass-action",{config:i,action:o});case 1:return t.a(2)}}),t)})));return function(e,n,i,o){return t.apply(this,arguments)}}(),mo=Object.create(null),go=36e5,_o=24*go,yo=365.25*_o;mo.year=mo.yr=mo.y=yo,mo.month=mo.mo=mo.mth=yo/12,mo.week=mo.wk=mo.w=7*_o,mo.day=mo.d=_o,mo.hour=mo.hr=mo.h=go,mo.minute=mo.min=mo.m=6e4,mo.second=mo.sec=mo.s=1e3,mo.millisecond=mo.millisec=mo.ms=1,mo.microsecond=mo.microsec=mo.us=mo.µs=.001,mo.nanosecond=mo.nanosec=mo.ns=1e-6,mo.group=",",mo.decimal=".",mo.placeholder=" _";var bo=/((?:[0-9]{1,16}(?:\.[0-9]{1,16})?|\.[0-9]{1,16})(?:[Ee][\+\x2D]?[0-9]{1,4})?)[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]?((?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]){0,14})/g;function Do(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ms",i=null;return String(e).replace(new RegExp("(\\d)[".concat(Do.unit.placeholder).concat(Do.unit.group,"](\\d)"),"g"),"$1$2").replace(Do.unit.decimal,".").replace(bo,(function(e,o,r){if(r)r=r.toLowerCase();else if(t){for(var a in Do.unit)if(Do.unit[a]<t){r=a;break}}else r=n;t=r=Do.unit[r]||Do.unit[r.replace(/s$/,"")],r&&(i=(i||0)+o*r)})),i&&i/(Do.unit[n]||1)*("-"===e[0]?-1:1)}Do.unit=mo;var Ao=Object.create(mo);Ao.jahr=Ao.j=mo.y,Ao.monat=mo.mo,Ao.woche=mo.w,Ao.tag=Ao.t=mo.d,Ao.stunde=mo.h,Ao.minute=mo.m,Ao.sekunde=mo.s,Ao.millisekunde=mo.ms,Ao.mikrosekunde=mo.us,Ao.nanosekunde=mo.ns,Ao.group=".",Ao.decimal=",";var wo=Object.create(mo);wo.año=wo.a=mo.y,wo.mes=mo.mo,wo.semana=mo.w,wo.día=mo.d,wo.hora=mo.h,wo.minuto=mo.m,wo.segundo=mo.s,wo.milisegundo=mo.ms,wo.microsegundo=mo.us,wo.nanosegundo=mo.ns,wo.group=".",wo.decimal=",";var Co=Object.create(mo);Co.année=Co.an=Co.a=mo.y,Co.mois=mo.mo,Co.semaine=Co.sem=mo.w,Co.jour=Co.j=mo.d,Co.heure=mo.h,Co.minute=mo.m,Co.seconde=mo.s,Co.milliseconde=mo.ms,Co.microseconde=mo.us,Co.nanoseconde=mo.ns,Co.group=" ",Co.decimal=",";var Eo=Object.create(mo);Eo.年=Eo.年間=mo.y,Eo.月=Eo.ヶ月=mo.mo,Eo.週=Eo.週間=mo.w,Eo.日=mo.d,Eo.時間=Eo.時=mo.h,Eo.分=Eo.分間=mo.m,Eo.秒=Eo.秒間=mo.s,Eo.ミリ秒=mo.ms,Eo.マイクロ秒=mo.us,Eo.ナノ秒=mo.ns,Eo.group=",",Eo.decimal=".";var ko=Object.create(mo);ko.ano=ko.a=mo.y,ko.mês=ko.mes=mo.mo,ko.semana=ko.sem=mo.w,ko.dia=mo.d,ko.hora=mo.h,ko.minuto=mo.m,ko.segundo=ko.seg=mo.s,ko.milissegundo=mo.ms,ko.microssegundo=mo.us,ko.nanossegundo=mo.ns,ko.group=".",ko.decimal=",";var Fo=Object.create(mo);Fo.год=Fo.г=mo.y,Fo.месяц=Fo.мес=mo.mo,Fo.неделя=Fo.нед=mo.w,Fo.день=Fo.д=mo.d,Fo.час=Fo.ч=mo.h,Fo.минута=Fo.мин=mo.m,Fo.секунда=Fo.сек=mo.s,Fo.миллисекунда=Fo.мс=mo.ms,Fo.микросекунда=Fo.мкс=mo.us,Fo.наносекунда=Fo.нс=mo.ns,Fo.group=" ",Fo.decimal=",";var Oo=Object.create(mo);Oo.年=mo.y,Oo.月=mo.mo,Oo.周=Oo.星期=mo.w,Oo.天=Oo.日=mo.d,Oo.小时=Oo.时=mo.h,Oo.分钟=Oo.分=mo.m,Oo.秒=Oo.秒钟=mo.s,Oo.毫秒=mo.ms,Oo.微秒=mo.us,Oo.纳秒=mo.ns,Oo.group=",",Oo.decimal=".";var jo={de:Ao,en:mo,es:wo,fr:Co,ja:Eo,pt:ko,ru:Fo,zh:Oo},So=function(t,e,n){if(void 0!==t){(n=(n=n.toLocaleLowerCase()).startsWith("en")?"en":n)&&n in jo?Do.unit=jo[n]:console.warn("button-card: parseDuration does not support locale '".concat(n,"'"));var i=Do(t,e);return null!=i?i:void 0}},To=window.cardHelpers,Bo=new Promise(function(){var t=z(R().m((function t(e){return R().w((function(t){for(;;)switch(t.n){case 0:if(To&&e(),!window.loadCardHelpers){t.n=2;break}return t.n=1,window.loadCardHelpers();case 1:To=t.v,window.cardHelpers=To,e();case 2:return t.a(2)}}),t)})));return function(e){return t.apply(this,arguments)}}());window.buttonCardCustomActionsHandler||(window.buttonCardCustomActionsHandler=function(t){var e;t.detail.buttonCardCustomAction&&(null===(e=t.detail.buttonCardCustomAction)||void 0===e||e.callback(t))},document.body.addEventListener("ll-custom",window.buttonCardCustomActionsHandler)),console.info("%c BUTTON-CARD %c v".concat("7.0.1"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"button-card",name:"Button-Card",preview:!1,description:"A massively customizable custom button card"});var $o=function(t){function e(){var t;return Q(this,e),(t=L(this,e,arguments)).preview=!1,t._spinnerActive=!1,t._evaluatedVariables={},t._cards={},t._cardsConfig={},t._monitoredEntities=[],t._initialSetupComplete=!1,t._cardClickable=!1,t._iconClickable=!1,t._hasIconActions=!1,t._hidden=!1,t._cardMomentary=!1,t._iconMomentary=!1,t._cardRipple=!1,t._protectedAction=void 0,t._hapticCapture=!1,t._extraStyles=[],t}return G(e,ce),et(e,[{key:"_doIHaveEverything",get:function(){return!!this._hass&&!!this._config&&this.isConnected}},{key:"_computeHidden",value:function(){var t,e;(e=!(this.preview||!this._initialSetupComplete||void 0===(null===(t=this._config)||void 0===t?void 0:t.hidden))&&this._getTemplateOrValue(this._stateObj,this._config.hidden))!==this._hidden&&(this._hidden=e,this.hidden=e,He(this,"card-visibility-changed"))}},{key:"hass",set:function(t){var e=this;this._hass=t,this._pStates||(this._pStates=this._createStateProxy()),this._pHass=Object.assign(Object.assign({},t),{states:this._pStates}),Object.keys(this._cards).forEach((function(t){e._cards[t].hass=e._hass})),this._initialSetupComplete||this._finishSetup()}},{key:"_createStateProxy",value:function(){var t=this;return new Proxy({},{get:function(e,n){var i,o;return n.includes(".")&&!t._monitoredEntities.includes(n)&&(t._monitoredEntities.push(n),t._expandTriggerGroups()),null===(o=null===(i=t._hass)||void 0===i?void 0:i.states)||void 0===o?void 0:o[n]},has:function(e,n){var i,o;return!!(null===(o=null===(i=t._hass)||void 0===i?void 0:i.states)||void 0===o?void 0:o[n])},ownKeys:function(){return t._hass&&t._hass.states?Object.keys(t._hass.states):[]},getOwnPropertyDescriptor:function(e,n){var i,o;return{value:null===(o=null===(i=t._hass)||void 0===i?void 0:i.states)||void 0===o?void 0:o[n],enumerable:!0,configurable:!0}}})}},{key:"_createVariablesProxy",value:function(t){var e=this;return t?(this._evaluatedVariables={},new Proxy(t,{get:function(t,n){var i;if(n in e._evaluatedVariables&&"value"in e._evaluatedVariables[n])return e._evaluatedVariables[n].value;if(n in t){if(null===(i=e._evaluatedVariables[n])||void 0===i?void 0:i.loop)throw new Error('button-card: Detected a loop while evaluating variable "'.concat(n,'"'));e._evaluatedVariables[n]={loop:!0};var o=Reflect.get(t,n);return"object"===it(o)&&null!==o&&"value"in o?e._evaluatedVariables[n].value=e._objectEvalTemplate(e._stateObj,o.value):e._evaluatedVariables[n].value=e._objectEvalTemplate(e._stateObj,o),delete e._evaluatedVariables[n].loop,e._evaluatedVariables[n].value}}})):{}}},{key:"disconnectedCallback",value:function(){M(e,"disconnectedCallback",this,3)([]),this._clearInterval(),this._updateTimerCancel(),window.removeEventListener("haptic",this._hapticInterceptHandler.bind(this),{capture:!0})}},{key:"connectedCallback",value:function(){M(e,"connectedCallback",this,3)([]),this._initialSetupComplete?(this._updateTimerStart(),this._startTimerCountdown()):this._finishSetup(),window.addEventListener("haptic",this._hapticInterceptHandler.bind(this),{capture:!0})}},{key:"_finishSetup",value:function(){var t;if(!this._initialSetupComplete&&this._doIHaveEverything){if(this._pVariables=this._createVariablesProxy(co(null===(t=this._config)||void 0===t?void 0:t.variables)),this._config.entity)try{var e=this._getTemplateOrValue(void 0,this._config.entity);this._config.entity=e,this._stateObj=this._hass.states[e]}catch(Pe){console.error("button-card: Could not evaluate entity template: ".concat(this._config.entity))}if(this._isActionDoingSomething(this._stateObj,this._config.press_action)||this._isActionDoingSomething(this._stateObj,this._config.release_action)?this._config=Object.assign({tap_action:{action:"none"}},this._config):this._config.entity&&mn.has(Cn(this._config.entity))?this._config=Object.assign({tap_action:{action:"toggle"}},this._config):this._config.entity&&gn.has(Cn(this._config.entity))?this._config=Object.assign({tap_action:{action:"call-service",service:"input_button.press",target:{entity_id:this._config.entity}}},this._config):this._config.entity?this._config=Object.assign({tap_action:{action:"more-info"}},this._config):this._config=Object.assign({tap_action:{action:"none"}},this._config),(this._isActionDoingSomething(this._stateObj,this._config.press_action)||this._isActionDoingSomething(this._stateObj,this._config.release_action))&&(this._isActionDoingSomething(this._stateObj,this._config.tap_action)||this._isActionDoingSomething(this._stateObj,this._config.hold_action)||this._isActionDoingSomething(this._stateObj,this._config.double_tap_action)))throw new Error('button-card: If you use press_action or release_action, then tap_action, hold_action and double_tap_action must be "none" or not set at all.');if((this._isActionDoingSomething(this._stateObj,this._config.icon_press_action)||this._isActionDoingSomething(this._stateObj,this._config.icon_release_action))&&(this._isActionDoingSomething(this._stateObj,this._config.icon_tap_action)||this._isActionDoingSomething(this._stateObj,this._config.icon_hold_action)||this._isActionDoingSomething(this._stateObj,this._config.icon_double_tap_action)))throw new Error('button-card: If you use icon_press_action or icon_release_action, then icon_tap_action, icon_hold_action and icon_double_tap_action must be "none" or not set at all.');this._monitoredEntities=[],this._config.entity&&!this._monitoredEntities.includes(this._config.entity)&&this._monitoredEntities.push(this._config.entity),this._expandTriggerGroups(),this._startTimerCountdown(),this._updateTimerStart(),this._computeHidden(),this._initialSetupComplete=!0}}},{key:"_startTimerCountdown",value:function(){if(this._config&&this._config.entity&&"timer"===Cn(this._config.entity)){var t=this._hass.states[this._config.entity];this._startInterval(t)}}},{key:"_createCard",value:function(t){if(To)return To.createCardElement(t);var e=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e){return i("hui-error-card",{type:"error",error:t,config:e})},i=function(t,e){var i=window.document.createElement(t);try{if(!i.setConfig)return;i.setConfig(e)}catch(o){return console.error(t,o),n(o.message,e)}return i};if(!t||"object"!==it(t)||!e&&!t.type)return n("No type defined",t);var o=t.type;if(o&&o.startsWith("custom:"))o=o.substr(7);else if(e)if(Ln.has(o))o="hui-".concat(o,"-row");else{if(!t.entity)return n("Invalid config given.",t);var r=t.entity.split(".",1)[0];o="hui-".concat(Un[r]||"text","-entity-row")}else o="hui-".concat(o,"-card");if(customElements.get(o))return i(o,t);var a=n("Custom element doesn't exist: ".concat(t.type,"."),t);a.style.display="None";var u=setTimeout((function(){a.style.display=""}),2e3);return customElements.whenDefined(t.type).then((function(){clearTimeout(u),He(a,"ll-rebuild",{},a)})),a}(t);return Bo.then((function(){He(e,"ll-rebuild",{})})),e}},{key:"render",value:function(){var t,e,n,i=this;if(!this._config||!this._hass)return Gt(u||(u=B([""])));this._stateObj=this._config.entity?this._hass.states[this._config.entity]:void 0;try{return this._evaluatedVariables={},(null===(t=this._config)||void 0===t?void 0:t.variables)&&(null===(n=Object.keys(null===(e=this._config)||void 0===e?void 0:e.variables))||void 0===n||n.forEach((function(t){var e=i._config.variables[t];if("object"===it(e)&&null!==e&&e.force_eval)i._pVariables[t]}))),this._cardHtml()}catch(Pe){Pe.stack?console.error(Pe.stack):console.error(Pe);var o=document.createElement("hui-error-card");return o.preview=this.preview,o.setConfig({type:"error",error:Pe.name,message:Pe.message}),Gt(s||(s=B([" "," "])),o)}}},{key:"_hasAnEntityChanged",value:function(t){var e=t.get("_hass");if(e){return this._monitoredEntities.some(function(t){return(null==e?void 0:e.states[t])!==this._hass.states[t]}.bind(this))}return!1}},{key:"shouldUpdate",value:function(t){return!!t.has("_config")||(this._updateTimerDuration?!!t.has("_updateTimerMS")||this._updateTimerChanged():!!(t.has("_timeRemaining")||t.has("_updateTimerMS")||t.has("_spinnerActive"))||this._hasAnEntityChanged(t)?(this._expandTriggerGroups(),!0):!!t.has("preview"))}},{key:"willUpdate",value:function(t){var e=this;t.has("preview")&&Object.keys(this._cards).forEach((function(t){e._cards[t].preview=e.preview}))}},{key:"updated",value:function(t){var n=this;if(M(e,"updated",this,3)([t]),this._config&&this._config.entity&&"timer"===Cn(this._config.entity)&&t.has("_hass")){var i=this._hass.states[this._config.entity],o=t.get("_hass");(o?o.states[this._config.entity]:void 0)!==i?this._startInterval(i):i||this._clearInterval()}this.updateComplete.then((function(){var t,e,i,o,r=null===(t=n.shadowRoot)||void 0===t?void 0:t.getElementById("tooltip");r&&(null===(e=r.eventController)||void 0===e||e.abort(),r.eventController=new AbortController,r.anchor=void 0,null===(o=(i=r).handleForChange)||void 0===o||o.call(i))})),this._updateTimer(),this._computeHidden()}},{key:"_clearInterval",value:function(){this._interval&&(window.clearInterval(this._interval),this._interval=void 0)}},{key:"_startInterval",value:function(t){var e=this;this._clearInterval(),this._calculateRemaining(t),"active"===t.state&&(this._interval=window.setInterval((function(){return e._calculateRemaining(t)}),1e3))}},{key:"_calculateRemaining",value:function(t){t.attributes.remaining&&(this._timeRemaining=function(t){if(t.attributes.remaining){var e=$n(t.attributes.remaining);if("active"===t.state){var n=(new Date).getTime(),i=new Date(t.last_changed).getTime();e=Math.max(e-(n-i)/1e3,0)}return e}}(t))}},{key:"_computeTimeDisplay",value:function(t){if(t)return function(t){var e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=Math.floor(t%3600%60);return e>0?"".concat(e,":").concat(xn(n),":").concat(xn(i)):n>0?"".concat(n,":").concat(xn(i)):i>0?""+i:null}(this._timeRemaining||$n(t.attributes.duration))}},{key:"_getMatchingConfigState",value:function(t){var e=this;if(this._config.state){var n=this._config.state.find((function(t){return"template"===t.operator}));if(t||n){var i,o=this._config.state.find((function(n){if(!n.operator)return t&&e._getTemplateOrValue(t,n.value)==t.state;switch(n.operator){case"==":return t&&t.state==e._getTemplateOrValue(t,n.value);case"<=":return t&&t.state<=e._getTemplateOrValue(t,n.value);case"<":return t&&t.state<e._getTemplateOrValue(t,n.value);case">=":return t&&t.state>=e._getTemplateOrValue(t,n.value);case">":return t&&t.state>e._getTemplateOrValue(t,n.value);case"!=":return t&&t.state!=e._getTemplateOrValue(t,n.value);case"regex":return!(!t||!t.state.match(e._getTemplateOrValue(t,n.value)));case"template":return e._getTemplateOrValue(t,n.value);case"default":return i=n,!1;default:return!1}}));return!o&&i?i:o}}}},{key:"_localize",value:function(t,e,n){var i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;return Si(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,{numeric_precision:"card"===n?null===(i=this._config)||void 0===i?void 0:i.numeric_precision:n,show_units:o,units:r},e)}},{key:"_relativeTime",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?Gt(c||(c=B(['\n <ha-relative-time\n id="relative-time"\n class="ellipsis"\n .hass="','"\n .datetime="','"\n .capitalize="','"\n ></ha-relative-time>\n '])),this._hass,t,e):""}},{key:"_getTemplateHelpers",value:function(){var t=this;return{localize:this._localize.bind(this),formatDateTime:function(e){return wi(new Date(e),t._hass.locale,t._hass.config)},formatShortDateTimeWithYear:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,Ei(i,o.time_zone).format(n);var n,i,o},formatShortDateTime:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,ki(i,o.time_zone).format(n);var n,i,o},formatDateTimeWithSeconds:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,Fi(i,o.time_zone).format(n);var n,i,o},formatDateTimeNumeric:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,"".concat(ci(n,i,o),", ").concat(_i(n,i,o));var n,i,o},relativeTime:this._relativeTime.bind(this),formatTime:function(e){return _i(new Date(e),t._hass.locale,t._hass.config)},formatTimeWithSeconds:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,bi(i,o.time_zone).format(n);var n,i,o},formatTimeWeekday:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,Di(i,o.time_zone).format(n);var n,i,o},formatTime24h:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,Ai(i,o.time_zone).format(n);var n,i,o},formatDateWeekdayDay:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,ai(i,o.time_zone).format(n);var n,i,o},formatDate:function(e){return ui(new Date(e),t._hass.locale,t._hass.config)},formatDateNumeric:function(e){return ci(new Date(e),t._hass.locale,t._hass.config)},formatDateShort:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,di(i,o.time_zone).format(n);var n,i,o},formatDateMonthYear:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,hi(i,o.time_zone).format(n);var n,i,o},formatDateMonth:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,fi(i,o.time_zone).format(n);var n,i,o},formatDateYear:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,vi(i,o.time_zone).format(n);var n,i,o},formatDateWeekday:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,pi(i,o.time_zone).format(n);var n,i,o},formatDateWeekdayShort:function(e){return n=new Date(e),i=t._hass.locale,o=t._hass.config,mi(i,o.time_zone).format(n);var n,i,o},parseDuration:function(e,n,i){var o;return void 0===n&&(n="ms"),void 0===i&&(i=null===(o=t._hass.locale)||void 0===o?void 0:o.language),So(e,n,i)},toastMessage:function(e){return t._sendToastMessage.bind(t)({message:e})},toast:function(e){return t._sendToastMessage.bind(t)(e)},runAction:function(e){var n=t._evalActions(t._config,e);t._buildActionConfig(n)}}}},{key:"_evalTemplate",value:function(t,e){try{return new Function("states","entity","user","hass","variables","html","helpers","'use strict'; ".concat(e)).call(this,this._pStates,t,this._hass.user,this._pHass,this._pVariables,Gt,this._getTemplateHelpers())}catch(Pe){var n=e.length<=100?e.trim():"".concat(e.trim().substring(0,98),"...");throw Pe.message="".concat(Pe.name,": ").concat(Pe.message," in '").concat(n,"'"),Pe.name="ButtonCardJSTemplateError",Pe}}},{key:"_objectEvalTemplate",value:function(t,e){var n=co(e);return this._getTemplateOrValue(t,n)}},{key:"_getTemplateOrValue",value:function(t,e){var n=this;if(["number","boolean","function"].includes(it(e)))return e;if(!e)return e;if("object"===it(e))return Object.keys(e).forEach((function(i){e[i]=n._getTemplateOrValue(t,e[i])})),e;var i=e.trim(),o=new RegExp("^(\\[{3,})(.*?)(\\]{3,})$","s"),r=i.match(o);return r&&4===r.length?3===r[1].length&&3===r[3].length?this._evalTemplate(t,r[2]):r[1].length===r[3].length?i.slice(1,-1):e:e}},{key:"_getColorForLightEntity",value:function(t,e,n){var i,o,r,a,u,s,c,l=Dn;return yn.includes(l)&&(l=Bn(bn)),t&&(Tn(t)?(t.attributes.rgb_color?l="rgb(".concat(t.attributes.rgb_color.join(","),")"):e&&t.attributes.color_temp&&t.attributes.min_mireds&&t.attributes.max_mireds?(i=t.attributes.color_temp,o=t.attributes.min_mireds,r=t.attributes.max_mireds,a=new dn("rgb(255, 160, 0)"),u=new dn("rgb(166, 209, 255)"),s=new dn("white"),l=(c=(i-o)/(r-o)*100)<50?u.mix(s,2*c).toRgbString():s.mix(a,2*(c-50)).toRgbString()):l=ho(t,t.state,n)||Dn,t.attributes.brightness&&(l=function(t,e,n){var i=new dn(En(t,e));if(i.isValid){var o=i.mix("black",100-n).toString();if(o)return o}return e}(this,l,(t.attributes.brightness+245)/5))):l=ho(t,t.state,n)||Dn),l}},{key:"_buildCssColorAttribute",value:function(t,e){var n,i,o="";return(null==e?void 0:e.color)?o=e.color:this._config.color&&(o=this._config.color),_n.includes(o)&&(!t||t&&"light"!==Cn(t.entity_id))&&(o=""),_n.includes(o)?this._getColorForLightEntity(t,"auto-no-temperature"!==o,null===(n=this._config)||void 0===n?void 0:n.color_type):o||(t&&ho(t,t.state,null===(i=this._config)||void 0===i?void 0:i.color_type)||Dn)}},{key:"_buildIcon",value:function(t,e){if(this._config.show_icon){var n;if(null==e?void 0:e.icon)n=e.icon;else{if(!this._config.icon)return;n=this._config.icon}return this._getTemplateOrValue(t,n)}}},{key:"_buildEntityPicture",value:function(t,e){if(this._config.show_entity_picture&&(t||e||this._config.entity_picture)){var n;(null==e?void 0:e.entity_picture)?n=e.entity_picture:this._config.entity_picture?n=this._config.entity_picture:t&&(n=t.attributes&&t.attributes.entity_picture?t.attributes.entity_picture:void 0);var i=this._getTemplateOrValue(t,n);return i&&Nn(i)?Vn(this._hass,i).then((function(t){return t.url})).catch((function(){return""})):i}}},{key:"_buildStyleGeneric",value:function(t,e,n){var i,o,r=this,a={};if((null===(i=this._config.styles)||void 0===i?void 0:i[n])&&(a=Object.assign.apply(Object,[a].concat(H(this._config.styles[n])))),null===(o=null==e?void 0:e.styles)||void 0===o?void 0:o[n]){var u={};u=Object.assign.apply(Object,[u].concat(H(e.styles[n]))),a=Object.assign(Object.assign({},a),u)}return Object.keys(a).forEach((function(e){a[e]=r._getTemplateOrValue(t,a[e])})),a}},{key:"_buildCustomStyleGeneric",value:function(t,e,n){var i,o,r,a,u=this,s={};if((null===(o=null===(i=this._config.styles)||void 0===i?void 0:i.custom_fields)||void 0===o?void 0:o[n])&&(s=Object.assign.apply(Object,[s].concat(H(this._config.styles.custom_fields[n])))),null===(a=null===(r=null==e?void 0:e.styles)||void 0===r?void 0:r.custom_fields)||void 0===a?void 0:a[n]){var c={};c=Object.assign.apply(Object,[c].concat(H(e.styles.custom_fields[n]))),s=Object.assign(Object.assign({},s),c)}return Object.keys(s).forEach((function(e){s[e]=u._getTemplateOrValue(t,s[e])})),s}},{key:"_buildName",value:function(t,e){var n,i;if(!1!==this._config.show_name)return(null==e?void 0:e.name)?n=e.name:this._config.name?n=this._config.name:t&&(n=t.attributes&&t.attributes.friendly_name?t.attributes.friendly_name:(i=t.entity_id).substr(i.indexOf(".")+1)),this._getTemplateOrValue(t,n)}},{key:"_buildStateString",value:function(t){var e;return this._config.show_state&&t&&t.state&&("timer"===Cn(t.entity_id)?"idle"===t.state||0===this._timeRemaining?e=Si(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config):(e=this._computeTimeDisplay(t),"paused"===t.state&&(e+=" (".concat(Si(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config),")"))):e=Si(this._hass.localize,t,this._hass.locale,this._hass.config,this._hass.entities,this._config)),e}},{key:"_buildLastChanged",value:function(t,e){return this._config.show_last_changed&&t?Gt(l||(l=B(['\n <ha-relative-time\n id="label"\n class="ellipsis"\n .hass="','"\n .datetime="','"\n style=',"\n ></ha-relative-time>\n "])),this._hass,t.last_changed,$e(e)):void 0}},{key:"_buildLabel",value:function(t,e){var n;if(this._config.show_label)return n=(null==e?void 0:e.label)?e.label:this._config.label,this._getTemplateOrValue(t,n)}},{key:"_buildCustomFields",value:function(t,e){var n=this,i=Gt(d||(d=B([""]))),o={},r={};return this._config.custom_fields&&Object.keys(this._config.custom_fields).forEach((function(e){var i=n._config.custom_fields[e];i.card?i.do_not_eval?r[e]=co(i.card):r[e]=n._objectEvalTemplate(t,i.card):o[e]=n._getTemplateOrValue(t,i)})),(null==e?void 0:e.custom_fields)&&Object.keys(e.custom_fields).forEach((function(i){var a=e.custom_fields[i];a.card?a.do_not_eval?r[i]=co(a.card):r[i]=n._objectEvalTemplate(t,a.card):o[i]=n._getTemplateOrValue(t,a)})),Object.keys(o).forEach((function(r){if(null!=o[r]){var a=Object.assign(Object.assign({},n._buildCustomStyleGeneric(t,e,r)),{"grid-area":r});i=Gt(h||(h=B(["\n ","\n <div id=",' class="ellipsis" style=',">","</div>\n "])),i,r,$e(a),n._unsafeHTMLorNot(o[r]))}})),Object.keys(r).forEach((function(o){var a,u,s,c;if(null!=r[o]){var l,d=Object.assign(Object.assign({},n._buildCustomStyleGeneric(t,e,o)),{"grid-area":o});Ie(n._cardsConfig[o],r[o])?l=n._cards[o]:(null===(a=n._cardsConfig[o])||void 0===a?void 0:a.type)===(null===(u=r[o])||void 0===u?void 0:u.type)&&!0!==(null===(c=null===(s=n._config.custom_fields)||void 0===s?void 0:s[o])||void 0===c?void 0:c.force_recreate)?((l=n._cards[o]).preview=n.preview,n._cardsConfig[o]=co(r[o]),l.setConfig(r[o])):((l=n._createCard(r[o])).preview=n.preview,n._cards[o]=l,n._cardsConfig[o]=co(r[o])),l.hass=n._hass,i=Gt(f||(f=B(["\n ","\n <div\n id=","\n @action=","\n @click=","\n @touchstart=","\n @mousedown=","\n @mouseup=","\n @touchend=","\n @touchcancel=","\n style=","\n >\n ","\n </div>\n "])),i,o,n._stopPropagation,n._sendToParent,n._sendToParent,n._sendToParent,n._sendToParent,n._sendToParent,n._sendToParent,$e(d),l)}})),i}},{key:"_hasChildCards",value:function(t){return!!t&&Object.keys(t).some((function(e){return!!t[e].card}))}},{key:"_isActionDoingSomething",value:function(t,e){if(!e)return!1;if("string"==typeof e){var n=this._getTemplateOrValue(t,e);return!(!n||["none",null,void 0].includes(n.action))}if("object"===it(e)&&e.action){var i=this._getTemplateOrValue(t,e.action);return!["none",null,void 0].includes(i)}return!1}},{key:"_computeIsClickable",value:function(t,e){var n=this._isActionDoingSomething(t,this._config.tap_action),i=this._isActionDoingSomething(t,this._config.hold_action),o=this._isActionDoingSomething(t,this._config.double_tap_action),r=this._isActionDoingSomething(t,this._config.press_action),a=this._isActionDoingSomething(t,this._config.release_action),u=this._isActionDoingSomething(t,this._config.icon_tap_action),s=this._isActionDoingSomething(t,this._config.icon_hold_action),c=this._isActionDoingSomething(t,this._config.icon_double_tap_action),l=this._isActionDoingSomething(t,this._config.icon_press_action),d=this._isActionDoingSomething(t,this._config.icon_release_action),h=this._hasChildCards(this._config.custom_fields)||!(!e||!this._hasChildCards(e.custom_fields)),f=this._getTemplateOrValue(t,this._config.show_ripple),v=n||i||o||r||a;this._cardClickable=v||h,this._hasIconActions=u||s||c||l||d,this._iconClickable=this._cardClickable||this._hasIconActions,this._cardRipple=null!=f?f:v||this._hasIconActions,this._cardMomentary=r||a,this._iconMomentary=l||d}},{key:"_rotate",value:function(t){var e,n;return!!(null!==(e=this._getTemplateOrValue(this._stateObj,null==t?void 0:t.rotate))&&void 0!==e?e:this._getTemplateOrValue(this._stateObj,null===(n=this._config)||void 0===n?void 0:n.rotate))}},{key:"_blankCardColoredHtml",value:function(t){var e=Object.assign({background:"none","box-shadow":"none","border-style":"none"},t);return Gt(v||(v=B(['\n <ha-card class="disabled" style=',">\n <div></div>\n </ha-card>\n "])),$e(e))}},{key:"_cardHtml",value:function(){var t,e,n,i,o,r,a,u=this,s=this._getMatchingConfigState(this._stateObj);this._computeIsClickable(this._stateObj,s);var c,l,d,h,f,v="var(--state-inactive-color)",_=v=(null==s?void 0:s.color)&&!_n.includes(s.color)?s.color:(null===(t=this._config)||void 0===t?void 0:t.color)&&!_n.includes(this._config.color)?this._stateObj?Tn(this._stateObj)?(null===(e=this._config)||void 0===e?void 0:e.color)||v:ho(this._stateObj,this._stateObj.state,null===(n=this._config)||void 0===n?void 0:n.color_type)||Dn:this._config.color:this._buildCssColorAttribute(this._stateObj,s),y={},b={},D={},A={},w=this._buildStyleGeneric(this._stateObj,s,"lock"),C=this._buildStyleGeneric(this._stateObj,s,"spinner"),E=this._buildStyleGeneric(this._stateObj,s,"card"),k=this._buildStyleGeneric(this._stateObj,s,"tooltip"),F={"button-card-main":!0,disabled:!this._cardClickable,section:!!(null===(i=this._config)||void 0===i?void 0:i.section_mode)};switch((null===(o=this._config)||void 0===o?void 0:o.section_mode)&&this.classList.add("section"),E.width&&(this.style.setProperty("flex","0 0 auto"),this.style.setProperty("max-width","fit-content")),this._config.color_type){case"blank-card":return this._blankCardColoredHtml(E);case"card":case"label-card":var O=(c=new dn(En(this,v)).getLuminance(),l=new dn({r:225,g:225,b:225}),d=l.getLuminance(),h=new dn({r:28,g:28,b:28}),f=h.getLuminance(),0===c||(Math.max(c,d)+.05)/Math.min(c,d+.05)>(Math.max(c,f)+.05)/Math.min(c,f+.05)?l.toRgbString():h.toRgbString());y.color=O,b.color=O,y["background-color"]=v,y=Object.assign(Object.assign({},y),E),_="inherit",this.style.setProperty("--button-card-color",O);break;default:y=E,this.style.setProperty("--button-card-color",_)}this._config.aspect_ratio?(A["--aspect-ratio"]=this._config.aspect_ratio,y.position="absolute"):A.display="inline",this.style.setProperty("--button-card-light-color",this._getColorForLightEntity(this._stateObj,!0)),this.style.setProperty("--button-card-light-color-no-temperature",this._getColorForLightEntity(this._stateObj,!1)),this.style.setProperty("--button-card-ripple-color",_),b=Object.assign(Object.assign({},b),w),D=Object.assign(Object.assign({},D),C);var j="";null===(r=this._extraStyles)||void 0===r||r.forEach((function(t){var e=u._getTemplateOrValue(u._stateObj,t);j+=e?e.trim()+"\n":""}));var S=(j=j.trim())?Gt(p||(p=B(["\n <style>\n ","\n </style>\n "])),j):Gt(m||(m=B([""]))),T=this._partialActionEval(this._config.hold_action);return Gt(g||(g=B(["\n ",'\n <div id="aspect-ratio" style=','>\n <ha-card\n id="card"\n class=',"\n style=","\n @wa-show=","\n @action=","\n .actionHandler=",'\n .config="','"\n >\n ',"\n <ha-ripple .disabled=","></ha-ripple>\n </ha-card>\n "," ","\n ","\n </div>\n "])),S,$e(A),Pe(F),$e(y),this._tooltipShow,(function(t){return u._handleAction(t,{isIcon:!1})}),ze({hasDoubleClick:this._isActionDoingSomething(this._stateObj,this._config.double_tap_action),hasHold:this._isActionDoingSomething(this._stateObj,this._config.hold_action),repeat:null==T?void 0:T.repeat,repeatLimit:null==T?void 0:T.repeat_limit,isMomentary:this._cardMomentary,disableKbd:null===(a=this._config)||void 0===a?void 0:a.disable_kbd}),this._config,this._buttonContent(this._stateObj,s,_),!this._cardRipple,this._getLock(b),this._getSpinner(D,s),this._getTooltip(k,s))}},{key:"_getTooltip",value:function(t,e){var n,i,o,r,a,u,s;u="string"==typeof this._config.tooltip?{content:this._getTemplateOrValue(this._stateObj,this._config.tooltip)}:null!==(n=this._objectEvalTemplate(this._stateObj,this._config.tooltip))&&void 0!==n?n:{},s="string"==typeof(null==e?void 0:e.tooltip)?{content:this._getTemplateOrValue(this._stateObj,null==e?void 0:e.tooltip)}:null!==(i=this._objectEvalTemplate(this._stateObj,null==e?void 0:e.tooltip))&&void 0!==i?i:{};var c=Object.assign(Object.assign({},u),s);if(c&&c.content){var l=So(String(null!==(o=null==c?void 0:c.delay)&&void 0!==o?o:"150"),"ms","en"),d=So(String(null!==(a=null!==(r=null==c?void 0:c.hide_delay)&&void 0!==r?r:null==c?void 0:c.delay)&&void 0!==a?a:"150"),"ms","en"),h=!(null==c?void 0:c.arrow)||void 0;return Gt(_||(_=B(['\n <wa-tooltip\n id="tooltip"\n for="card"\n @wa-show=',"\n placement=","\n distance=","\n skidding=","\n show-delay=","\n hide-delay=","\n without-arrow=","\n style=",'\n >\n <span class="tooltip">',"</span>\n </wa-tooltip>\n "])),this._tooltipShow,fe(c.placement||void 0),fe(c.distance||void 0),fe(c.skidding||void 0),l,d,h||Wt,$e(t),this._unsafeHTMLorNot(c.content))}return Gt(y||(y=B([""])))}},{key:"_getSpinner",value:function(t,e){var n=this._getTemplateOrValue(this._stateObj,null==e?void 0:e.spinner)||this._getTemplateOrValue(this._stateObj,this._config.spinner);return this._spinnerActive||n?Gt(b||(b=B(['\n <div id="spinner" style=','>\n <div id="spinner-background"></div>\n <ha-spinner></ha-spinner>\n </div>\n '])),$e(t)):Gt(D||(D=B([""])))}},{key:"_getLock",value:function(t){var e;return this._config.lock&&this._getTemplateOrValue(this._stateObj,this._config.lock.enabled)?Gt(A||(A=B(['\n <div\n id="overlay"\n style=',"\n @action=","\n .actionHandler=",'\n .config="','"\n >\n <ha-icon id="lock" icon=',"></ha-icon>\n </div>\n "])),$e(t),this._handleUnlockType,ze({hasDoubleClick:"double_tap"===this._config.lock.unlock,hasHold:"hold"===this._config.lock.unlock,disableKbd:null===(e=this._config)||void 0===e?void 0:e.disable_kbd}),this._config,this._config.lock.lock_icon):Gt(w||(w=B([""])))}},{key:"_buttonContent",value:function(t,e,n){var i=this._buildName(t,e),o=(null==e?void 0:e.state_display)||this._config.state_display||void 0,r=this._config.show_state&&o?this._getTemplateOrValue(t,o):void 0,a=void 0!==r?r:this._buildStateString(t),u=function(t,e){if(t||e)return e?t?"".concat(t,": ").concat(e):e:t}(i,a);switch(this._config.layout){case"icon_name_state":case"name_state":return this._gridHtml(t,e,this._config.layout,n,u,void 0);default:return this._gridHtml(t,e,this._config.layout,n,i,a)}}},{key:"_unsafeHTMLorNot",value:function(t){return t.strings||t.values?t:Me("".concat(t))}},{key:"_gridHtml",value:function(t,e,n,i,o,r){var a=this._getIconHtml(t,e,i),u=[n],s=this._buildLabel(t,e),c=this._buildStyleGeneric(t,e,"name"),l=this._buildStyleGeneric(t,e,"state"),d=this._buildStyleGeneric(t,e,"label"),h=this._buildLastChanged(t,d),f=this._buildStyleGeneric(t,e,"grid");return a||u.push("no-icon"),o||u.push("no-name"),r||u.push("no-state"),s||h||u.push("no-label"),Gt(C||(C=B(['\n <div id="container" class='," style=",">\n ","\n ","\n ","\n ","\n "," ","\n </div>\n "])),u.join(" "),$e(f),a||"",o?Gt(E||(E=B(['\n <div id="name" class="ellipsis" style=',">\n ","\n </div>\n "])),$e(c),this._unsafeHTMLorNot(o)):"",r?Gt(k||(k=B(['\n <div id="state" class="ellipsis" style=',">\n ","\n </div>\n "])),$e(l),this._unsafeHTMLorNot(r)):"",s&&!h?Gt(F||(F=B(['\n <div id="label" class="ellipsis" style=',">\n ","\n </div>\n "])),$e(d),this._unsafeHTMLorNot(s)):"",h||"",this._buildCustomFields(t,e))}},{key:"_getIconHtml",value:function(t,e,n){var i,o,r=this,a=this._buildIcon(t,e),u=this._buildEntityPicture(t,e),s=this._buildStyleGeneric(t,e,"entity_picture"),c=this._buildStyleGeneric(t,e,"icon"),l=this._buildStyleGeneric(t,e,"img_cell"),d=this._buildStyleGeneric(t,e,"card"),h=Object.assign({color:n,width:this._config.size,"--ha-icon-display":d.height?"inline":void 0,position:this._config.aspect_ratio||d.height?"absolute":"relative"},c),f=Object.assign(Object.assign({},h),s),v={enabled:this._iconClickable},p=this._buildLiveStream(f),m=this._config.show_icon&&(a||t);if(m||u){var g=void 0;t&&(g=Cn(t.entity_id));var _=this._partialActionEval(this._config.icon_hold_action);return Gt(O||(O=B(['\n <div id="img-cell" style=',">\n ","\n ","\n ","\n </div>\n "])),$e(l),!m||u||p?"":Gt(j||(j=B(["\n <ha-state-icon\n class=","\n .state=","\n .stateObj=","\n .hass=","\n ?data-domain=","\n data-state=","\n style=",'\n .icon="','"\n id="icon"\n ?rotating=',"\n @action=","\n @pointerenter=","\n @pointerleave=","\n @click=","\n @touchstart=","\n @mousedown=","\n @mouseup=","\n @touchend=","\n @touchcancel=","\n .actionHandler=","\n ></ha-state-icon>\n "])),Pe(v),t,t,this._hass,g,fe(null==t?void 0:t.state),$e(h),a,this._rotate(e),this._hasIconActions?function(t){return r._handleAction(t,{isIcon:!0})}:void 0,this._hasIconActions?this._handleRippleIcon:void 0,this._hasIconActions?this._handleRippleIcon:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?ze({hasDoubleClick:this._isActionDoingSomething(t,this._config.icon_double_tap_action),hasHold:this._isActionDoingSomething(t,this._config.icon_hold_action),repeat:null==_?void 0:_.repeat,repeatLimit:null==_?void 0:_.repeat_limit,isMomentary:this._iconMomentary,disableKbd:null===(i=this._config)||void 0===i?void 0:i.disable_kbd}):void 0),p||"",u&&!p?Gt(S||(S=B(["\n <img\n class=","\n src=","\n style=",'\n id="icon"\n ?rotating=','\n draggable="false"\n @action=',"\n @pointerenter=","\n @pointerleave=","\n @click=","\n @touchstart=","\n @mousedown=","\n @mouseup=","\n @touchend=","\n @touchcancel=","\n .actionHandler=","\n />\n "])),Pe(v),Se(u),$e(f),this._rotate(e),this._hasIconActions?function(t){return r._handleAction(t,{isIcon:!0})}:void 0,this._hasIconActions?this._handleRippleIcon:void 0,this._hasIconActions?this._handleRippleIcon:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?this._sendToParent:void 0,this._hasIconActions?ze({hasDoubleClick:this._isActionDoingSomething(t,this._config.icon_double_tap_action),hasHold:this._isActionDoingSomething(t,this._config.icon_hold_action),repeat:null==_?void 0:_.repeat,repeatLimit:null==_?void 0:_.repeat_limit,isMomentary:this._iconMomentary,disableKbd:null===(o=this._config)||void 0===o?void 0:o.disable_kbd}):void 0):"")}}},{key:"_buildLiveStream",value:function(t){return this._config.show_live_stream&&this._config.entity&&"camera"===Cn(this._config.entity)?Gt(T||(T=B(["\n <hui-image\n .hass=","\n .cameraImage=","\n .entity=","\n .cameraView=","\n .aspectRatio=","\n .fitMode=","\n style=","\n ></hui-image>\n "])),this._hass,this._config.entity,this._config.entity,"live",this._config.live_stream_aspect_ratio,this._config.live_stream_fit_mode,$e(t)):void 0}},{key:"_configFromLLTemplates",value:function(t,e){var n,i=this,o=e.template,r={};if(o){var a,u=o&&Array.isArray(o)?o:[o];null==u||u.forEach((function(e){var n;if(!(null===(n=t.config.button_card_templates)||void 0===n?void 0:n[e]))throw new Error("Button-card template '".concat(e,"' is missing!"));var o=i._configFromLLTemplates(t,t.config.button_card_templates[e]);r=kn(r,o),a=Fn(a,o.state)})),(r=kn(r,e)).state=Fn(a,e.state)}else r=co(e);return r.extra_styles&&(null===(n=this._extraStyles)||void 0===n||n.push(r.extra_styles),delete r.extra_styles),r}},{key:"setConfig",value:function(t){if(!t)throw new Error("Invalid configuration");this._initialSetupComplete&&(this._initialSetupComplete=!1),this._cards={},this._cardsConfig={},this._extraStyles=[];var e=jn()||On(),n=co(t);n=this._configFromLLTemplates(e,n),this._config=Object.assign(Object.assign({type:"custom:button-card",group_expand:!1,hold_action:{action:"none"},double_tap_action:{action:"none"},press_action:{action:"none"},release_action:{action:"none"},icon_tap_action:{action:"none"},icon_hold_action:{action:"none"},icon_double_tap_action:{action:"none"},icon_press_action:{action:"none"},icon_release_action:{action:"none"},layout:"vertical",size:"40%",color_type:"icon",show_name:!0,show_state:!1,show_icon:!0,show_units:!0,show_label:!1,show_entity_picture:!1,show_live_stream:!1,card_size:3},n),{lock:Object.assign({enabled:!1,duration:5,unlock:"tap",lock_icon:"mdi:lock-outline",unlock_icon:"mdi:lock-open-outline"},n.lock)}),this._initialSetupComplete||this._finishSetup()}},{key:"_loopGroup",value:function(t){var e=this;t&&t.forEach((function(t){var n,i;(null===(n=e._hass)||void 0===n?void 0:n.states[t])&&((null===(i=e._hass.states[t].attributes)||void 0===i?void 0:i.entity_id)?e._loopGroup(e._hass.states[t].attributes.entity_id):e._monitoredEntities.includes(t)||e._monitoredEntities.push(t))}))}},{key:"_expandTriggerGroups",value:function(){var t,e=this;this._hass&&(null===(t=this._config)||void 0===t?void 0:t.group_expand)&&this._monitoredEntities&&this._monitoredEntities.forEach((function(t){var n,i,o,r,a;(null===(o=null===(i=null===(n=e._hass)||void 0===n?void 0:n.states[t])||void 0===i?void 0:i.attributes)||void 0===o?void 0:o.entity_id)&&e._loopGroup(null===(a=null===(r=e._hass)||void 0===r?void 0:r.states[t].attributes)||void 0===a?void 0:a.entity_id)}))}},{key:"_updateTimerStart",value:function(){this._updateTimerMS=Date.now(),this._updateTimer()}},{key:"_updateTimerCancel",value:function(){this._updateTimeout&&window.clearTimeout(this._updateTimeout)}},{key:"_updateTimerChanged",value:function(){var t;if(null===(t=this._config)||void 0===t?void 0:t.update_timer){var e=this._getTemplateOrValue(this._stateObj,this._config.update_timer),n=So(e,"ms","en");if(n&&n>=100&&n!==this._updateTimerDuration)return!0}return!1}},{key:"_updateTimer",value:function(){var t,e=this;if(this._updateTimeout&&(window.clearTimeout(this._updateTimeout),this._updateTimeout=void 0),null===(t=this._config)||void 0===t?void 0:t.update_timer){var n=this._getTemplateOrValue(this._stateObj,this._config.update_timer),i=So(n,"ms","en");i&&i>=100&&(this._updateTimerDuration=i,this._updateTimeout=window.setTimeout((function(){e._updateRefresh()}),i))}}},{key:"_updateRefresh",value:function(){this._updateTimerMS=Date.now(),this._updateTimeout=void 0}},{key:"getCardSize",value:function(){var t;return(null===(t=this._config)||void 0===t?void 0:t.card_size)||3}},{key:"getGridOptions",value:function(){var t;if(null===(t=this._config)||void 0===t?void 0:t.section_mode)return{rows:2,columns:6,min_rows:1,min_columns:1}}},{key:"_partialActionEval",value:function(t){var e=this;if(!t)return{action:"none"};if("string"==typeof t)return this._objectEvalTemplate(this._stateObj,t);var n=co(t);return["action","repeat","repeat_limit"].forEach((function(t){n[t]=e._getTemplateOrValue(e._stateObj,n[t])})),n}},{key:"_evalActions",value:function(t,e){var n,i;i="string"==typeof e?this._objectEvalTemplate(this._stateObj,e):co(e);var o=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.action);if("none"===o||!o){var r={};return r[wn]={action:"none"},r}var a=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.repeat),u=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.repeat_limit),s=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.sound),c=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.confirmation);!c&&t.confirmation&&(c=this._objectEvalTemplate(this._stateObj,t.confirmation));var l=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.haptic),d=Object.assign(Object.assign({},this._objectEvalTemplate(this._stateObj,t.protect)),this._objectEvalTemplate(this._stateObj,null==i?void 0:i.protect)),h={};switch(o){case"javascript":h[wn]={action:"fire-dom-event",buttonCardCustomAction:{callback:this._customActionsCallback.bind(this),type:"javascript",data:{javascript:null==i?void 0:i.javascript}}};break;case"multi-actions":h[wn]={action:"fire-dom-event",buttonCardCustomAction:{callback:this._customActionsCallback.bind(this),type:"multi-actions",data:{multiActions:null==i?void 0:i.actions}}};break;case"toast":h[wn]={action:"fire-dom-event",buttonCardCustomAction:{callback:this._customActionsCallback.bind(this),type:"toast",data:{toast:null==i?void 0:i.toast}}};break;case"toggle":h.entity=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.entity)||this._getTemplateOrValue(this._stateObj,t.entity),h[wn]={action:"toggle"};break;case"more-info":h.entity=this._getTemplateOrValue(this._stateObj,null==i?void 0:i.entity)||this._getTemplateOrValue(this._stateObj,t.entity),h[wn]={action:"more-info"};break;case"navigate":h[wn]={action:"navigate",navigation_path:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.navigation_path),navigation_replace:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.navigation_replace)};break;case"url":h[wn]={action:"url",url_path:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.url_path)};break;case"perform-action":case"call-service":h[wn]={action:"perform-action",perform_action:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.perform_action)||this._getTemplateOrValue(this._stateObj,null==i?void 0:i.service),data:this._objectEvalTemplate(this._stateObj,null==i?void 0:i.data)||this._objectEvalTemplate(this._stateObj,null==i?void 0:i.service_data),target:this._objectEvalTemplate(this._stateObj,null==i?void 0:i.target)},"entity"===(null===(n=h[wn].data)||void 0===n?void 0:n.entity_id)&&(h[wn].data.entity_id=this._getTemplateOrValue(this._stateObj,t.entity));break;case"assist":h[wn]={action:"assist",pipeline_id:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.pipeline_id),start_listening:this._getTemplateOrValue(this._stateObj,null==i?void 0:i.start_listening)};break;case"fire-dom-event":h[wn]=Object.assign({action:"fire-dom-event"},this._objectEvalTemplate(this._stateObj,i));break;default:return x({},wn,{action:"none"})}return h[wn]=Object.assign(Object.assign({},h[wn]),{repeat:a,repeat_limit:u,sound:s,haptic:l,confirmation:c,protect:d}),d&&(d.password||d.pin)&&(this._protectedAction=co(h)),h}},{key:"_handleRippleIcon",value:function(t){this._ripple.then((function(e){var n,i;if(e)if("pointerenter"===t.type){var o=null!==(i=null===(n=t.target)||void 0===n?void 0:n.getBoundingClientRect())&&void 0!==i?i:null,r=e.getBoundingClientRect(),a={top:0,left:0,bottom:0,right:0},u=t.target?getComputedStyle(t.target):null,s=u?parseInt(u.getPropertyValue("--button-card-ripple-icon-inset-padding")):12,c="";o&&r&&(a.top=o.top-r.top-s,a.top=a.top<0?0:a.top,a.left=o.left-r.left-s,a.left=a.left<0?0:a.left,a.bottom=r.bottom-o.bottom-s,a.bottom=a.bottom<0?0:a.bottom,a.right=r.right-o.right-s,a.right=a.right<0?0:a.right,c="".concat(a.top,"px ").concat(a.right,"px ").concat(a.bottom,"px ").concat(a.left,"px")),e.setAttribute("icon",""),""!=c&&e.style.setProperty("--dynamic-ripple-icon-inset",c)}else"pointerleave"===t.type&&(e.removeAttribute("icon"),e.style.removeProperty("--dynamic-ripple-icon-inset"))}))}},{key:"_hapticInterceptHandler",value:function(t){this._hapticCapture&&t.stopPropagation&&("failure"!==t.detail&&t.stopPropagation())}},{key:"_handleAction",value:function(t,e){var n;if(e.isIcon&&this._hasIconActions&&t.stopPropagation&&t.stopPropagation(),null===(n=t.detail)||void 0===n?void 0:n.action){var i=this._config;if(!i)return;var o=t.detail.action,r=e.isIcon?"icon_".concat(o,"_action"):"".concat(o,"_action");if(this._isActionDoingSomething(this._stateObj,i[r])){var a=this._evalActions(i,i[r]);this._buildActionConfig(a)}}}},{key:"_buildActionConfig",value:function(t){var e,n,i,o,r=this;t&&((null===(n=null===(e=t[wn])||void 0===e?void 0:e.protect)||void 0===n?void 0:n.pin)?window.cardHelpers.showEnterCodeDialog(this,{submit:function(t){return r._protectedConfirmedCallback.bind(r)(t,"pin")},cancel:this._cancelledCallback.bind(this),codeFormat:"number"}):(null===(o=null===(i=t[wn])||void 0===i?void 0:i.protect)||void 0===o?void 0:o.password)?window.cardHelpers.showPromptDialog(this,{title:"Password",inputLabel:"Password",inputType:"password",confirm:function(t){return r._protectedConfirmedCallback.bind(r)(t,"password")},cancel:this._cancelledCallback.bind(this)}):this._executeAction(t))}},{key:"_executeAction",value:function(t){var e,n,i=null===(e=t[wn])||void 0===e?void 0:e.sound;i&&(Nn(i)?Vn(this._hass,i).then((function(t){new Audio(t.url).play()})).catch((function(){console.error("button-card: Error loading media source: ".concat(i))})):new Audio(i).play());var o=null===(n=t[wn])||void 0===n?void 0:n.haptic;this._hapticCapture=void 0!==o,po(this,this._hass,t,"tap"),this._hapticCapture=!1,o&&"none"!=o&&He(this,"haptic",o)}},{key:"_customActionsCallback",value:(n=z(R().m((function t(e){var n,i,o,r,a,u,s,c,l,d,h,f,v,p,m,g,_,y,b,D,A,w,C,E;return R().w((function(t){for(;;)switch(t.p=t.n){case 0:if(e.detail&&e.detail.buttonCardCustomAction){t.n=1;break}return t.a(2);case 1:d=e.detail.buttonCardCustomAction,C=d.type,t.n="javascript"===C?2:"multi-actions"===C?3:"toast"===C?19:20;break;case 2:return this._getTemplateOrValue(this._stateObj,null===(n=d.data)||void 0===n?void 0:n.javascript),t.a(3,20);case 3:if("string"==typeof(h=null===(i=d.data)||void 0===i?void 0:i.multiActions)&&(h=this._objectEvalTemplate(this._stateObj,h)),f=function(t){return new Promise((function(e){return setTimeout(e,t)}))},!Array.isArray(h)){t.n=18;break}this._spinnerActive=h.some((function(t){return"string"!=typeof t&&((null==t?void 0:t.delay)||(null==t?void 0:t.wait_completion))})),v=K(h),t.p=4,v.s();case 5:if((p=v.n()).done){t.n=14;break}if("string"==typeof(m=p.value)||!(null==m?void 0:m.delay)){t.n=7;break}if(g=this._getTemplateOrValue(this._stateObj,m.delay),!(g=So(g||"","ms","en"))){t.n=6;break}return t.n=6,f(g);case 6:t.n=13;break;case 7:if("string"==typeof m||!(null==m?void 0:m.wait_completion)){t.n=12;break}return _=m,t.n=8,f(500);case 8:y=this._getTemplateOrValue(this._stateObj,_.timeout),b=0,D=So(y||"","ms","en")||0;case 9:if(!(b<D||0===D)||this._getTemplateOrValue(this._stateObj,_.wait_completion)){t.n=11;break}return t.n=10,f(500);case 10:b+=500,t.n=9;break;case 11:t.n=13;break;case 12:A=this._evalActions(this._config,m),null===(o=A[wn])||void 0===o||delete o.repeat,null===(r=A[wn])||void 0===r||delete r.repeat_limit,null===(a=A[wn])||void 0===a||delete a.sound,null===(u=A[wn])||void 0===u||delete u.haptic,null===(s=A[wn])||void 0===s||delete s.confirmation,null===(c=A[wn])||void 0===c||delete c.protect,this._executeAction(A);case 13:t.n=5;break;case 14:t.n=16;break;case 15:t.p=15,E=t.v,v.e(E);case 16:return t.p=16,v.f(),t.f(16);case 17:this._spinnerActive=!1;case 18:return t.a(3,20);case 19:return w=null===(l=d.data)||void 0===l?void 0:l.toast,w=this._objectEvalTemplate(this._stateObj,w),this._sendToastMessage(w),t.a(3,20);case 20:return t.a(2)}}),t,this,[[4,15,16,17]])}))),function(t){return n.apply(this,arguments)})},{key:"_protectedConfirmedCallback",value:function(t,e){var n,i,o,r,a,u,s;if(this._protectedAction&&this._config)if(t===(null===(i=null===(n=this._protectedAction[wn])||void 0===n?void 0:n.protect)||void 0===i?void 0:i[e]))this._sendToastMessage({message:null===(r=null===(o=this._protectedAction[wn])||void 0===o?void 0:o.protect)||void 0===r?void 0:r.success_message}),null===(a=this._protectedAction[wn])||void 0===a||delete a.protect,this._executeAction(this._protectedAction);else{var c=null===(s=null===(u=this._protectedAction[wn])||void 0===u?void 0:u.protect)||void 0===s?void 0:s.failure_message;this._sendToastMessage({message:c||An[e]})}this._protectedAction=void 0}},{key:"_cancelledCallback",value:function(){this._protectedAction=void 0}},{key:"_sendToastMessage",value:function(t){void 0!==(null==t?void 0:t.message)&&this.dispatchEvent(new CustomEvent("hass-notification",{bubbles:!0,composed:!0,detail:Object.assign({},t)}))}},{key:"_handleUnlockType",value:function(t){var e=this._config;e&&e.lock.unlock===t.detail.action&&this._handleLock()}},{key:"_handleLock",value:function(){var t,e,n,i=this,o=this.shadowRoot.getElementById("lock");if(o){if(this._config.lock.exemptions){if(!(null===(t=this._hass.user)||void 0===t?void 0:t.name)||!this._hass.user.id)return;var r=!1;if(this._config.lock.exemptions.forEach((function(t){var e,n;(!r&&t.user===(null===(e=i._hass.user)||void 0===e?void 0:e.id)||t.username===(null===(n=i._hass.user)||void 0===n?void 0:n.name))&&(r=!0)})),!r)return o.classList.add("invalid"),void window.setTimeout((function(){o&&o.classList.remove("invalid")}),3e3)}var a=this.shadowRoot.getElementById("overlay");a.style.setProperty("pointer-events","none"),o&&(o.icon=this._config.lock.unlock_icon,(null===(n=null===(e=this._config)||void 0===e?void 0:e.lock)||void 0===n?void 0:n.keep_unlock_icon)||o.classList.add("hidden")),window.setTimeout((function(){var t,e;a.style.setProperty("pointer-events",""),o&&((null===(e=null===(t=i._config)||void 0===t?void 0:t.lock)||void 0===e?void 0:e.keep_unlock_icon)||o.classList.remove("hidden"),o.icon=i._config.lock.lock_icon)}),1e3*this._config.lock.duration)}}},{key:"_stopPropagation",value:function(t){t.stopPropagation()}},{key:"_sendToParent",value:function(t){var e,n,i,o=(null===(e=t.type)||void 0===e?void 0:e.startsWith("touch"))?new TouchEvent(t.type,t):(null===(n=t.type)||void 0===n?void 0:n.startsWith("mouse"))?new MouseEvent(t.type,t):new CustomEvent(t.type,t);t.stopPropagation(),null===(i=this.parentElement)||void 0===i||i.dispatchEvent(o);var r=new CustomEvent(t.type,Object.assign(Object.assign({},t),{bubbles:!1,composed:!1,detail:{ignore:!0}}));this._ripple.then((function(t){var e;t&&(null===(e=t.parentElement)||void 0===e||e.dispatchEvent(r))}))}},{key:"_tooltipShow",value:function(t){var e,n,i,o;if(t.stopPropagation(),(null===(e=t.detail)||void 0===e?void 0:e.card)&&t.detail.card!==this){var r=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector("#tooltip");if(r){var a=null!==(i=r.hideDelay)&&void 0!==i?i:400;window.setTimeout((function(){var t;null===(t=r.hide)||void 0===t||t.call(r)}),a)}}else{var u=new CustomEvent(t.type,Object.assign(Object.assign({},t),{bubbles:!0,composed:!0,detail:{card:this}}));null===(o=this.parentElement)||void 0===o||o.dispatchEvent(u)}}}],[{key:"getStubConfig",value:function(t,e,n){var i=zn(t,1,e,n,["light","switch"]);return Sn()?{entity:i[0]||"",section_mode:!0,grid_options:{rows:2,columns:6}}:{entity:i[0]||"",section_mode:!1}}},{key:"styles",get:function(){return Gn}}]);var n}();ot([he()],$o.prototype,"_hass",void 0),ot([he()],$o.prototype,"_config",void 0),ot([he()],$o.prototype,"_timeRemaining",void 0),ot([he()],$o.prototype,"_updateTimerMS",void 0),ot([he({type:Boolean,reflect:!0})],$o.prototype,"preview",void 0),ot([he({type:Boolean})],$o.prototype,"_spinnerActive",void 0),ot([
|
||
/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*/
|
||
function(t){return function(e,n){return function(t,e,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=it(e)&&Object.defineProperty(t,e,n),n}(e,n,{get:function(){var e=this;return z(R().m((function n(){var i,o;return R().w((function(n){for(;;)switch(n.n){case 0:return n.n=1,e.updateComplete;case 1:return n.a(2,null!==(i=null===(o=e.renderRoot)||void 0===o?void 0:o.querySelector(t))&&void 0!==i?i:null)}}),n)})))()}})}}("ha-ripple")],$o.prototype,"_ripple",void 0),$o=ot([function(t){return function(e,n){void 0!==n?n.addInitializer((function(){customElements.define(t,e)})):customElements.define(t,e)}}("button-card")],$o);
|