-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathauto-entities.js
1 lines (1 loc) · 81.8 KB
/
auto-entities.js
1
var t,e,n,r,i,a,o,s,u,c,l,d,f,h,v,p,y,g,b,_;function m(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){x(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function x(t,e,n){return(e=B(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function E(t,e,n,r){var i=O(R(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function O(){return O="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=R(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},O.apply(null,arguments)}function $(t){return function(t){if(Array.isArray(t))return H(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||D(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 A(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 r,i,a,o,s=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(t,e)||D(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 S(){S=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var a=e&&e.prototype instanceof g?e:g,o=Object.create(a.prototype),s=new P(r||[]);return i(o,"_invoke",{value:$(t,n,s)}),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f="suspendedStart",h="suspendedYield",v="executing",p="completed",y={};function g(){}function b(){}function _(){}var m={};c(m,o,(function(){return this}));var w=Object.getPrototypeOf,k=w&&w(w(T([])));k&&k!==n&&r.call(k,o)&&(m=k);var x=_.prototype=g.prototype=Object.create(m);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(i,a,o,s){var u=d(t[i],t,a);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==z(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(l).then((function(t){c.value=t,o(c)}),(function(t){return n("throw",t,o,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return a=a?a.then(i,i):i()}})}function $(e,n,r){var i=f;return function(a,o){if(i===v)throw Error("Generator is already running");if(i===p){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=A(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=v;var c=d(e,n,r);if("normal"===c.type){if(i=r.done?p:h,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=p,r.method="throw",r.arg=c.arg)}}}function A(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,A(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=d(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,y;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function T(e){if(e||""===e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(z(e)+" is not iterable")}return b.prototype=_,i(x,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:b,configurable:!0}),b.displayName=c(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,c(t,u,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},E(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new O(l(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},E(x),c(x,u,"Generator"),c(x,o,(function(){return this})),c(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=T,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function j(t,e,n,r,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function C(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){j(a,r,i,o,s,"next",t)}function s(t){j(a,r,i,o,s,"throw",t)}o(void 0)}))}}function P(t,e,n){return e=R(e),function(t,e){if(e&&("object"==z(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return T(t)}(t,M()?Reflect.construct(e,n||[],R(t).constructor):e.apply(t,n))}function T(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function U(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&&L(t,e)}function N(t){var e="function"==typeof Map?new Map:void 0;return N=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){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(M())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&L(i,n.prototype),i}(t,arguments,R(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),L(n,t)},N(t)}function M(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(M=function(){return!!t})()}function L(t,e){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},L(t,e)}function R(t){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},R(t)}function I(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=D(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function D(t,e){if(t){if("string"==typeof t)return H(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)?H(t,e):void 0}}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function F(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function G(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,B(r.key),r)}}function W(t,e,n){return e&&G(t.prototype,e),n&&G(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function B(t){var e=function(t,e){if("object"!=z(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==z(e)?e:e+""}function z(t){return z="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},z(t)}function q(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===("undefined"==typeof Reflect?"undefined":z(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,n,o):i(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o}"function"==typeof SuppressedError&&SuppressedError;var V=globalThis,J=V.ShadowRoot&&(void 0===V.ShadyCSS||V.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Y=Symbol(),K=new WeakMap,Z=function(){return W((function t(e,n,r){if(F(this,t),this._$cssResult$=!0,r!==Y)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(J&&void 0===t){var n=void 0!==e&&1===e.length;n&&(t=K.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&K.set(e,t))}return t}},{key:"toString",value:function(){return this.cssText}}])}(),Q=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=1===t.length?t[0]:n.reduce((function(e,n,r){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[r+1]}),t[0]);return new Z(i,t,Y)},X=J?function(t){return t}:function(t){return t instanceof CSSStyleSheet?function(t){var e,n="",r=I(t.cssRules);try{for(r.s();!(e=r.n()).done;){n+=e.value.cssText}}catch(t){r.e(t)}finally{r.f()}return function(t){return new Z("string"==typeof t?t:t+"",void 0,Y)}(n)}(t):t},tt=Object.is,et=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,rt=Object.getOwnPropertyNames,it=Object.getOwnPropertySymbols,at=Object.getPrototypeOf,ot=globalThis,st=ot.trustedTypes,ut=st?st.emptyScript:"",ct=ot.reactiveElementPolyfillSupport,lt=function(t,e){return t},dt={toAttribute:function(t,e){switch(e){case Boolean:t=t?ut: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}},ft=function(t,e){return!tt(t,e)},ht={attribute:!0,type:String,converter:dt,reflect:!1,hasChanged:ft};null!==(t=Symbol.metadata)&&void 0!==t||(Symbol.metadata=Symbol("metadata")),null!==(e=ot.litPropertyMetadata)&&void 0!==e||(ot.litPropertyMetadata=new WeakMap);var vt=function(){function t(){var e;return F(this,t),(e=P(this,t))._$Ep=void 0,e.isUpdatePending=!1,e.hasUpdated=!1,e._$Em=null,e._$Ev(),e}return U(t,N(HTMLElement)),W(t,[{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=I(this.constructor.elementProperties.keys());try{for(n.s();!(t=n.n()).done;){var r=t.value;this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r])}}catch(t){n.e(t)}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(J)t.adoptedStyleSheets=e.map((function(t){return t instanceof CSSStyleSheet?t:t.styleSheet}));else{var n,r=I(e);try{for(r.s();!(n=r.n()).done;){var i=n.value,a=document.createElement("style"),o=V.litNonce;void 0!==o&&a.setAttribute("nonce",o),a.textContent=i.cssText,t.appendChild(a)}}catch(t){r.e(t)}finally{r.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:"_$EC",value:function(t,e){var n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(void 0!==r&&!0===n.reflect){var i,a=(void 0!==(null===(i=n.converter)||void 0===i?void 0:i.toAttribute)?n.converter:dt).toAttribute(e,n.type);this._$Em=t,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}},{key:"_$AK",value:function(t,e){var n=this.constructor,r=n._$Eh.get(t);if(void 0!==r&&this._$Em!==r){var i,a=n.getPropertyOptions(r),o="function"==typeof a.converter?{fromAttribute:a.converter}:void 0!==(null===(i=a.converter)||void 0===i?void 0:i.fromAttribute)?a.converter:dt;this._$Em=r,this[r]=o.fromAttribute(e,a.type),this._$Em=null}}},{key:"requestUpdate",value:function(t,e,n){if(void 0!==t){var r;if(null!=n||(n=this.constructor.getPropertyOptions(t)),!(null!==(r=n.hasChanged)&&void 0!==r?r:ft)(this[t],e))return;this.P(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}},{key:"P",value:function(t,e,n){var r;this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$Em!==t&&(null!==(r=this._$Ej)&&void 0!==r?r:this._$Ej=new Set).add(t)}},{key:"_$ET",value:(e=C(S().mark((function t(){var e;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.isUpdatePending=!0,t.prev=1,t.next=4,this._$ES;case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),Promise.reject(t.t0);case 9:if(e=this.scheduleUpdate(),t.t1=null!=e,!t.t1){t.next=14;break}return t.next=14,e;case 14:return t.abrupt("return",!this.isUpdatePending);case 15:case"end":return t.stop()}}),t,this,[[1,6]])}))),function(){return e.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=I(this._$Ep);try{for(n.s();!(e=n.n()).done;){var r=A(e.value,2),i=r[0],a=r[1];this[i]=a}}catch(t){n.e(t)}finally{n.f()}this._$Ep=void 0}var o=this.constructor.elementProperties;if(o.size>0){var s,u=I(o);try{for(u.s();!(s=u.n()).done;){var c=A(s.value,2),l=c[0],d=c[1];!0!==d.wrapped||this._$AL.has(l)||void 0===this[l]||this.P(l,this[l],d)}}catch(t){u.e(t)}finally{u.f()}}}var f=!1,h=this._$AL;try{var v;(f=this.shouldUpdate(h))?(this.willUpdate(h),null!==(v=this._$EO)&&void 0!==v&&v.forEach((function(t){var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(h)):this._$EU()}catch(h){throw f=!1,this._$EU(),h}f&&this._$AE(h)}}},{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:"_$EU",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._$Ej&&(this._$Ej=this._$Ej.forEach((function(t){return e._$EC(t,e[t])}))),this._$EU()}},{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&&$(this._$Eh.keys())}},{key:"createProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ht;if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){var n=Symbol(),r=this.getPropertyDescriptor(t,n,e);void 0!==r&&et(this.prototype,t,r)}}},{key:"getPropertyDescriptor",value:function(t,e,n){var r,i=null!==(r=nt(this.prototype,t))&&void 0!==r?r:{get:function(){return this[e]},set:function(t){this[e]=t}},a=i.get,o=i.set;return{get:function(){return null==a?void 0:a.call(this)},set:function(e){var r=null==a?void 0:a.call(this);o.call(this,e),this.requestUpdate(t,r,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(t){var e;return null!==(e=this.elementProperties.get(t))&&void 0!==e?e:ht}},{key:"_$Ei",value:function(){if(!this.hasOwnProperty(lt("elementProperties"))){var t=at(this);t.finalize(),void 0!==t.l&&(this.l=$(t.l)),this.elementProperties=new Map(t.elementProperties)}}},{key:"finalize",value:function(){if(!this.hasOwnProperty(lt("finalized"))){if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(lt("properties"))){var t,e=this.properties,n=I([].concat($(rt(e)),$(it(e))));try{for(n.s();!(t=n.n()).done;){var r=t.value;this.createProperty(r,e[r])}}catch(t){n.e(t)}finally{n.f()}}var i=this[Symbol.metadata];if(null!==i){var a=litPropertyMetadata.get(i);if(void 0!==a){var o,s=I(a);try{for(s.s();!(o=s.n()).done;){var u=A(o.value,2),c=u[0],l=u[1];this.elementProperties.set(c,l)}}catch(t){s.e(t)}finally{s.f()}}}this._$Eh=new Map;var d,f=I(this.elementProperties);try{for(f.s();!(d=f.n()).done;){var h=A(d.value,2),v=h[0],p=h[1],y=this._$Eu(v,p);void 0!==y&&this._$Eh.set(y,v)}}catch(t){f.e(t)}finally{f.f()}this.elementStyles=this.finalizeStyles(this.styles)}}},{key:"finalizeStyles",value:function(t){var e=[];if(Array.isArray(t)){var n,r=I(new Set(t.flat(1/0).reverse()));try{for(r.s();!(n=r.n()).done;){var i=n.value;e.unshift(X(i))}}catch(t){r.e(t)}finally{r.f()}}else void 0!==t&&e.push(X(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 e}();vt.elementStyles=[],vt.shadowRootOptions={mode:"open"},vt[lt("elementProperties")]=new Map,vt[lt("finalized")]=new Map,null!=ct&&ct({ReactiveElement:vt}),(null!==(n=ot.reactiveElementVersions)&&void 0!==n?n:ot.reactiveElementVersions=[]).push("2.0.4");var pt=globalThis,yt=pt.trustedTypes,gt=yt?yt.createPolicy("lit-html",{createHTML:function(t){return t}}):void 0,bt="$lit$",_t="lit$".concat(Math.random().toFixed(9).slice(2),"$"),mt="?"+_t,wt="<".concat(mt,">"),kt=document,xt=function(){return kt.createComment("")},Et=function(t){return null===t||"object"!=z(t)&&"function"!=typeof t},Ot=Array.isArray,$t="[ \t\n\f\r]",At=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,St=/-->/g,jt=/>/g,Ct=RegExp(">|".concat($t,"(?:([^\\s\"'>=/]+)(").concat($t,"*=").concat($t,"*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)"),"g"),Pt=/'/g,Tt=/"/g,Ut=/^(?:script|style|textarea|title)$/i,Nt=function(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return{_$litType$:t,strings:e,values:r}}}(1),Mt=Symbol.for("lit-noChange"),Lt=Symbol.for("lit-nothing"),Rt=new WeakMap,It=kt.createTreeWalker(kt,129);function Dt(t,e){if(!Ot(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==gt?gt.createHTML(e):e}var Ht=function(t,e){for(var n,r=t.length-1,i=[],a=2===e?"<svg>":3===e?"<math>":"",o=At,s=0;s<r;s++){for(var u=t[s],c=void 0,l=void 0,d=-1,f=0;f<u.length&&(o.lastIndex=f,null!==(l=o.exec(u)));)f=o.lastIndex,o===At?"!--"===l[1]?o=St:void 0!==l[1]?o=jt:void 0!==l[2]?(Ut.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=Ct):void 0!==l[3]&&(o=Ct):o===Ct?">"===l[0]?(o=null!=n?n:At,d=-1):void 0===l[1]?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=void 0===l[3]?Ct:'"'===l[3]?Tt:Pt):o===Tt||o===Pt?o=Ct:o===St||o===jt?o=At:(o=Ct,n=void 0);var h=o===Ct&&t[s+1].startsWith("/>")?" ":"";a+=o===At?u+wt:d>=0?(i.push(c),u.slice(0,d)+bt+u.slice(d)+_t+h):u+_t+(-2===d?s:h)}return[Dt(t,a+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]},Ft=function(){return W((function t(e,n){var r,i=e.strings,a=e._$litType$;F(this,t),this.parts=[];var o=0,s=0,u=i.length-1,c=this.parts,l=A(Ht(i,a),2),d=l[0],f=l[1];if(this.el=t.createElement(d,n),It.currentNode=this.el.content,2===a||3===a){var h=this.el.content.firstChild;h.replaceWith.apply(h,$(h.childNodes))}for(;null!==(r=It.nextNode())&&c.length<u;){if(1===r.nodeType){if(r.hasAttributes()){var v,p=I(r.getAttributeNames());try{for(p.s();!(v=p.n()).done;){var y=v.value;if(y.endsWith(bt)){var g=f[s++],b=r.getAttribute(y).split(_t),_=/([.?@])?(.*)/.exec(g);c.push({type:1,index:o,name:_[2],strings:b,ctor:"."===_[1]?qt:"?"===_[1]?Vt:"@"===_[1]?Jt:zt}),r.removeAttribute(y)}else y.startsWith(_t)&&(c.push({type:6,index:o}),r.removeAttribute(y))}}catch(t){p.e(t)}finally{p.f()}}if(Ut.test(r.tagName)){var m=r.textContent.split(_t),w=m.length-1;if(w>0){r.textContent=yt?yt.emptyScript:"";for(var k=0;k<w;k++)r.append(m[k],xt()),It.nextNode(),c.push({type:2,index:++o});r.append(m[w],xt())}}}else if(8===r.nodeType)if(r.data===mt)c.push({type:2,index:o});else for(var x=-1;-1!==(x=r.data.indexOf(_t,x+1));)c.push({type:7,index:o}),x+=_t.length-1;o++}}),null,[{key:"createElement",value:function(t,e){var n=kt.createElement("template");return n.innerHTML=t,n}}])}();function Gt(t,e){var n,r,i,a,o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,u=arguments.length>3?arguments[3]:void 0;if(e===Mt)return e;var c=void 0!==u?null===(n=s._$Co)||void 0===n?void 0:n[u]:s._$Cl,l=Et(e)?void 0:e._$litDirective$;return(null===(r=c)||void 0===r?void 0:r.constructor)!==l&&(null!==(i=c)&&void 0!==i&&null!==(a=i._$AO)&&void 0!==a&&a.call(i,!1),void 0===l?c=void 0:(c=new l(t))._$AT(t,s,u),void 0!==u?(null!==(o=s._$Co)&&void 0!==o?o:s._$Co=[])[u]=c:s._$Cl=c),void 0!==c&&(e=Gt(t,c._$AS(t,e.values),c,u)),e}var Wt=function(){return W((function t(e,n){F(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,r=n.el.content,i=n.parts,a=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:kt).importNode(r,!0);It.currentNode=a;for(var o=It.nextNode(),s=0,u=0,c=i[0];void 0!==c;){var l;if(s===c.index){var d=void 0;2===c.type?d=new Bt(o,o.nextSibling,this,t):1===c.type?d=new c.ctor(o,c.name,c.strings,this,t):6===c.type&&(d=new Yt(o,this,t)),this._$AV.push(d),c=i[++u]}s!==(null===(l=c)||void 0===l?void 0:l.index)&&(o=It.nextNode(),s++)}return It.currentNode=kt,a}},{key:"p",value:function(t){var e,n=0,r=I(this._$AV);try{for(r.s();!(e=r.n()).done;){var i=e.value;void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,n),n+=i.strings.length-2):i._$AI(t[n])),n++}}catch(t){r.e(t)}finally{r.f()}}}])}(),Bt=function(){function t(e,n,r,i){var a;F(this,t),this.type=2,this._$AH=Lt,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=null===(a=null==i?void 0:i.isConnected)||void 0===a||a}return W(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=Gt(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),Et(t)?t===Lt||null==t||""===t?(this._$AH!==Lt&&this._$AR(),this._$AH=Lt):t!==this._$AH&&t!==Mt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):function(t){return Ot(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!==Lt&&Et(this._$AH)?this._$AA.nextSibling.data=t:this.T(kt.createTextNode(t)),this._$AH=t}},{key:"$",value:function(t){var e,n=t.values,r=t._$litType$,i="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Ft.createElement(Dt(r.h,r.h[0]),this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.p(n);else{var a=new Wt(i,this),o=a.u(this.options);a.p(n),this.T(o),this._$AH=a}}},{key:"_$AC",value:function(t){var e=Rt.get(t.strings);return void 0===e&&Rt.set(t.strings,e=new Ft(t)),e}},{key:"k",value:function(e){Ot(this._$AH)||(this._$AH=[],this._$AR());var n,r,i=this._$AH,a=0,o=I(e);try{for(o.s();!(r=o.n()).done;){var s=r.value;a===i.length?i.push(n=new t(this.O(xt()),this.O(xt()),this,this.options)):n=i[a],n._$AI(s),a++}}catch(t){o.e(t)}finally{o.f()}a<i.length&&(this._$AR(n&&n._$AB.nextSibling,a),i.length=a)}},{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&&t!==this._$AB;){var n,r=t.nextSibling;t.remove(),t=r}}},{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))}}])}(),zt=function(){return W((function t(e,n,r,i,a){F(this,t),this.type=1,this._$AH=Lt,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=a,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Lt}),[{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,r=arguments.length>3?arguments[3]:void 0,i=this.strings,a=!1;if(void 0===i)t=Gt(this,t,e,0),(a=!Et(t)||t!==this._$AH&&t!==Mt)&&(this._$AH=t);else{var o,s,u=t;for(t=i[0],o=0;o<i.length-1;o++)(s=Gt(this,u[n+o],e,o))===Mt&&(s=this._$AH[o]),a||(a=!Et(s)||s!==this._$AH[o]),s===Lt?t=Lt:t!==Lt&&(t+=(null!=s?s:"")+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(t)}},{key:"j",value:function(t){t===Lt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}])}(),qt=function(){function t(){var e;return F(this,t),(e=P(this,t,arguments)).type=3,e}return U(t,zt),W(t,[{key:"j",value:function(t){this.element[this.name]=t===Lt?void 0:t}}])}(),Vt=function(){function t(){var e;return F(this,t),(e=P(this,t,arguments)).type=4,e}return U(t,zt),W(t,[{key:"j",value:function(t){this.element.toggleAttribute(this.name,!!t&&t!==Lt)}}])}(),Jt=function(){function t(e,n,r,i,a){var o;return F(this,t),(o=P(this,t,[e,n,r,i,a])).type=5,o}return U(t,zt),W(t,[{key:"_$AI",value:function(t){var e;if((t=null!==(e=Gt(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0))&&void 0!==e?e:Lt)!==Mt){var n=this._$AH,r=t===Lt&&n!==Lt||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,i=t!==Lt&&(n===Lt||r);r&&this.element.removeEventListener(this.name,this,n),i&&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)}}])}(),Yt=function(){return W((function t(e,n,r){F(this,t),this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}),[{key:"_$AU",get:function(){return this._$AM._$AU}},{key:"_$AI",value:function(t){Gt(this,t)}}])}(),Kt=pt.litHtmlPolyfillSupport;null!=Kt&&Kt(Ft,Bt),(null!==(r=pt.litHtmlVersions)&&void 0!==r?r:pt.litHtmlVersions=[]).push("3.2.1");var Zt=function(){function t(){var e;return F(this,t),(e=P(this,t,arguments)).renderOptions={host:T(e)},e._$Do=void 0,e}return U(t,vt),W(t,[{key:"createRenderRoot",value:function(){var e,n,r=E(t,"createRenderRoot",this,3)([]);return null!==(n=(e=this.renderOptions).renderBefore)&&void 0!==n||(e.renderBefore=r.firstChild),r}},{key:"update",value:function(e){var n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),E(t,"update",this,3)([e]),this._$Do=function(t,e,n){var r,i=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:e,a=i._$litPart$;if(void 0===a){var o,s=null!==(o=null==n?void 0:n.renderBefore)&&void 0!==o?o:null;i._$litPart$=a=new Bt(e.insertBefore(xt(),s),s,void 0,null!=n?n:{})}return a._$AI(t),a}(n,this.renderRoot,this.renderOptions)}},{key:"connectedCallback",value:function(){var e;E(t,"connectedCallback",this,3)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}},{key:"disconnectedCallback",value:function(){var e;E(t,"disconnectedCallback",this,3)([]),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}},{key:"render",value:function(){return Mt}}])}();Zt._$litElement$=!0,Zt.finalized=!0,null===(i=globalThis.litElementHydrateSupport)||void 0===i||i.call(globalThis,{LitElement:Zt});var Qt=globalThis.litElementPolyfillSupport;null==Qt||Qt({LitElement:Zt}),(null!==(a=globalThis.litElementVersions)&&void 0!==a?a:globalThis.litElementVersions=[]).push("4.1.1");var Xt={attribute:!0,type:String,converter:dt,reflect:!1,hasChanged:ft},te=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xt,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=n.kind,i=n.metadata,a=globalThis.litPropertyMetadata.get(i);if(void 0===a&&globalThis.litPropertyMetadata.set(i,a=new Map),a.set(n.name,t),"accessor"===r){var o=n.name;return{set:function(n){var r=e.get.call(this);e.set.call(this,n),this.requestUpdate(o,r,t)},init:function(e){return void 0!==e&&this.P(o,void 0,t),e}}}if("setter"===r){var s=n.name;return function(n){var r=this[s];e.call(this,n),this.requestUpdate(s,r,t)}}throw Error("Unsupported decorator location: "+r)};function ee(t){return function(e,n){return"object"==z(n)?te(t,e,n):function(t,e,n){var r=e.hasOwnProperty(n);return e.constructor.createProperty(n,r?k(k({},t),{},{wrapped:!0}):t),r?Object.getOwnPropertyDescriptor(e,n):void 0}(t,e,n)}}function ne(t){return ee(k(k({},t),{},{state:!0,attribute:!1}))}function re(){return ie.apply(this,arguments)}function ie(){return ie=C(S().mark((function t(){var e;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.race([customElements.whenDefined("home-assistant"),customElements.whenDefined("hc-main")]);case 2:e=customElements.get("home-assistant")?"home-assistant":"hc-main";case 3:if(document.querySelector(e)){t.next=8;break}return t.next=6,new Promise((function(t){return window.setTimeout(t,100)}));case 6:t.next=3;break;case 8:return t.abrupt("return",document.querySelector(e));case 9:case"end":return t.stop()}}),t)}))),ie.apply(this,arguments)}function ae(){return oe.apply(this,arguments)}function oe(){return oe=C(S().mark((function t(){var e;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,re();case 2:e=t.sent;case 3:if(e.hass){t.next=8;break}return t.next=6,new Promise((function(t){return window.setTimeout(t,100)}));case 6:t.next=3;break;case 8:return t.abrupt("return",e.hass);case 9:case"end":return t.stop()}}),t)}))),oe.apply(this,arguments)}var se="browser_mod-browser-id";window.cardMod_template_cache=window.cardMod_template_cache||{};var ue,ce=window.cardMod_template_cache;function le(t,e){var n=ce[t];n&&(n.value=e.result,n.callbacks.forEach((function(t){return t(e.result)})))}function de(t){return!!t&&(String(t).includes("{%")||String(t).includes("{{"))}function fe(t,e,n){return he.apply(this,arguments)}function he(){return he=C(S().mark((function t(e,n,r){var i,a,o,s;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ae();case 2:i=t.sent,a=i.connection,o=JSON.stringify([n,r]),(s=ce[o])?(s.callbacks.has(e)||ve(e),e(s.value),s.callbacks.add(e)):(ve(e),e(""),r=Object.assign({user:i.user.name,browser:document.querySelector("hc-main")?"CAST":localStorage[se]?localStorage[se]:"",hash:location.hash.substr(1)||""},r),ce[o]=s={template:n,variables:r,value:"",callbacks:new Set([e]),unsubscribe:a.subscribeMessage((function(t){return le(o,t)}),{type:"render_template",template:n,variables:r})});case 7:case"end":return t.stop()}}),t)}))),he.apply(this,arguments)}function ve(t){return pe.apply(this,arguments)}function pe(){return(pe=C(S().mark((function t(e){var n,r,i,a,o,s;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=0,i=Object.entries(ce);case 1:if(!(r<i.length)){t.next=10;break}if(a=A(i[r],2),o=a[0],!(s=a[1]).callbacks.has(e)){t.next=7;break}return s.callbacks.delete(e),0==s.callbacks.size&&(n=s.unsubscribe,delete ce[o]),t.abrupt("break",10);case 7:r++,t.next=1;break;case 10:if(!n){t.next=16;break}return t.next=13,n;case 13:return t.t0=t.sent,t.next=16,(0,t.t0)();case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ye=function(){var t=C(S().mark((function t(){var e,n,r,i;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!customElements.get("ha-form")){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,null===(n=(e=window).loadCardHelpers)||void 0===n?void 0:n.call(e);case 4:if(r=t.sent){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,r.createCardElement({type:"entity"});case 9:if(i=t.sent){t.next=12;break}return t.abrupt("return");case 12:return t.next=14,i.getConfigElement();case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ge=function(t,e){if(t===e)return!0;if(z(t)!==z(e))return!1;if(!(t instanceof Object&&e instanceof Object))return!1;for(var n in t)if(t.hasOwnProperty(n)){if(!e.hasOwnProperty(n))return!1;if(t[n]!==e[n]){if("object"!==z(t[n]))return!1;if(!ge(t[n],e[n]))return!1}}for(var r in e)if(e.hasOwnProperty(r)&&!t.hasOwnProperty(r))return!1;return!0};window.autoEntities_cache=null!==(ue=window.autoEntities_cache)&&void 0!==ue?ue:{};var be=window.autoEntities_cache;function _e(t){return me.apply(this,arguments)}function me(){return me=C(S().mark((function t(e){var n;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(n=be.areas)||void 0===n){t.next=4;break}t.t0=n,t.next=7;break;case 4:return t.next=6,e.callWS({type:"config/area_registry/list"});case 6:t.t0=t.sent;case 7:return be.areas=t.t0,t.abrupt("return",be.areas);case 9:case"end":return t.stop()}}),t)}))),me.apply(this,arguments)}function we(){return be.areas}function ke(t){return xe.apply(this,arguments)}function xe(){return xe=C(S().mark((function t(e){var n;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(n=be.devices)||void 0===n){t.next=4;break}t.t0=n,t.next=7;break;case 4:return t.next=6,e.callWS({type:"config/device_registry/list"});case 6:t.t0=t.sent;case 7:return be.devices=t.t0,t.abrupt("return",be.devices);case 9:case"end":return t.stop()}}),t)}))),xe.apply(this,arguments)}function Ee(){return be.devices}function Oe(t){return $e.apply(this,arguments)}function $e(){return $e=C(S().mark((function t(e){var n;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(n=be.entities)||void 0===n){t.next=4;break}t.t0=n,t.next=7;break;case 4:return t.next=6,e.callWS({type:"config/entity_registry/list"});case 6:t.t0=t.sent;case 7:return be.entities=t.t0,t.abrupt("return",be.entities);case 9:case"end":return t.stop()}}),t)}))),$e.apply(this,arguments)}function Ae(){return be.entities}function Se(t){return je.apply(this,arguments)}function je(){return je=C(S().mark((function t(e){var n;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(n=be.labels)||void 0===n){t.next=4;break}t.t0=n,t.next=7;break;case 4:return t.next=6,e.callWS({type:"config/label_registry/list"});case 6:t.t0=t.sent;case 7:return be.labels=t.t0,t.abrupt("return",be.labels);case 9:case"end":return t.stop()}}),t)}))),je.apply(this,arguments)}var Ce=/([mhd])\s+ago\s*$/i,Pe="m ago";function Te(t,e){if(("string"==typeof t&&t.startsWith("$$")&&(t=t.substring(2),e=JSON.stringify(e)),"string"==typeof e&&"string"==typeof t)&&(t.startsWith("/")&&t.endsWith("/")||-1!==t.indexOf("*")))return t.startsWith("/")||(t=t.replace(/\./g,".").replace(/\*/g,".*"),t="/^".concat(t,"$/")),new RegExp(t.slice(1,-1)).test(e);if("string"==typeof t){var n=Ce.exec(t);if(n){t=t.replace(n[0],""),e=((new Date).getTime()-new Date(e).getTime())/6e4;var r=n[1];"h"===r?e/=60:"d"===r&&(e=e/60/24)}}if("string"==typeof t){if(t.startsWith("<="))return parseFloat(e)<=parseFloat(t.substring(2));if(t.startsWith(">="))return parseFloat(e)>=parseFloat(t.substring(2));if(t.startsWith("<"))return parseFloat(e)<parseFloat(t.substring(1));if(t.startsWith(">"))return parseFloat(e)>parseFloat(t.substring(1));if(t.startsWith("!"))return parseFloat(e)!=parseFloat(t.substring(1));if(t.startsWith("="))return parseFloat(e)==parseFloat(t.substring(1))}return t===e}var Ue,Ne,Me,Le,Re,Ie,De,He,Fe,Ge,We,Be,ze,qe,Ve,Je,Ye,Ke,Ze,Qe,Xe,tn,en={options:(tn=C(S().mark((function t(){return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",!0);case 1:case"end":return t.stop()}}),t)}))),function(){return tn.apply(this,arguments)}),sort:(Xe=C(S().mark((function t(){return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",!0);case 1:case"end":return t.stop()}}),t)}))),function(){return Xe.apply(this,arguments)}),domain:(Qe=C(S().mark((function t(e,n,r){return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Te(n,r.entity_id.split(".")[0]));case 1:case"end":return t.stop()}}),t)}))),function(t,e,n){return Qe.apply(this,arguments)}),entity_id:(Ze=C(S().mark((function t(e,n,r){return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Te(n,r.entity_id));case 1:case"end":return t.stop()}}),t)}))),function(t,e,n){return Ze.apply(this,arguments)}),state:(Ke=C(S().mark((function t(e,n,r){return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Te(n,r.state));case 1:case"end":return t.stop()}}),t)}))),function(t,e,n){return Ke.apply(this,arguments)}),name:(Ye=C(S().mark((function t(e,n,r){var i;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Te(n,null===(i=r.attributes)||void 0===i?void 0:i.friendly_name));case 1:case"end":return t.stop()}}),t)}))),function(t,e,n){return Ye.apply(this,arguments)}),group:(Je=C(S().mark((function t(e,n,r){var i,a,o;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null===(o=null===(a=null===(i=e.states[n])||void 0===i?void 0:i.attributes)||void 0===a?void 0:a.entity_id)||void 0===o?void 0:o.includes(r.entity_id));case 1:case"end":return t.stop()}}),t)}))),function(t,e,n){return Je.apply(this,arguments)}),attributes:(Ve=C(S().mark((function t(e,n,r){var i,a,o,s,u,c,l,d,f,h;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=0,a=Object.entries(n);case 1:if(!(i<a.length)){t.next=12;break}o=A(a[i],2),s=o[0],u=o[1],c=s.split(" ")[0],l=r.attributes,d=I(c.split(":"));try{for(d.s();!(f=d.n()).done;)h=f.value,l=l?l[h]:void 0}catch(t){d.e(t)}finally{d.f()}if(void 0!==l&&Te(u,l)){t.next=9;break}return t.abrupt("return",!1);case 9:i++,t.next=1;break;case 12:return t.abrupt("return",!0);case 13:case"end":return t.stop()}}),t)}))),function(t,e,n){return Ve.apply(this,arguments)}),not:(qe=C(S().mark((function t(e,n,r){return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,nn(e,n,r.entity_id);case 2:return t.abrupt("return",!t.sent);case 3:case"end":return t.stop()}}),t)}))),function(t,e,n){return qe.apply(this,arguments)}),and:(ze=C(S().mark((function t(e,n,r){var i,a,o;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=I(n),t.prev=1,i.s();case 3:if((a=i.n()).done){t.next=11;break}return o=a.value,t.next=7,nn(e,o,r.entity_id);case 7:if(t.sent){t.next=9;break}return t.abrupt("return",!1);case 9:t.next=3;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(1),i.e(t.t0);case 16:return t.prev=16,i.f(),t.finish(16);case 19:return t.abrupt("return",!0);case 20:case"end":return t.stop()}}),t,null,[[1,13,16,19]])}))),function(t,e,n){return ze.apply(this,arguments)}),or:(Be=C(S().mark((function t(e,n,r){var i,a,o;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=I(n),t.prev=1,i.s();case 3:if((a=i.n()).done){t.next=11;break}return o=a.value,t.next=7,nn(e,o,r.entity_id);case 7:if(!t.sent){t.next=9;break}return t.abrupt("return",!0);case 9:t.next=3;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(1),i.e(t.t0);case 16:return t.prev=16,i.f(),t.finish(16);case 19:return t.abrupt("return",!1);case 20:case"end":return t.stop()}}),t,null,[[1,13,16,19]])}))),function(t,e,n){return Be.apply(this,arguments)}),device:(We=C(S().mark((function t(e,n,r){var i,a;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Oe(e);case 2:if(i=t.sent.find((function(t){return t.entity_id===r.entity_id})),i){t.next=5;break}return t.abrupt("return",!1);case 5:return t.next=7,ke(e);case 7:if(a=t.sent.find((function(t){return t.id===i.device_id})),a){t.next=10;break}return t.abrupt("return",!1);case 10:return t.abrupt("return",Te(n,a.name_by_user)||Te(n,a.name));case 11:case"end":return t.stop()}}),t)}))),function(t,e,n){return We.apply(this,arguments)}),device_manufacturer:(Ge=C(S().mark((function t(e,n,r){var i,a;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Oe(e);case 2:if(i=t.sent.find((function(t){return t.entity_id===r.entity_id})),i){t.next=5;break}return t.abrupt("return",!1);case 5:return t.next=7,ke(e);case 7:if(a=t.sent.find((function(t){return t.id===i.device_id})),a){t.next=10;break}return t.abrupt("return",!1);case 10:return t.abrupt("return",Te(n,a.manufacturer));case 11:case"end":return t.stop()}}),t)}))),function(t,e,n){return Ge.apply(this,arguments)}),device_model:(Fe=C(S().mark((function t(e,n,r){var i,a;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Oe(e);case 2:if(i=t.sent.find((function(t){return t.entity_id===r.entity_id})),i){t.next=5;break}return t.abrupt("return",!1);case 5:return t.next=7,ke(e);case 7:if(a=t.sent.find((function(t){return t.id===i.device_id})),a){t.next=10;break}return t.abrupt("return",!1);case 10:return t.abrupt("return",Te(n,a.model));case 11:case"end":return t.stop()}}),t)}))),function(t,e,n){return Fe.apply(this,arguments)}),area:(He=C(S().mark((function t(e,n,r){var i,a,o;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Oe(e);case 2:if(i=t.sent.find((function(t){return t.entity_id===r.entity_id})),i){t.next=5;break}return t.abrupt("return",!1);case 5:return t.next=7,_e(e);case 7:if(a=t.sent.find((function(t){return t.area_id===i.area_id})),!a){t.next=10;break}return t.abrupt("return",Te(n,a.name)||Te(n,a.area_id));case 10:return t.next=12,ke(e);case 12:if(o=t.sent.find((function(t){return t.id===i.device_id})),o){t.next=15;break}return t.abrupt("return",!1);case 15:return t.next=17,_e(e);case 17:if(a=t.sent.find((function(t){return t.area_id===o.area_id})),a){t.next=20;break}return t.abrupt("return",!1);case 20:return t.abrupt("return",Te(n,a.name)||Te(n,a.area_id));case 21:case"end":return t.stop()}}),t)}))),function(t,e,n){return He.apply(this,arguments)}),entity_category:(De=C(S().mark((function t(e,n,r){var i;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Oe(e);case 2:if(i=t.sent.find((function(t){return t.entity_id===r.entity_id})),i){t.next=5;break}return t.abrupt("return",!1);case 5:return t.abrupt("return",Te(n,i.entity_category));case 6:case"end":return t.stop()}}),t)}))),function(t,e,n){return De.apply(this,arguments)}),last_changed:(Ie=C(S().mark((function t(e,n,r){return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ce.test(n)||(n+=Pe),t.abrupt("return",Te(n,r.last_changed));case 2:case"end":return t.stop()}}),t)}))),function(t,e,n){return Ie.apply(this,arguments)}),last_updated:(Re=C(S().mark((function t(e,n,r){return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ce.test(n)||(n+=Pe),t.abrupt("return",Te(n,r.last_updated));case 2:case"end":return t.stop()}}),t)}))),function(t,e,n){return Re.apply(this,arguments)}),last_triggered:(Le=C(S().mark((function t(e,n,r){return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=r.attributes.last_triggered){t.next=2;break}return t.abrupt("return",!1);case 2:return Ce.test(n)||(n+=Pe),t.abrupt("return",Te(n,r.attributes.last_triggered));case 4:case"end":return t.stop()}}),t)}))),function(t,e,n){return Le.apply(this,arguments)}),integration:(Me=C(S().mark((function t(e,n,r){var i;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Oe(e);case 2:if(i=t.sent.find((function(t){return t.entity_id===r.entity_id})),i){t.next=5;break}return t.abrupt("return",!1);case 5:return t.abrupt("return",Te(n,i.platform));case 6:case"end":return t.stop()}}),t)}))),function(t,e,n){return Me.apply(this,arguments)}),hidden_by:(Ne=C(S().mark((function t(e,n,r){var i;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Oe(e);case 2:if(i=t.sent.find((function(t){return t.entity_id===r.entity_id})),i){t.next=5;break}return t.abrupt("return",!1);case 5:return t.abrupt("return",Te(n,i.hidden_by));case 6:case"end":return t.stop()}}),t)}))),function(t,e,n){return Ne.apply(this,arguments)}),label:(Ue=C(S().mark((function t(e,n,r){var i,a,o,s,u,c;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Oe(e);case 2:return i=t.sent.find((function(t){return t.entity_id===r.entity_id})),t.next=5,Se(e);case 5:if(a=t.sent,o=function(t,e){if(Te(t,e))return!0;var n=a.find((function(t){return t.label_id===e}));return!!n&&Te(t,n.name)},i){t.next=9;break}return t.abrupt("return",!1);case 9:if(i.labels){t.next=11;break}return t.abrupt("return",!1);case 11:if(!(s=i.labels.some((function(t){return o(n,t)})))){t.next=14;break}return t.abrupt("return",s);case 14:return t.next=16,ke(e);case 16:if(u=t.sent.find((function(t){return t.id===i.device_id})),u){t.next=19;break}return t.abrupt("return",!1);case 19:return c=u.labels.some((function(t){return o(n,t)})),t.abrupt("return",c);case 21:case"end":return t.stop()}}),t)}))),function(t,e,n){return Ue.apply(this,arguments)})};function nn(t,e,n){return rn.apply(this,arguments)}function rn(){return rn=C(S().mark((function t(e,n,r){var i,a,o,s,u,c;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.states[r]){t.next=2;break}return t.abrupt("return",!1);case 2:a=0,o=Object.entries(n);case 3:if(!(a<o.length)){t.next=13;break}return s=A(o[a],2),u=s[0],c=s[1],u=u.trim().split(" ")[0].trim(),t.next=8,null===(i=en[u])||void 0===i?void 0:i.call(en,e,c,e.states[r]);case 8:if(t.sent){t.next=10;break}return t.abrupt("return",!1);case 10:a++,t.next=3;break;case 13:return t.abrupt("return",!0);case 14:case"end":return t.stop()}}),t)}))),rn.apply(this,arguments)}function an(t,e,n){var r,i,a,o,s=A(n.reverse?[-1,1]:[1,-1],2),u=s[0],c=s[1];return n.ignore_case&&(t=null!==(i=null===(r=null==t?void 0:t.toLowerCase)||void 0===r?void 0:r.call(t))&&void 0!==i?i:t,e=null!==(o=null===(a=null==e?void 0:e.toLowerCase)||void 0===a?void 0:a.call(e))&&void 0!==o?o:e),n.numeric&&(isNaN(parseFloat(t))&&isNaN(parseFloat(e))||(t=isNaN(parseFloat(t))?void 0:parseFloat(t),e=isNaN(parseFloat(e))?void 0:parseFloat(e))),void 0===t&&void 0===e?0:void 0===t?u:void 0===e?c:n.numeric?t===e?0:(n.reverse?-1:1)*(t<e?-1:1):n.ip?(t=t.split("."),e=e.split("."),(n.reverse?-1:1)*(an(t[0],e[0],{method:"",numeric:!0})||an(t[1],e[1],{method:"",numeric:!0})||an(t[2],e[2],{method:"",numeric:!0})||an(t[3],e[3],{method:"",numeric:!0}))):(n.reverse?-1:1)*String(t).localeCompare(String(e),void 0,n)}var on={none:function(){return 0},domain:function(t,e,n){var r,i;return an(null===(r=null==t?void 0:t.entity_id)||void 0===r?void 0:r.split(".")[0],null===(i=null==e?void 0:e.entity_id)||void 0===i?void 0:i.split(".")[0],n)},entity_id:function(t,e,n){return an(null==t?void 0:t.entity_id,null==e?void 0:e.entity_id,n)},friendly_name:function(t,e,n){var r,i,a,o;return an((null===(r=null==t?void 0:t.attributes)||void 0===r?void 0:r.friendly_name)||(null===(i=null==t?void 0:t.entity_id)||void 0===i?void 0:i.split(".")[1]),(null===(a=null==e?void 0:e.attributes)||void 0===a?void 0:a.friendly_name)||(null===(o=null==e?void 0:e.entity_id)||void 0===o?void 0:o.split(".")[1]),n)},name:function(t,e,n){var r,i,a,o;return an((null===(r=null==t?void 0:t.attributes)||void 0===r?void 0:r.friendly_name)||(null===(i=null==t?void 0:t.entity_id)||void 0===i?void 0:i.split(".")[1]),(null===(a=null==e?void 0:e.attributes)||void 0===a?void 0:a.friendly_name)||(null===(o=null==e?void 0:e.entity_id)||void 0===o?void 0:o.split(".")[1]),n)},device:function(t,e,n){var r,i,a=Ae().find((function(e){return e.entity_id===t.entity_id})),o=Ae().find((function(t){return t.entity_id===e.entity_id}));if(!a||!o)return 0;var s=Ee().find((function(t){return t.id===a.device_id})),u=Ee().find((function(t){return t.id===o.device_id}));return s&&u?an(null!==(r=s.name_by_user)&&void 0!==r?r:s.name,null!==(i=u.name_by_user)&&void 0!==i?i:u.name,n):0},area:function(t,e,n){var r=Ae().find((function(e){return e.entity_id===t.entity_id})),i=Ae().find((function(t){return t.entity_id===e.entity_id}));if(!r||!i)return 0;var a=Ee().find((function(t){return t.id===r.device_id})),o=Ee().find((function(t){return t.id===i.device_id}));if(!a||!o)return 0;var s=we().find((function(t){return t.area_id===a.area_id})),u=we().find((function(t){return t.area_id===o.area_id}));return s&&u?an(s.name,u.name,n):0},state:function(t,e,n){return an(null==t?void 0:t.state,null==e?void 0:e.state,n)},attribute:function(t,e,n){var r,i,a=A((null==n?void 0:n.reverse)?[-1,1]:[1,-1],2),o=a[0],s=a[1],u=null==t?void 0:t.attributes,c=null==e?void 0:e.attributes,l=I(null===(r=null==n?void 0:n.attribute)||void 0===r?void 0:r.split(":"));try{for(l.s();!(i=l.n()).done;){var d=i.value;if(void 0===u&&void 0===c)return 0;if(void 0===u)return o;if(void 0===c)return s;var f=[u[d],c[d]];u=f[0],c=f[1]}}catch(t){l.e(t)}finally{l.f()}return an(u,c,n)},last_changed:function(t,e,n){var r=A((null==n?void 0:n.reverse)?[-1,1]:[1,-1],2),i=r[0],a=r[1];return null==(null==t?void 0:t.last_changed)&&null==(null==e?void 0:e.last_changed)?0:null==(null==t?void 0:t.last_changed)?i:null==(null==e?void 0:e.last_changed)?a:(n.numeric=!0,an(new Date(null==t?void 0:t.last_changed).getTime(),new Date(null==e?void 0:e.last_changed).getTime(),n))},last_updated:function(t,e,n){var r=A((null==n?void 0:n.reverse)?[-1,1]:[1,-1],2),i=r[0],a=r[1];return null==(null==t?void 0:t.last_updated)&&null==(null==e?void 0:e.last_updated)?0:null==(null==t?void 0:t.last_updated)?i:null==(null==e?void 0:e.last_updated)?a:(n.numeric=!0,an(new Date(null==t?void 0:t.last_updated).getTime(),new Date(null==e?void 0:e.last_updated).getTime(),n))},last_triggered:function(t,e,n){var r,i,a,o,s,u,c=A((null==n?void 0:n.reverse)?[-1,1]:[1,-1],2),l=c[0],d=c[1];return null==(null===(r=null==t?void 0:t.attributes)||void 0===r?void 0:r.last_triggered)&&null==(null===(i=null==e?void 0:e.attributes)||void 0===i?void 0:i.last_triggered)?0:null==(null===(a=null==t?void 0:t.attributes)||void 0===a?void 0:a.last_triggered)?l:null==(null===(o=null==e?void 0:e.attributes)||void 0===o?void 0:o.last_triggered)?d:(n.numeric=!0,an(new Date(null===(s=null==t?void 0:t.attributes)||void 0===s?void 0:s.last_triggered).getTime(),new Date(null===(u=null==e?void 0:e.attributes)||void 0===u?void 0:u.last_triggered).getTime(),n))}};function sn(t,e){return function(n,r){var i,a;return null!==(a=null===(i=on[e.method])||void 0===i?void 0:i.call(on,t.states[n.entity],t.states[r.entity],e))&&void 0!==a?a:0}}var un="1.14.0b0",cn=["none","domain","entity_id","state","name","group","area","device","device_manufacturer","device_model","attributes","last_changed","last_updated","last_triggered","entity_category","integration","hidden_by","label"],ln={type:"select",options:[["domain","Entity Domain"],["entity_id","Entity ID"],["state","Entity State"],["name","Friendly Name"],["group","Member of Group"],["area","In area"],["device","Device"],["label","Label"],["device_manufacturer","Device Manufacturer"],["device_model","Device Model"],["attributes","Attribute"],["last_changed","Last Change"],["last_updated","Last Update"],["last_triggered","Last Trigger"],["entity_category","Entity Category"],["integration","Governing integration"],["hidden_by","Hidden by"]]},dn=function(t,e){var n,r=A(t,2),i=r[0];r[1];return cn.includes(i)?{type:"grid",name:"",schema:[Object.assign(Object.assign({},ln),{name:"key_".concat(e),label:"Property"}),{name:"value_".concat(e),selector:null!==(n={attributes:{object:{}}}[i])&&void 0!==n?n:{text:{}},label:"Value"}]}:{type:"Constant",name:"Some filters are not shown",value:"Please switch to the CODE EDITOR to access all options."}},fn=[{name:"options",selector:{object:{}}}],hn=[{name:"data",selector:{object:{}}}],vn=[{name:"method",label:"Sort method",type:"select",options:[["domain","Entity Domain"],["entity_id","Entity ID"],["friendly_name","Friendly Name"],["state","Entity State"],["last_changed","Last Change"],["last_updated","Last Update"],["last_triggered","Last Trigger"]]},{type:"constant",name:"Sorting options:",value:""},{type:"grid",name:"",schema:[{name:"reverse",type:"boolean",label:"Reverse"},{name:"ignore_case",type:"boolean",label:"Ignore case"},{name:"numeric",type:"boolean",label:"Numeric sort"},{name:"ip",type:"boolean",label:"IP address short"}]}],pn=[{type:"grid",name:"",schema:[{name:"show_empty",type:"boolean",label:"Show if empty"},{name:"card_param",type:"string",label:"Parameter to populate"}]}],yn=function(){function t(){var e;return F(this,t),(e=P(this,t,arguments))._selectedTab=0,e._cardGUIMode=!0,e._cardGUIModeAvailable=!0,e}return U(t,Zt),W(t,[{key:"setConfig",value:function(t){this._config=t}},{key:"connectedCallback",value:function(){E(t,"connectedCallback",this,3)([]),ye()}},{key:"_handleSwitchTab",value:function(t){this._selectedTab=parseInt(t.detail.index,10)}},{key:"_addFilterGroup",value:function(){var t;if(this._config){var e=$(null===(t=this._config.filter)||void 0===t?void 0:t.include);e.push({});var n=Object.assign(Object.assign({},this._config.filter),{include:e});this._config=Object.assign(Object.assign({},this._config),{filter:n}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}}},{key:"_deleteFilterGroup",value:function(t){var e;if(this._config){var n=$(null===(e=this._config.filter)||void 0===e?void 0:e.include);n.splice(t,1);var r=Object.assign(Object.assign({},this._config.filter),{include:n});this._config=Object.assign(Object.assign({},this._config),{filter:r}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}}},{key:"_moveFilterGroup",value:function(t,e){var n;if(this._config){var r=$(null===(n=this._config.filter)||void 0===n?void 0:n.include),i=[r[t+e],r[t]];r[t]=i[0],r[t+e]=i[1];var a=Object.assign(Object.assign({},this._config.filter),{include:r});this._config=Object.assign(Object.assign({},this._config),{filter:a}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}}},{key:"_addSpecialEntry",value:function(){var t;if(this._config){var e=$(null===(t=this._config.filter)||void 0===t?void 0:t.include);e.push({type:""});var n=Object.assign(Object.assign({},this._config.filter),{include:e});this._config=Object.assign(Object.assign({},this._config),{filter:n}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}}},{key:"_changeSpecialEntry",value:(n=C(S().mark((function t(e,n){var r,i,a,o,s;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._config){t.next=2;break}return t.abrupt("return");case 2:(a=n.detail.value?Object.assign({},n.detail.value.data):{type:""}).type=null!==(r=a.type)&&void 0!==r?r:"",(o=$(null===(i=this._config.filter)||void 0===i?void 0:i.include))[e]=a,s=Object.assign(Object.assign({},this._config.filter),{include:o}),this._config=Object.assign(Object.assign({},this._config),{filter:s}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}));case 9:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"_changeGroupOptions",value:(e=C(S().mark((function t(e,n){var r,i,a,o;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._config){t.next=2;break}return t.abrupt("return");case 2:i=n.detail.value,(a=$(null===(r=this._config.filter)||void 0===r?void 0:r.include))[e]=Object.assign({},i),o=Object.assign(Object.assign({},this._config.filter),{include:a}),this._config=Object.assign(Object.assign({},this._config),{filter:o}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}));case 8:case"end":return t.stop()}}),t,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"_changeFilter",value:function(t,e){var n;if(this._config){var r=function(t,e){for(var n,r={},i=0;i<=t.filter.include.length+1;i++)void 0!==e["key_".concat(i)]&&(r[e["key_".concat(i)]]=null!==(n=e["value_".concat(i)])&&void 0!==n?n:"");return void 0!==e.key_new&&(r[e.key_new]=""),r}(this._config,e.detail.value),i=$(null===(n=this._config.filter)||void 0===n?void 0:n.include);i[t]=Object.assign(Object.assign({},r),{options:i[t].options});var a=Object.assign(Object.assign({},this._config.filter),{include:i});this._config=Object.assign(Object.assign({},this._config),{filter:a}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}}},{key:"_changeSortOptions",value:function(t){if(this._config){var e=t.detail.value;this._config=Object.assign(Object.assign({},this._config),{sort:e}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}}},{key:"_changeCardOptions",value:function(t){if(this._config){var e=t.detail.value;this._config=Object.assign(Object.assign({},this._config),e),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}}},{key:"_showEmptyToggle",value:function(){if(this._config){var t=!1===this._config.show_empty;this._config=Object.assign(Object.assign({},this._config),{show_empty:t}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}}},{key:"_changeCardParam",value:function(t){if(this._config){var e=""===t.target.value||"entities"===t.target.value?void 0:t.target.value;this._config=Object.assign(Object.assign({},this._config),{card_param:e}),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}}},{key:"_getCardConfig",value:function(){var t=Object.assign({},this._config.card);return t[this._config.card_param||"entities"]=[],t}},{key:"_handleCardConfigChanged",value:function(t){if(t.stopPropagation(),this._config){var e=Object.assign({},t.detail.config);delete e[this._config.card_param||"entities"],this._config=Object.assign(Object.assign({},this._config),{card:e}),this._cardGUIModeAvailable=t.detail.guiModeAvailable,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}}},{key:"_deleteCard",value:function(t){this._config&&(this._config=Object.assign({},this._config),delete this._config.card,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}})))}},{key:"_toggleCardMode",value:function(t){var e;null===(e=this._cardEditorEl)||void 0===e||e.toggleMode()}},{key:"_cardGUIModeChanged",value:function(t){t.stopPropagation(),this._cardGUIMode=t.detail.guiMode,this._cardGUIModeAvailable=t.detail.guiModeAvailable}},{key:"render",value:function(){return this.hass&&this._config?Nt(s||(s=m(['\n <div class="card-config">\n <div class="toolbar">\n <mwc-tab-bar\n .activeIndex=',"\n @MDCTabBar:activated=","\n >\n <mwc-tab .label=","></mwc-tab>\n <mwc-tab .label=","></mwc-tab>\n <mwc-tab .label=","></mwc-tab>\n <mwc-tab .label=",' style="flex: 0 1 min-content;"></mwc-tab>\n </mwc-tab-bar>\n </div>\n <div id="editor">\n ',"\n </div>\n </div>\n "])),this._selectedTab,this._handleSwitchTab,"Filters","Sorting","Card","?",[this._renderFilterEditor,this._renderSortEditor,this._renderCardEditor,this._renderHelp][this._selectedTab].bind(this)()):Nt(o||(o=m([""])))}},{key:"_renderHelp",value:function(){return Nt(u||(u=m(['\n <div class="box">\n <p>Auto entities</p>\n <p>\n See\n <a\n href="https://github.com/thomasloven/lovelace-auto-entities"\n target="_blank"\n rel="noreferrer"\n >\n auto-entities on github\n </a>\n for usage instructions.\n </p>\n <p>Not all options are available in the GUI editor.</p>\n </div>\n '])))}},{key:"_renderFilterEditor",value:function(){var t,e=this;return(null===(t=this._config.filter)||void 0===t?void 0:t.template)||this._config.entities?Nt(c||(c=m(['\n <div class="box">\n <p>\n <b>Your filter method is not handled by the GUI editor.</b>\n </p>\n <p>Please switch to the CODE EDITOR to access all options.</p>\n </div>\n ']))):Nt(l||(l=m(["\n ","\n <mwc-button @click=",">\n <ha-icon .icon=","></ha-icon>Add filter group\n </mwc-button>\n <mwc-button @click=",">\n <ha-icon .icon=","></ha-icon>Add non-filter entry\n </mwc-button>\n "])),this._config.filter.include.map((function(t,n){return Nt(d||(d=m(['\n <div class="box">\n <div class="toolbar">\n <mwc-icon-button\n .disabled=',"\n @click=","\n >\n <ha-icon .icon=","></ha-icon>\n </mwc-icon-button>\n <mwc-icon-button\n .disabled=","\n @click=","\n >\n <ha-icon .icon=","></ha-icon>\n </mwc-icon-button>\n <mwc-icon-button\n @click=","\n >\n <ha-icon .icon=","></ha-icon>\n </mwc-icon-button>\n </div>\n ","\n </div>\n "])),0===n,(function(){return e._moveFilterGroup(n,-1)}),"mdi:arrow-up",n===e._config.filter.include.length-1,(function(){return e._moveFilterGroup(n,1)}),"mdi:arrow-down",(function(){return e._deleteFilterGroup(n)}),"mdi:close",void 0===t.type?Nt(f||(f=m(["\n <ha-form\n .hass=","\n .schema=","\n .data=","\n .computeLabel=","\n @value-changed=","\n ></ha-form>\n <p>Options:</p>\n <ha-form\n .hass=","\n .schema=","\n .data=","\n @value-changed=","\n ></ha-form>\n "])),e.hass,function(t){var e=Object.assign({},t);return delete e.options,[].concat($(Object.entries(e).map(dn)),[Object.assign(Object.assign({},ln),{name:"key_new",label:"Select property"})])}(t),function(t){var e=Object.assign({},t);return delete e.options,Object.assign.apply(Object,[{}].concat($(Object.entries(e).map((function(t,e){var n=A(t,2),r=n[0],i=n[1];return x(x({},"key_".concat(e),r),"value_".concat(e),i)})))))}(t),(function(t){var e;return null!==(e=t.label)&&void 0!==e?e:t.name}),(function(t){return e._changeFilter(n,t)}),e.hass,fn,t,(function(t){return e._changeGroupOptions(n,t)})):Nt(h||(h=m(["\n <ha-form\n .hass=","\n .schema=","\n .data=","\n @value-changed=","\n ></ha-form>\n "])),e.hass,hn,{data:t},(function(t){return e._changeSpecialEntry(n,t)})))})),this._addFilterGroup,"mdi:plus",this._addSpecialEntry,"mdi:plus")}},{key:"_renderSortEditor",value:function(){var t,e=null!==(t=this._config.sort)&&void 0!==t?t:{method:"none"};return Nt(v||(v=m(['\n <div class="box">\n <ha-form\n .hass=',"\n .data=","\n .schema=","\n .computeLabel=","\n @value-changed=","\n ></ha-form>\n </div>\n "])),this.hass,e,vn,(function(t){var e;return null!==(e=t.label)&&void 0!==e?e:t.name}),this._changeSortOptions)}},{key:"_renderCardEditor",value:function(){var t,e=Object.assign({},this._config);return e.show_empty=null===(t=e.show_empty)||void 0===t||t,Nt(p||(p=m(['\n <div class="box cards">\n <ha-form\n .hass=',"\n .schema=","\n .computeLabel=","\n .data=","\n @value-changed=","\n ></ha-form>\n ","\n </div>\n "])),this.hass,pn,(function(t){var e;return null!==(e=t.label)&&void 0!==e?e:t.name}),e,this._changeCardOptions,this._config.card?Nt(y||(y=m(["\n <div>\n <mwc-button\n @click=","\n .disabled=",'\n class="gui-mode-button"\n >\n ',"\n </mwc-button>\n <mwc-button\n .title=","\n @click=","\n >\n Change card type\n </mwc-button>\n </div>\n <hui-card-element-editor\n .hass=","\n .lovelace=","\n .value=","\n @config-changed=","\n @GUImode-changed=","\n ></hui-card-element-editor>\n "])),this._toggleCardMode,!this._cardGUIModeAvailable,!this._cardEditorEl||this._cardGUIMode?"Show code editor":"Show Visual Editor","Change card type",this._deleteCard,this.hass,this.lovelace,this._getCardConfig(),this._handleCardConfigChanged,this._cardGUIModeChanged):Nt(g||(g=m(["\n <hui-card-picker\n .hass=","\n .lovelace=","\n @config-changed=","\n ></hui-card-picker>\n "])),this.hass,this.lovelace,this._handleCardConfigChanged))}}],[{key:"styles",get:function(){return[Q(b||(b=m(["\n mwc-tab-bar {\n border-bottom: 1px solid var(--divider-color);\n }\n\n .box {\n margin-top: 8px;\n border: 1px solid var(--divider-color);\n padding: 12px;\n }\n .option {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .box .toolbar {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 8px;\n }\n .gui-mode-button {\n margin-right: auto;\n }\n a {\n color: var(--primary-color);\n }\n "])))]}}]);var e,n}();q([ne()],yn.prototype,"_config",void 0),q([ee()],yn.prototype,"lovelace",void 0),q([ee()],yn.prototype,"hass",void 0),q([ne()],yn.prototype,"_selectedTab",void 0),q([ne()],yn.prototype,"_cardGUIMode",void 0),q([ne()],yn.prototype,"_cardGUIModeAvailable",void 0),q([function(t){return function(e,n,r){return function(t,e,n){return n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=z(e)&&Object.defineProperty(t,e,n),n}(e,n,{get:function(){return function(e){var n,r;return null!==(n=null===(r=e.renderRoot)||void 0===r?void 0:r.querySelector(t))&&void 0!==n?n:null}(this)}})}}("hui-card-element-editor")],yn.prototype,"_cardEditorEl",void 0),customElements.define("auto-entities-editor",yn),window.customCards=window.customCards||[],window.customCards.push({type:"auto-entities",name:"Auto Entities",preview:!1,description:"Entity Filter on Steroids. Auto Entities allows you to fill other cards with entities automatically, based on a number of attributes."}),window.queueMicrotask=window.queueMicrotask||function(t){return window.setTimeout(t,1)};var gn=["section","divider"],bn=function(){function t(){var e;return F(this,t),(e=P(this,t,arguments)).empty=!1,e._updateCooldown={timer:void 0,rerun:!1},e._renderer=function(t){e._template="string"==typeof t?t.split(/[\s,]+/):t},e}return U(t,Zt),W(t,[{key:"setConfig",value:function(t){var e,n,r=this;if(!t)throw new Error("No configuration.");if(!(null===(e=t.card)||void 0===e?void 0:e.type))throw new Error("No card type specified.");if(!t.filter&&!t.entities)throw new Error("No filters specified.");t=JSON.parse(JSON.stringify(t)),this._config=t,(null===(n=this._config.filter)||void 0===n?void 0:n.template)&&de(this._config.filter.template)&&fe(this._renderer,this._config.filter.template,{config:t}),this._cardBuilt=new Promise((function(t){return r._cardBuiltResolve=t})),queueMicrotask((function(){return r.build_else()})),queueMicrotask((function(){return r.update_all()}))}},{key:"connectedCallback",value:function(){var e,n;E(t,"connectedCallback",this,3)([]),(null===(n=null===(e=this._config)||void 0===e?void 0:e.filter)||void 0===n?void 0:n.template)&&de(this._config.filter.template)&&fe(this._renderer,this._config.filter.template,{config:this._config})}},{key:"disconnectedCallback",value:function(){E(t,"disconnectedCallback",this,3)([]),ve(this._renderer)}},{key:"update_all",value:(o=C(S().mark((function t(){var e,n=this;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.card&&(this.card.hass=this.hass),this.else&&(this.else.hass=this.hass),!this._updateCooldown.timer){t.next=7;break}return this._updateCooldown.rerun=!0,t.abrupt("return");case 7:this._updateCooldown.rerun=!1,this._updateCooldown.timer=window.setTimeout((function(){n._updateCooldown.timer=void 0,n._updateCooldown.rerun&&n.update_all()}),500);case 9:return t.next=11,this.update_entities();case 11:e=t.sent,this.update_card(e);case 13:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"build_else",value:(a=C(S().mark((function t(){var e;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==this._config.else){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,window.loadCardHelpers();case 4:return e=t.sent,t.next=7,e.createCardElement(this._config.else);case 7:this.else=t.sent,this.else.hass=this.hass;case 9:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"update_card",value:(i=C(S().mark((function t(e){var n,r,i,a,o,s,u,c,l,d,f,h,v,p,y,g,b,_;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this._entities&&ge(e,this._entities)&&ge(this._cardConfig,this._config.card))){t.next=2;break}return t.abrupt("return");case 2:if(v=(null===(n=this._cardConfig)||void 0===n?void 0:n.type)!==this._config.card.type,this._entities=e,this._cardConfig=JSON.parse(JSON.stringify(this._config.card)),p=Object.assign(x({},this._config.card_param||"entities",e),this._config.card),this.card&&!v){t.next=40;break}return t.next=9,window.loadCardHelpers();case 9:return y=t.sent,console.oldError=console.oldError||[],g=console.error,console.oldError.push(g),console.error=function(){for(var t,e,n,r,i,a,o=arguments.length,s=new Array(o),u=0;u<o;u++)s[u]=arguments[u];3===s.length&&s[2].message&&((null===(e=(t=s[2].message).startsWith)||void 0===e?void 0:e.call(t,"Entities"))||(null===(r=(n=s[2].message).startsWith)||void 0===r?void 0:r.call(n,"Either entities"))||(null===(a=(i=s[2].message).endsWith)||void 0===a?void 0:a.call(i,"entity")))||g.apply(void 0,s)},t.prev=14,t.next=17,y.createCardElement(p);case 17:if(this.card=t.sent,"hui-error-card"!==this.card.localName){t.next=35;break}return b=this.card,t.next=22,customElements.whenDefined("hui-error-card");case 22:_=10;case 23:if(b._config||!_){t.next=29;break}return t.next=26,new Promise((function(t){return window.setTimeout(t,100)}));case 26:_--,t.next=23;break;case 29:if(!((null===(a=null===(i=null===(r=b._config)||void 0===r?void 0:r.error)||void 0===i?void 0:i.startsWith)||void 0===a?void 0:a.call(i,"Entities"))||(null===(u=null===(s=null===(o=b._config)||void 0===o?void 0:o.error)||void 0===s?void 0:s.startsWith)||void 0===u?void 0:u.call(s,"Either entities"))||(null===(d=null===(l=null===(c=b._config)||void 0===c?void 0:c.error)||void 0===l?void 0:l.endsWith)||void 0===d?void 0:d.call(l,"entity")))){t.next=35;break}return this.card=void 0,this._entities=void 0,this._cardConfig=void 0,null===(f=this._cardBuiltResolve)||void 0===f||f.call(this),t.abrupt("return");case 35:return t.prev=35,console.error=console.oldError.pop(),t.finish(35);case 38:t.next=41;break;case 40:this.card.setConfig(p);case 41:if(null===(h=this._cardBuiltResolve)||void 0===h||h.call(this),this.card.hass=this.hass,this.empty=0===e.length||e.every((function(t){return gn.includes(t.type)})),!this.card.requestUpdate){t.next=48;break}return t.next=47,this.updateComplete;case 47:this.card.requestUpdate();case 48:case"end":return t.stop()}}),t,this,[[14,,35,38]])}))),function(t){return i.apply(this,arguments)})},{key:"update_entities",value:(r=C(S().mark((function t(){var e,n,r,i,a,o,s,u,c,l,d,f,h,v,p,y,g,b,_,m,w,k,x,E,O,A,j,C,P,T,U,N=this;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=function(t){return t?"string"==typeof t?{entity:t.trim()}:t:null},l=$((null===(n=null===(e=this._config)||void 0===e?void 0:e.entities)||void 0===n?void 0:n.map(c))||[]),this.hass){t.next=4;break}return t.abrupt("return",l);case 4:if(this._template&&(l=l.concat(this._template.map(c))),l=l.filter(Boolean),!(null===(r=this._config.filter)||void 0===r?void 0:r.include)){t.next=56;break}d=Object.keys(this.hass.states).map(c),f=I(this._config.filter.include),t.prev=9,f.s();case 11:if((h=f.n()).done){t.next=48;break}if(!(v=h.value).type){t.next=16;break}return l.push(v),t.abrupt("continue",46);case 16:p=[],y=I(d),t.prev=18,y.s();case 20:if((g=y.n()).done){t.next=28;break}return b=g.value,t.next=24,nn(this.hass,v,b.entity);case 24:if(!t.sent){t.next=26;break}p.push(JSON.parse(JSON.stringify(Object.assign(Object.assign({},b),v.options)).replace(/this.entity_id/g,b.entity)));case 26:t.next=20;break;case 28:t.next=33;break;case 30:t.prev=30,t.t0=t.catch(18),y.e(t.t0);case 33:return t.prev=33,y.f(),t.finish(33);case 36:if(!v.sort){t.next=45;break}return t.next=39,Oe(this.hass);case 39:return t.next=41,ke(this.hass);case 41:return t.next=43,_e(this.hass);case 43:p=p.sort(sn(this.hass,v.sort)),(null!==(i=v.sort.count)&&void 0!==i?i:v.sort.first)&&(_=null!==(a=v.sort.first)&&void 0!==a?a:0,p=p.slice(_,_+(null!==(o=v.sort.count)&&void 0!==o?o:1/0)));case 45:l=l.concat(p);case 46:t.next=11;break;case 48:t.next=53;break;case 50:t.prev=50,t.t1=t.catch(9),f.e(t.t1);case 53:return t.prev=53,f.f(),t.finish(53);case 56:if(!(null===(s=this._config.filter)||void 0===s?void 0:s.exclude)){t.next=96;break}m=I(this._config.filter.exclude),t.prev=58,m.s();case 60:if((w=m.n()).done){t.next=88;break}k=w.value,x=[],E=I(l),t.prev=64,E.s();case 66:if((O=E.n()).done){t.next=77;break}if(A=O.value,t.t2=void 0===A.entity,t.t2){t.next=73;break}return t.next=72,nn(this.hass,k,A.entity);case 72:t.t2=!t.sent;case 73:if(!t.t2){t.next=75;break}x.push(A);case 75:t.next=66;break;case 77:t.next=82;break;case 79:t.prev=79,t.t3=t.catch(64),E.e(t.t3);case 82:return t.prev=82,E.f(),t.finish(82);case 85:l=x;case 86:t.next=60;break;case 88:t.next=93;break;case 90:t.prev=90,t.t4=t.catch(58),m.e(t.t4);case 93:return t.prev=93,m.f(),t.finish(93);case 96:if(this._config.sort&&(l=l.sort(sn(this.hass,this._config.sort)),this._config.sort.count&&(j=null!==(u=this._config.sort.first)&&void 0!==u?u:0,l=l.slice(j,j+this._config.sort.count))),!this._config.unique){t.next=119;break}C=[],P=I(l),t.prev=100,U=S().mark((function t(){var e;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=T.value,"entity"!==N._config.unique||!e.entity||!C.some((function(t){return t.entity===e.entity}))){t.next=3;break}return t.abrupt("return",0);case 3:if(!C.some((function(t){return ge(t,e)}))){t.next=5;break}return t.abrupt("return",0);case 5:C.push(e);case 6:case"end":return t.stop()}}),t)})),P.s();case 103:if((T=P.n()).done){t.next=110;break}return t.delegateYield(U(),"t5",105);case 105:if(0!==t.t5){t.next=108;break}return t.abrupt("continue",108);case 108:t.next=103;break;case 110:t.next=115;break;case 112:t.prev=112,t.t6=t.catch(100),P.e(t.t6);case 115:return t.prev=115,P.f(),t.finish(115);case 118:l=C;case 119:return t.abrupt("return",l);case 120:case"end":return t.stop()}}),t,this,[[9,50,53,56],[18,30,33,36],[58,90,93,96],[64,79,82,85],[100,112,115,118]])}))),function(){return r.apply(this,arguments)})},{key:"updated",value:(n=C(S().mark((function t(e){var n=this;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(e.has("_template")||e.has("hass")&&this.hass)&&queueMicrotask((function(){return n.update_all()}));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"createRenderRoot",value:function(){return this}},{key:"render",value:function(){return Nt(_||(_=m(["",""])),this.empty&&(!1===this._config.show_empty||this._config.else)?this.else:this.card)}},{key:"getCardSize",value:(e=C(S().mark((function t(){var e,n,r;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=0,t.next=3,this._cardBuilt;case 3:if(!this.card||!this.card.getCardSize){t.next=7;break}return t.next=6,this.card.getCardSize();case 6:r=t.sent;case 7:return 1===r&&(null===(e=this._entities)||void 0===e?void 0:e.length)&&(r=this._entities.length),0===r&&(null===(n=this._config.filter)||void 0===n?void 0:n.include)&&(r=Object.keys(this._config.filter.include).length),t.abrupt("return",r||5);case 10:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"hidden",get:function(){return this.empty&&!1===this._config.show_empty&&void 0===this._config.else}}],[{key:"getConfigElement",value:function(){return document.createElement("auto-entities-editor")}},{key:"getStubConfig",value:function(){return{card:{type:"entities"},filter:{include:[],exclude:[]}}}}]);var e,n,r,i,a,o}();q([ee()],bn.prototype,"_config",void 0),q([ee()],bn.prototype,"hass",void 0),q([ee()],bn.prototype,"card",void 0),q([ee()],bn.prototype,"else",void 0),q([ee()],bn.prototype,"_template",void 0),q([ne()],bn.prototype,"empty",void 0),customElements.get("auto-entities")||(customElements.define("auto-entities",bn),console.groupCollapsed("%cAUTO-ENTITIES ".concat(un," IS INSTALLED"),"color: green; font-weight: bold"),console.log("Readme:","https://github.com/thomasloven/lovelace-auto-entities"),console.groupEnd());