iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 154 kB
JavaScript
/*! For license information please see chunk.5d13b4400c9057e95605.js.LICENSE.txt */
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[469],{18601:function(e,t,n){"use strict";n.d(t,{qN:function(){return r.q},Wg:function(){return f}});var r=n(78220);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(u,e);var t,n,r,i=l(u);function u(){return o(this,u),i.apply(this,arguments)}return t=u,(n=[{key:"createRenderRoot",value:function(){return this.attachShadow({mode:"open",delegatesFocus:!0})}},{key:"click",value:function(){this.formElement&&(this.formElement.focus(),this.formElement.click())}},{key:"setAriaLabel",value:function(e){this.formElement&&this.formElement.setAttribute("aria-label",e)}},{key:"firstUpdated",value:function(){var e=this;s(d(u.prototype),"firstUpdated",this).call(this),this.mdcRoot.addEventListener("change",(function(t){e.dispatchEvent(new Event("change",t))}))}}])&&a(t.prototype,n),r&&a(t,r),u}(r.H)},58993:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.d(t,{yh:function(){return a},U2:function(){return c},t8:function(){return l},ZH:function(){return u}});var o,a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"keyval-store",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"keyval";r(this,e),this.storeName=n,this._dbp=new Promise((function(e,r){var i=indexedDB.open(t,1);i.onerror=function(){return r(i.error)},i.onsuccess=function(){return e(i.result)},i.onupgradeneeded=function(){i.result.createObjectStore(n)}}))}var t,n,o;return t=e,(n=[{key:"_withIDBStore",value:function(e,t){var n=this;return this._dbp.then((function(r){return new Promise((function(i,o){var a=r.transaction(n.storeName,e);a.oncomplete=function(){return i()},a.onabort=a.onerror=function(){return o(a.error)},t(a.objectStore(n.storeName))}))}))}}])&&i(t.prototype,n),o&&i(t,o),e}();function s(){return o||(o=new a),o}function c(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s();return n._withIDBStore("readonly",(function(n){t=n.get(e)})).then((function(){return t.result}))}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s();return n._withIDBStore("readwrite",(function(n){n.put(t,e)}))}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s();return e._withIDBStore("readwrite",(function(e){e.clear()}))}},7323:function(e,t,n){"use strict";n.d(t,{p:function(){return r}});var r=function(e,t){return e&&-1!==e.config.components.indexOf(t)}},91168:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=function(e){return e<10?"0".concat(e):e};function i(e){var t=Math.floor(e/3600),n=Math.floor(e%3600/60),i=Math.floor(e%3600%60);return t>0?"".concat(t,":").concat(r(n),":").concat(r(i)):n>0?"".concat(n,":").concat(r(i)):i>0?""+i:null}},69470:function(e,t,n){"use strict";n.d(t,{j:function(){return i},fs:function(){return o},$y:function(){return a}});var r=function(e,t,n){return new Promise((function(r,i){var o=document.createElement(e),a="src",s="body";switch(o.onload=function(){return r(t)},o.onerror=function(){return i(t)},e){case"script":o.async=!0,n&&(o.type=n);break;case"link":o.type="text/css",o.rel="stylesheet",a="href",s="head"}o[a]=t,document[s].appendChild(o)}))},i=function(e){return r("link",e)},o=function(e){return r("script",e)},a=function(e){return r("script",e,"module")}},83599:function(e,t,n){"use strict";n.d(t,{m:function(){return r}});var r=function(e){if(e.attributes.remaining){var t,n,r=(t=e.attributes.remaining,3600*(n=t.split(":").map(Number))[0]+60*n[1]+n[2]);if("active"===e.state){var i=(new Date).getTime(),o=new Date(e.last_changed).getTime();r=Math.max(r-(i-o)/1e3,0)}return r}}},86977:function(e,t,n){"use strict";n.d(t,{Q:function(){return r}});var r=function(e){return!(!e.detail.selected||"property"!==e.detail.source)&&(e.currentTarget.selected=!1,!0)}},96151:function(e,t,n){"use strict";n.d(t,{T:function(){return r},y:function(){return i}});var r=function(e){requestAnimationFrame((function(){return setTimeout(e,0)}))},i=function(){return new Promise((function(e){r(e)}))}},6315:function(e,t,n){"use strict";var r=n(15652),i=n(81471),o=n(91168),a=n(29171),s=n(22311),c=n(91741),l=n(76151),u=n(36145),d=n(83599),f=(n(91937),n(56007));function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(){var e=b(["\n :host {\n cursor: pointer;\n }\n\n ha-label-badge {\n --ha-label-badge-color: var(--label-badge-red, #df4c1e);\n }\n ha-label-badge.has-unit_of_measurement {\n --ha-label-badge-label-text-transform: none;\n }\n\n ha-label-badge.binary_sensor,\n ha-label-badge.updater {\n --ha-label-badge-color: var(--label-badge-blue, #039be5);\n }\n\n .red {\n --ha-label-badge-color: var(--label-badge-red, #df4c1e);\n }\n\n .blue {\n --ha-label-badge-color: var(--label-badge-blue, #039be5);\n }\n\n .green {\n --ha-label-badge-color: var(--label-badge-green, #0da035);\n }\n\n .yellow {\n --ha-label-badge-color: var(--label-badge-yellow, #f4b400);\n }\n\n .grey {\n --ha-label-badge-color: var(--label-badge-grey, var(--paper-grey-500));\n }\n\n .warning {\n --ha-label-badge-color: var(--label-badge-yellow, #fce588);\n }\n "]);return p=function(){return e},e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(){var e=b(['\n <ha-label-badge\n class="','"\n .value="','"\n .icon="','"\n .image="','"\n .label="','"\n .description="','"\n ></ha-label-badge>\n ']);return v=function(){return e},e}function y(){var e=b(['\n <ha-label-badge\n class="warning"\n label="','"\n icon="hass:alert"\n description="','"\n ></ha-label-badge>\n ']);return y=function(){return e},e}function b(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=z(e);if(t){var i=z(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _(this,n)}}function _(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?E(e):t}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(){C=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!O(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=D(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:j(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=j(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function P(e){var t,n=D(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function x(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function O(e){return e.decorators&&e.decorators.length}function S(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function j(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function D(e){var t=function(e,t){if("object"!==h(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===h(t)?t:String(t)}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T(e,t,n){return(T="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=z(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,t,n,r){var i=C();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(S(o.descriptor)||S(i.descriptor)){if(O(o)||O(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(O(o)){if(O(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}x(o,i)}else t.push(o)}return t}(a.d.map(P)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,r.Mo)("ha-state-label-badge")],(function(e,t){var n=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(r,t);var n=k(r);function r(){var t;g(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=n.call.apply(n,[this].concat(o)),e(E(t)),t}return r}(t);return{F:n,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"state",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"name",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"image",value:void 0},{kind:"field",decorators:[(0,r.sz)()],key:"_timerTimeRemaining",value:void 0},{kind:"field",key:"_connected",value:void 0},{kind:"field",key:"_updateRemaining",value:void 0},{kind:"method",key:"connectedCallback",value:function(){T(z(n.prototype),"connectedCallback",this).call(this),this._connected=!0,this.startInterval(this.state)}},{kind:"method",key:"disconnectedCallback",value:function(){T(z(n.prototype),"disconnectedCallback",this).call(this),this._connected=!1,this.clearInterval()}},{kind:"method",key:"render",value:function(){var e,t=this.state;if(!t)return(0,r.dy)(y(),this.hass.localize("state_badge.default.error"),this.hass.localize("state_badge.default.entity_not_found"));var n=(0,s.N)(t);return(0,r.dy)(v(),(0,i.$)((m(e={},n,!0),m(e,"has-unit_of_measurement","unit_of_measurement"in t.attributes),e)),this._computeValue(n,t),this.icon?this.icon:this._computeIcon(n,t),this.icon?"":this.image?this.image:t.attributes.entity_picture_local||t.attributes.entity_picture,this._computeLabel(n,t,this._timerTimeRemaining),this.name?this.name:(0,c.C)(t))}},{kind:"method",key:"updated",value:function(e){T(z(n.prototype),"updated",this).call(this,e),this._connected&&e.has("state")&&this.startInterval(this.state)}},{kind:"method",key:"_computeValue",value:function(e,t){switch(e){case"binary_sensor":case"device_tracker":case"person":case"updater":case"sun":case"alarm_control_panel":case"timer":return null;case"sensor":default:return"moon__phase"===t.attributes.device_class?null:t.state===f.lz?"-":t.attributes.unit_of_measurement?t.state:(0,a.D)(this.hass.localize,t,this.hass.language)}}},{kind:"method",key:"_computeIcon",value:function(e,t){if(t.state===f.nZ)return null;switch(e){case"alarm_control_panel":return"pending"===t.state?"hass:clock-fast":"armed_away"===t.state?"hass:nature":"armed_home"===t.state?"hass:home-variant":"armed_night"===t.state?"hass:weather-night":"armed_custom_bypass"===t.state?"hass:shield-home":"triggered"===t.state?"hass:alert-circle":(0,l.K)(e,t);case"binary_sensor":case"device_tracker":case"updater":case"person":return(0,u.M)(t);case"sun":return"above_horizon"===t.state?(0,l.K)(e):"hass:brightness-3";case"timer":return"active"===t.state?"hass:timer-outline":"hass:timer-off-outline";default:return"moon__phase"===(null==t?void 0:t.attributes.device_class)?(0,u.M)(t):null}}},{kind:"method",key:"_computeLabel",value:function(e,t,n){return t.state===f.nZ||["device_tracker","alarm_control_panel","person"].includes(e)?this.hass.localize("state_badge.".concat(e,".").concat(t.state))||this.hass.localize("state_badge.default.".concat(t.state))||t.state:"timer"===e?(0,o.Z)(n):t.attributes.unit_of_measurement||null}},{kind:"method",key:"clearInterval",value:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){this._updateRemaining&&(clearInterval(this._updateRemaining),this._updateRemaining=void 0)}))},{kind:"method",key:"startInterval",value:function(e){var t=this;this.clearInterval(),e&&"timer"===(0,s.N)(e)&&(this.calculateTimerRemaining(e),"active"===e.state&&(this._updateRemaining=window.setInterval((function(){return t.calculateTimerRemaining(t.state)}),1e3)))}},{kind:"method",key:"calculateTimerRemaining",value:function(e){this._timerTimeRemaining=(0,d.m)(e)}},{kind:"get",static:!0,key:"styles",value:function(){return(0,r.iv)(p())}}]}}),r.oi)},81545:function(e,t,n){"use strict";n(53918),n(83238);var r=n(15652);n(10983);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){var e=s(["\n :host {\n display: inline-block;\n position: relative;\n }\n ::slotted([disabled]) {\n color: var(--disabled-text-color);\n }\n "]);return o=function(){return e},e}function a(){var e=s(["\n <div @click=",'>\n <slot name="trigger"></slot>\n </div>\n <mwc-menu\n .corner=',"\n .multi=","\n .activatable=","\n >\n <slot></slot>\n </mwc-menu>\n "]);return a=function(){return e},e}function s(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var i=h(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function d(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?f(e):t}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(){p=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!y(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=w(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:g(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=g(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function m(e){var t,n=w(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function v(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function y(e){return e.decorators&&e.decorators.length}function b(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function g(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function w(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e,t,n,r){var i=p();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(b(o.descriptor)||b(i.descriptor)){if(y(o)||y(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(y(o)){if(y(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}v(o,i)}else t.push(o)}return t}(a.d.map(m)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,r.Mo)("ha-button-menu")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(r,t);var n=u(r);function r(){var t;c(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=n.call.apply(n,[this].concat(o)),e(f(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,r.Cb)()],key:"corner",value:function(){return"TOP_START"}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"multi",value:function(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"activatable",value:function(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,r.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.items}},{kind:"get",key:"selected",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.selected}},{kind:"method",key:"render",value:function(){return(0,r.dy)(a(),this._handleClick,this.corner,this.multi,this.activatable)}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this,this._menu.show())}},{kind:"get",static:!0,key:"styles",value:function(){return(0,r.iv)(o())}}]}}),r.oi)},57066:function(e,t,n){"use strict";n.d(t,{Lo:function(){return a},IO:function(){return s},qv:function(){return c},sG:function(){return d}});var r=n(95282),i=n(85415),o=n(38346),a=function(e,t){return e.callWS(Object.assign({type:"config/area_registry/create"},t))},s=function(e,t,n){return e.callWS(Object.assign({type:"config/area_registry/update",area_id:t},n))},c=function(e,t){return e.callWS({type:"config/area_registry/delete",area_id:t})},l=function(e){return e.sendMessagePromise({type:"config/area_registry/list"}).then((function(e){return e.sort((function(e,t){return(0,i.q)(e.name,t.name)}))}))},u=function(e,t){return e.subscribeEvents((0,o.D)((function(){return l(e).then((function(e){return t.setState(e,!0)}))}),500,!0),"area_registry_updated")},d=function(e,t){return(0,r.B)("_areaRegistry",l,u,e,t)}},74186:function(e,t,n){"use strict";n.d(t,{eD:function(){return a},Mw:function(){return s},vA:function(){return c},L3:function(){return l},Nv:function(){return u},z3:function(){return d},LM:function(){return p}});var r=n(95282),i=n(91741),o=n(38346),a=function(e,t){return t.find((function(t){return e.states[t.entity_id]&&"battery"===e.states[t.entity_id].attributes.device_class}))},s=function(e,t){return t.find((function(t){return e.states[t.entity_id]&&"battery_charging"===e.states[t.entity_id].attributes.device_class}))},c=function(e,t){if(t.name)return t.name;var n=e.states[t.entity_id];return n?(0,i.C)(n):null},l=function(e,t){return e.callWS({type:"config/entity_registry/get",entity_id:t})},u=function(e,t,n){return e.callWS(Object.assign({type:"config/entity_registry/update",entity_id:t},n))},d=function(e,t){return e.callWS({type:"config/entity_registry/remove",entity_id:t})},f=function(e){return e.sendMessagePromise({type:"config/entity_registry/list"})},h=function(e,t){return e.subscribeEvents((0,o.D)((function(){return f(e).then((function(e){return t.setState(e,!0)}))}),500,!0),"entity_registry_updated")},p=function(e,t){return(0,r.B)("_entityRegistry",f,h,e,t)}},15327:function(e,t,n){"use strict";n.d(t,{eL:function(){return r},SN:function(){return i},id:function(){return o},fg:function(){return a},j2:function(){return s},JR:function(){return c},Y:function(){return l},iM:function(){return u},Q2:function(){return d},Oh:function(){return f},vj:function(){return h},Gc:function(){return p}});var r=function(e){return e.sendMessagePromise({type:"lovelace/resources"})},i=function(e,t){return e.callWS(Object.assign({type:"lovelace/resources/create"},t))},o=function(e,t,n){return e.callWS(Object.assign({type:"lovelace/resources/update",resource_id:t},n))},a=function(e,t){return e.callWS({type:"lovelace/resources/delete",resource_id:t})},s=function(e){return e.callWS({type:"lovelace/dashboards/list"})},c=function(e,t){return e.callWS(Object.assign({type:"lovelace/dashboards/create"},t))},l=function(e,t,n){return e.callWS(Object.assign({type:"lovelace/dashboards/update",dashboard_id:t},n))},u=function(e,t){return e.callWS({type:"lovelace/dashboards/delete",dashboard_id:t})},d=function(e,t,n){return e.sendMessagePromise({type:"lovelace/config",url_path:t,force:n})},f=function(e,t,n){return e.callWS({type:"lovelace/config/save",url_path:t,config:n})},h=function(e,t){return e.callWS({type:"lovelace/config/delete",url_path:t})},p=function(e,t,n){return e.subscribeEvents((function(e){e.data.url_path===t&&n()}),"lovelace_updated")}},51444:function(e,t,n){"use strict";n.d(t,{_:function(){return o}});var r=n(47181),i=function(){return Promise.all([n.e(5009),n.e(9260),n.e(7033)]).then(n.bind(n,72420))},o=function(e){(0,r.B)(e,"show-dialog",{dialogTag:"ha-voice-command-dialog",dialogImport:i,dialogParams:{}})}},77760:function(e,t,n){"use strict";n.d(t,{VG:function(){return A},UO:function(){return I}});var r=n(4915),i=n(58831),o=n(27269),a=n(22311),s=n(91741),c=n(49706),l=function(e){var t=[];return Object.keys(e).forEach((function(n){var r=e[n];r.attributes.view&&t.push(r)})),t.sort((function(e,t){return e.entity_id===c.a1?-1:t.entity_id===c.a1?1:e.attributes.order-t.attributes.order})),t},u=function(e,t){var n={};return t.attributes.entity_id.forEach((function(t){var r=e[t];if(r&&(n[r.entity_id]=r,"group"===(0,i.M)(r.entity_id))){var o=function(e,t){var n={};return t.attributes.entity_id.forEach((function(t){var r=e[t];r&&(n[r.entity_id]=r)})),n}(e,r);Object.keys(o).forEach((function(e){var t=o[e];n[e]=t}))}})),n},d=n(85415);function f(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,i)}var h=function(){var e,t=(e=regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=n(t,(function(t){r(),e(t)}))})));case 1:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){f(o,r,i,a,s,"next",e)}function s(e){f(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}(),p=n(57066),m=n(57292),v=n(74186),y=n(5986),b=n(41499),g=n(14748);function w(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,i)}function k(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){w(o,r,i,a,s,"next",e)}function s(e){w(o,r,i,a,s,"throw",e)}a(void 0)}))}}function _(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||P(e)||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 E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(c){i=!0,o=c}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||P(e,t)||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 C(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=P(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},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 o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function P(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var O=["binary_sensor","mailbox","person","sensor","sun","timer"],S=new Set(["automation","configurator","device_tracker","geo_location","persistent_notification","zone"]),j=new Set(["mobile_app"]),D=!1,A=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=[],a=[],c=t.title?"".concat(t.title," "):void 0,l=C(e);try{for(l.s();!(n=l.n()).done;){var u=E(n.value,2),d=u[0],f=u[1],h=(0,i.M)(d);if("alarm_control_panel"===h){var p={type:"alarm-panel",entity:d};o.push(p)}else if("camera"===h){var m={type:"picture-entity",entity:d};o.push(m)}else if("climate"===h){var v={type:"thermostat",entity:d};o.push(v)}else if("humidifier"===h){var y={type:"humidifier",entity:d};o.push(y)}else if("light"===h&&r){var g={type:"light",entity:d};o.push(g)}else if("media_player"===h){var w={type:"media-control",entity:d};o.push(w)}else if("plant"===h){var k={type:"plant-status",entity:d};o.push(k)}else if("weather"===h){var _={type:"weather-forecast",entity:d,show_forecast:!1};o.push(_)}else if("sensor"===h&&(null==f?void 0:f.attributes.device_class)===b.A);else{var P=void 0,x=c&&f&&(P=(0,s.C)(f)).startsWith(c)?{entity:d,name:P.substr(c.length)}:d;a.push(x)}}}catch(O){l.e(O)}finally{l.f()}return a.length>0&&o.unshift(Object.assign({type:"entities",entities:a},t)),o},T=function(e,t,n,r,o,c){var l=function(e){var t=[],n={};return Object.keys(e).forEach((function(r){var o=e[r];"group"===(0,i.M)(r)?t.push(o):n[r]=o})),t.forEach((function(e){return e.attributes.entity_id.forEach((function(e){delete n[e]}))})),{groups:t,ungrouped:n}}(o);l.groups.sort((function(e,t){return c[e.entity_id]-c[t.entity_id]}));var u={},f={};Object.keys(l.ungrouped).forEach((function(e){var t=l.ungrouped[e],n=(0,a.N)(t),r=O.includes(n)?u:f;n in r||(r[n]=[]),r[n].push(t.entity_id)}));var h=[];O.forEach((function(e){e in u&&(h=h.concat(u[e]))}));var p=[];l.groups.forEach((function(e){p=p.concat(A(e.attributes.entity_id.map((function(e){return[e,o[e]]})),{title:(0,s.C)(e),show_header_toggle:"hidden"!==e.attributes.control}))})),Object.keys(f).sort().forEach((function(t){p=p.concat(A(f[t].sort((function(e,t){return(0,d.q)((0,s.C)(o[e]),(0,s.C)(o[t]))})).map((function(e){return[e,o[e]]})),{title:(0,y.Lh)(e,t)}))}));var m={path:t,title:n,badges:(0,g.Q)(h),cards:p};return r&&(m.icon=r),m},z=function(e,t,n,r,i){var o,s=function(e,t){var n={},r=new Set(t.filter((function(e){return j.has(e.platform)})).map((function(e){return e.entity_id})));return Object.keys(e).forEach((function(t){var i=e[t];S.has((0,a.N)(i))||r.has(i.entity_id)||(n[t]=e[t])})),n}(r,n),c={};Object.keys(s).forEach((function(e){var t=s[e];t.attributes.order&&(c[e]=t.attributes.order)}));var l=function(e,t,n,r){var i,o=Object.assign({},r),a=[],s=C(e);try{var c=function(){var e,r=i.value,s=[],c=new Set(t.filter((function(e){return e.area_id===r.area_id})).map((function(e){return e.id}))),l=C(n);try{for(l.s();!(e=l.n()).done;){var u=e.value;c.has(u.device_id)&&u.entity_id in o&&(s.push(o[u.entity_id]),delete o[u.entity_id])}}catch(d){l.e(d)}finally{l.f()}s.length>0&&a.push([r,s])};for(s.s();!(i=s.n()).done;)c()}catch(l){s.e(l)}finally{s.f()}return{areasWithEntities:a,otherEntities:o}}(e,t,n,s),u=T(i,"default_view","Home",undefined,l.otherEntities,c),d=[];return l.areasWithEntities.forEach((function(e){var t=E(e,2),n=t[0],r=t[1];d.push.apply(d,_(A(r.map((function(e){return[e.entity_id,e]})),{title:n.name})))})),(o=u.cards).unshift.apply(o,d),u},R=function(){var e=k(regeneratorRuntime.mark((function e(t,n,r,i,a,c){var d,f,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.safe_mode){e.next=2;break}return e.abrupt("return",{title:t.location_name,views:[{cards:[{type:"safe-mode"}]}]});case 2:return d=l(a),f=d.map((function(e){var t=u(a,e),n={};return Object.keys(t).forEach((function(e,t){n[e]=t})),T(c,(0,o.p)(e.entity_id),(0,s.C)(e),e.attributes.icon,t,n)})),h=t.location_name,0!==d.length&&"group.default_view"===d[0].entity_id||(f.unshift(z(n,r,i,a,c)),t.components.includes("geo_location")&&f[0]&&f[0].cards&&f[0].cards.push({type:"map",geo_location_sources:["all"]}),f.length>1&&"Home"===h&&(h="ioBroker")),1===f.length&&0===f[0].cards.length&&f[0].cards.push({type:"empty-state"}),e.abrupt("return",{title:h,views:f});case 8:case"end":return e.stop()}}),e)})));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),I=function(){var e=k(regeneratorRuntime.mark((function e(t,n){var i,o,a,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.config.state!==r.UE){e.next=2;break}return e.abrupt("return",{title:t.config.location_name,views:[{cards:[{type:"starting"}]}]});case 2:if(!t.config.safe_mode){e.next=4;break}return e.abrupt("return",{title:t.config.location_name,views:[{cards:[{type:"safe-mode"}]}]});case 4:return D||(D=!0,(0,p.sG)(t.connection,(function(){})),(0,m.q4)(t.connection,(function(){})),(0,v.LM)(t.connection,(function(){}))),e.next=7,Promise.all([h(t.connection,p.sG),h(t.connection,m.q4),h(t.connection,v.LM)]);case 7:return i=e.sent,o=E(i,3),a=o[0],s=o[1],c=o[2],e.abrupt("return",R(t.config,a,s,c,t.states,n||t.localize));case 13:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},68500:function(e,t,n){"use strict";n.d(t,{k:function(){return a}});var r=n(69470),i={},o={},a=function(e,t){return e.forEach((function(e){var n=new URL(e.url,t).toString();switch(e.type){case"css":if(n in i)break;i[n]=(0,r.j)(n);break;case"js":if(n in o)break;o[n]=(0,r.fs)(n);break;case"module":(0,r.$y)(n);break;default:console.warn("Unknown resource type specified: ".concat(e.type))}}))}},89172:function(e,t,n){"use strict";n.d(t,{J:function(){return D}});var r=n(15652),i=n(49629),o=(n(6315),n(93491)),a=n(22503),s=n(22193);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(){var e=f(["\n ha-state-label-badge:focus {\n outline: none;\n background: var(--divider-color);\n border-radius: 4px;\n }\n ha-state-label-badge {\n display: inline-block;\n padding: 4px 2px 4px 2px;\n margin: -4px -2px -4px -2px;\n }\n "]);return l=function(){return e},e}function u(){var e=f(["\n <ha-state-label-badge\n .hass=","\n .state=","\n .name=","\n .icon=","\n .image=","\n @action=","\n .actionHandler=","\n tabindex=","\n ></ha-state-label-badge>\n "]);return u=function(){return e},e}function d(){var e=f([""]);return d=function(){return e},e}function f(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return v(this,n)}}function v(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(){g=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!_(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=P(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:C(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=C(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function w(e){var t,n=P(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function k(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function _(e){return e.decorators&&e.decorators.length}function E(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function C(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function P(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c(t)?t:String(t)}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e,t,n,r){var i=g();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(E(o.descriptor)||E(i.descriptor)){if(_(o)||_(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(_(o)){if(_(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}k(o,i)}else t.push(o)}return t}(a.d.map(w)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,r.Mo)("hui-state-label-badge")],(function(e,t){return{F:function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(r,t);var n=m(r);function r(){var t;h(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=n.call.apply(n,[this].concat(o)),e(y(t)),t}return r}(t),d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){this._config=e}},{kind:"method",key:"render",value:function(){if(!this._config||!this.hass)return(0,r.dy)(d());var e=this.hass.states[this._config.entity];return(0,r.dy)(u(),this.hass,e,this._config.name,this._config.icon,this._config.image,this._handleAction,(0,o.K)({hasHold:(0,s._)(this._config.hold_action),hasDoubleClick:(0,s._)(this._config.double_tap_action)}),(0,i.o)((0,s._)(this._config.tap_action)||this._config.entity?"0":void 0))}},{kind:"method",key:"_handleAction",value:function(e){(0,a.G)(this,this.hass,this._config,e.detail.action)}},{kind:"get",static:!0,key:"styles",value:function(){return(0,r.iv)(l())}}]}}),r.oi);var O=n(7778),S=new Set(["error","state-label"]),j={"entity-filter":function(){return n.e(8045).then(n.bind(n,68045))}},D=function(e){return(0,O.Tw)("badge",e,S,j,void 0,"state-label")}},97504:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var r=n(47181),i=function(){return Promise.all([n.e(6372),n.e(5755),n.e(9494),n.e(5324),n.e(1480),n.e(4821),n.e(7164),n.e(2899),n.e(2979),n.e(5804),n.e(8170)]).then(n.bind(n,52408))},o=function(e,t){(0,r.B)(e,"show-dialog",{dialogTag:"hui-dialog-create-card",dialogImport:i,dialogParams:t})}},14748:function(e,t,n){"use strict";function r(e){return e.map((function(e){return"string"==typeof e?{entity:e}:e}))}n.d(t,{Q:function(){return r}})},48334:function(e,t,n){"use strict";n.r(t);n(53918);var r=n(60461),i=n.n(r),o=n(15652),a=n(5986),s=n(15327),c=(n(48811),n(15291),n(81796)),l=n(77760),u=n(68500),d=n(47181),f="show-save-config",h=!1,p=(n(81689),n(55317));n(53268),n(85530);(0,n(28393).VA)("waterfall",{run:function(){this.shadow=this.isOnScreen()&&this.isContentBelow()}});n(12730),n(91441);var m=n(81471),v=n(14516),y=n(7323);var b=n(86977),g=n(83849),w=n(87744),k=n(38346),_=n(96151);n(81545),n(16509),n(25230),n(52039);function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["<mwc-icon-button .disabled=",">\n <ha-svg-icon .path=","></ha-svg-icon>\n </mwc-icon-button> "]);return C=function(){return e},e}function P(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=N(e);if(t){var i=N(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return S(this,n)}}function S(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?j(e):t}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(){D=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!z(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return F(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?F(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=M(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:I(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=I(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function A(e){var t,n=M(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function T(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function z(e){return e.decorators&&e.decorators.length}function R(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function I(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function M(e){var t=function(e,t){if("object"!==E(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===E(t)?t:String(t)}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function B(e,t,n){return(B="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=N(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}(function(e,t,n,r){var i=D();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(R(o.descriptor)||R(i.descriptor)){if(z(o)||z(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(z(o)){if(z(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}T(o,i)}else t.push(o)}return t}(a.d.map(A)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)})([(0,o.Mo)("ha-icon-button-arrow-next")],(function(e,t){var n=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}(r,t);var n=O(r);function r(){var t;P(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=n.call.apply(n,[this].concat(o)),e(j(t)),t}return r}(t);return{F:n,d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,o.sz)()],key:"_icon",value:function(){return p.aIO}},{kind:"method",key:"connectedCallback",value:function(){var e=this;B(N(n.prototype),"connectedCallback",this).call(this),setTimeout((function(){e._icon="ltr"===window.getComputedStyle(e).direction?p.aIO:p.J3k}),100)}},{kind:"method",key:"render",value:function(){return(0,o.dy)(C(),this.disabled,this._icon)}}]}}),o.oi),n(2315),n(48932),n(46167);var V=n(26765),U=n(51444),L=(n(27849),n(11654)),q=n(27322),W=n(54324),$=!1,Q="show-edit-lovelace",H=function(e,t){$||($=!0,function(e){(0,d.B)(e,"register-dialog",{dialogShowEvent:Q,dialogTag:"hui-dialog-edit-lovelace",dialogImport:function(){return Promise.all([n.e(5009),n.e(9462),n.e(5852)]).then(n.bind(n,74764))}})}(e)),(0,d.B)(e,Q,t)},Z=!1,G="show-edit-view",J=function(e,t){Z||(Z=!0,function(e){(0,d.B)(e,"register-dialog",{dialogShowEvent:G,dialogTag:"hui-dialog-edit-view",dialogImport:function(){return Promise.all([n.e(5009),n.e(4358),n.e(1041),n.e(8374),n.e(3641),n.e(6372),n.e(8946),n.e(7924),n.e(4535),n.e(4821),n.e(6902),n.e(3141),n.e(1153)]).then(n.bind(n,18632))}})}(e)),(0,d.B)(e,G,t)},X=n(62877),K=(n(6315),n(90271)),Y=n(89172),ee=n(46628),te=n(50467),ne=n(97504);function re(e){return(re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ie(){var e=de(["\n :host {\n display: block;\n padding-top: 4px;\n height: 100%;\n box-sizing: border-box;\n }\n\n #badges {\n margin: 8px 16px;\n font-size: 85%;\n text-align: center;\n }\n\n #columns {\n display: flex;\n flex-direction: row;\n justify-content: center;\n margin-left: 4px;\n margin-right: 4px;\n }\n\n .column {\n flex: 1 0 0;\n max-width: 500px;\n min-width: 0;\n }\n\n .column > * {\n display: block;\n margin: 4px 4px 8px;\n }\n\n mwc-fab {\n position: sticky;\n float: right;\n right: calc(16px + env(safe-area-inset-right));\n bottom: calc(16px + env(safe-area-inset-bottom));\n z-index: 1;\n }\n\n mwc-fab.rtl {\n float: left;\n right: auto;\n left: calc(16px + env(safe-area-inset-left));\n }\n\n @media (max-width: 500px) {\n .column > * {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n @media (max-width: 599px) {\n .column {\n max-width: 600px;\n }\n }\n "]);return ie=function(){return e},e}function oe(e,t){return xe(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(c){i=!0,o=c}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||Ce(e,t)||Ee()}function ae(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Ce(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},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 o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function se(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,i)}function ce(){var e=de(["\n <mwc-fab\n title=","\n @click=","\n class=",'\n >\n <ha-svg-icon slot="icon" .path=',"></ha-svg-icon>\n </mwc-fab>\n "]);return ce=function(){return e},e}function le(){var e=de(["",""]);return le=function(){return e},e}function ue(){var e=de(['\n <div\n id="badges"\n style=',"\n >\n ",'\n </div>\n <div id="columns"></div>\n ',"\n "]);return ue=function(){return e},e}function de(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function fe(e,t){return(fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function he(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Se(e);if(t){var i=Se(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return pe(this,n)}}function pe(e,t){return!t||"object"!==re(t)&&"function"!=typeof t?me(e):t}function me(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ve(){ve=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!ge(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,xe(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||Ce(t)||Ee()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=_e(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:ke(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=ke(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function ye(e){var t,n=_e(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function be(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function ge(e){return e.decorators&&e.decorators.length}function we(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function ke(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function _e(e){var t=function(e,t){if("object"!==re(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==re(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===re(t)?t:String(t)}function Ee(){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 Ce(e,t){if(e){if("string"==typeof e)return Pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pe(e,t):void 0}}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xe(e){if(Array.isArray(e))return e}function Oe(e,t,n){return(Oe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Se(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function Se(e){return(Se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var je=!1,De=function(e,t){for(var n=0,r=0;r<e.length;r++){if(e[r]<5){n=r;break}e[r]<e[n]&&(n=r)}return e[n]+=t,n},Ae=function(e,t,n,r){var i=ve();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(we(o.descriptor)||we(i.descriptor)){if(ge(o)||ge(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(ge(o)){if(ge(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}be(o,i)}else t.push(o)}return t}(a.d.map(ye)),e);return i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}(null,(function(e,t){var r,i,a=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fe(e,t)}(r,t);var n=he(r);function r(){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),t=n.call(this),e(me(t)),t.addEventListener("iron-resize",(function(e){return e.stopPropagation()})),t}return r}(t);return{F:a,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"index",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"cards",value:function(){return[]}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"badges",value:function(){return[]}},{kind:"field",decorators:[(0,o.sz)()],key:"_columns",value:void 0},{kind:"field",key:"_createColumnsIteration",value:function(){return 0}},{kind:"field",key:"_mqls",value:void 0},{kind:"method",key:"setConfig",value:function(e){}},{kind:"method",key:"render",value:function(){var e;return(0,o.dy)(ue(),this.badges.length>0?"display: block":"display: none",this.badges.map((function(e){return(0,o.dy)(le(),e)})),(null===(e=this.lovelace)||void 0===e?void 0:e.editMode)?(0,o.dy)(ce(),this.hass.localize("ui.panel.lovelace.editor.edit_card.add"),this._addCard,(0,m.$)({rtl:(0,w.HE)(this.hass)}),p.qX5):"")}},{kind:"method",key:"firstUpdated",value:function(){var e=this;this._mqls=[300,600,900,1200].map((function(t){var n=window.matchMedia("(min-width: ".concat(t,"px)"));return n.addListener((function(){return e._updateColumns()})),n})),this._updateColumns()}},{kind:"method",key:"updated",value:function(e){var t,r,i;if(Oe(Se(a.prototype),"updated",this).call(this,e),(null===(t=this.lovelace)||void 0===t?void 0:t.editMode)&&!je&&(je=!0,Promise.all([n.e(9119),n.e(4910)]).then(n.bind(n,70858))),e.has("hass")){var o=e.get("hass");if(o&&this.hass.dockedSidebar!==o.dockedSidebar&&this._updateColumns(),1===e.size)return}e.has("narrow")&&this._updateColumns();var s=e.get("lovelace");(e.has("lovelace")&&((null==s?void 0:s.config)!==(null===(r=this.lovelace)||void 0===r?void 0:r.config)||(null==s?void 0:s.editMode)!==(null===(i=this.lovelace)||void 0===i?void 0:i.editMode))||e.has("_columns"))&&this._createColumns()}},{kind:"method",key:"_addCard",value:function(){(0,ne.F)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[this.index]})}},{kind:"method",key:"_createColumns",value:(r=regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,c,l,u,d,f,h,p,m,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._columns){e.next=2;break}return e.abrupt("return");case 2:for(this._createColumnsIteration++,t=this._createColumnsIteration,n=this.shadowRoot.getElementById("columns");n.lastChild;)n.removeChild(n.lastChild);for(r=[],i=[],o=0;o<Math.min(this._columns,this.cards.length);o++)(a=document.createElement("div")).classList.add("column"),n.appendChild(a),r.push(0),i.push(a);l=ae(this.cards.entries()),e.prev=10,l.s();case 12:if((u=l.n()).done){e.next=28;break}return d=oe(u.value,2),f=d[0],h=d[1],void 0===s&&(s=(0,_.y)().then((function(){s=void 0,c=void 0}))),p=void 0,void 0===c?c=new Date:(new Date).getTime()-c.getTime()>16&&(p=s),m=(0,te.N)(h),e.next=20,Promise.all([m,p]);case 20:if(v=e.sent,y=oe(v,1),b=y[0],t===this._createColumnsIteration){e.next=25;break}return e.abrupt("return");case 25:this._addCardToColumn(i[De(r,b)],f,this.lovelace.editMode);case 26:e.next=12;break;case 28:e.next=33;break;case 30:e.prev=30,e.t0=e.catch(10),l.e(e.t0);case 33:return e.prev=33,l.f(),e.finish(33);case 36:i.forEach((function(e){e.lastChild||e.parentElement.removeChild(e)}));case 37:case"end":return e.stop()}}),e,this,[[10,30,33,36]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function a(e){se(o,n,i,a,s,"next",e)}function s(e){se(o,n,i,a,s,"throw",e)}a(void 0)}))},function(){return i.apply(this,arguments)})},{kind:"method",key:"_addCardToColumn",value:function(e,t,n){var r=this.cards[t];if(n){var i=document.createElement("hui-card-options");i.hass=this.hass,i.lovelace=this.lovelace,i.path=[this.index,t],r.editMode=!0,i.appendChild(r),e.appendChild(i)}else r.editMode=!1,e.appendChild(r)}},{kind:"method",key:"_updateColumns",value:function(){if(this._mqls){var e=this._mqls.reduce((function(e,t){return e+Number(t.matches)}),0);this._columns=Math.max(1,e-Number(!this.narrow&&"docked"===this.hass.dockedSidebar))}}},{kind:"get",static:!0,key:"styles",value:function(){return(0,o.iv)(ie())}}]}}),o.oi);customElements.define("hui-masonry-view",Ae);var Te=n(7778),ze=new Set(["masonry"]),Re={panel:function(){return n.e(8480).then(n.bind(n,48480))}};function Ie(e){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fe(e,t){return(Fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Be(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Je(e);if(t){var i=Je(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ne(this,n)}}function Ne(e,t){return!t||"object"!==Ie(t)&&"function"!=typeof t?Ve(e):t}function Ve(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ue(){Ue=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!We(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ze(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=He(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:Qe(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=Qe(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function Le(e){var t,n=He(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function qe(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function We(e){return e.decorators&&e.decorators.length}function $e(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function Qe(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function He(e){var t=function(e,t){if("object"!==Ie(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ie(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ie(t)?t:String(t)}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ge(e,t,n){return(Ge="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Je(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function Je(e){return(Je=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,t,n,r){var i=Ue();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if($e(o.descriptor)||$e(i.descriptor)){if(We(o)||We(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(We(o)){if(We(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}qe(o,i)}else t.push(o)}return t}(a.d.map(Le)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,o.Mo)("hui-view")],(function(e,t){var n=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fe(e,t)}(r,t);var n=Be(r);function r(){var t;Me(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return t=n.call.apply(n,[this].concat(o)),e(Ve(t)),t}return r}(t);return{F:n,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"index",value:void 0},{kind:"field",decorators:[(0,o.sz)()],key:"_cards",value:function(){return[]}},{kind:"field",decorators:[(0,o.sz)()],key:"_badges",value:function(){return[]}},{kind:"field",key:"_layoutElement",value:void 0},{kind:"method",key:"createCardElement",value:function(e){var t=this,n=(0,ee.Z6)(e);return n.hass=this.hass,n.addEventListener("ll-rebuild",(function(r){t.lovelace.editMode||(r.stopPropagation(),t._rebuildCard(n,e))}),{once:!0}),n}},{kind:"method",key:"createBadgeElement",value:function(e){var t=this,n=(0,Y.J)(e);return n.hass=this.hass,n.addEventListener("ll-badge-rebuild",(function(){t._rebuildBadge(n,e)}),{once:!0}),n}},{kind:"method",key:"updated",value:function(e){Ge(Je(n.prototype),"updated",this).call(this,e);var t,r,i=this.hass,o=this.lovelace,a=e.has("hass"),s=e.get("lovelace"),c=!1,l=!1;e.has("index")?l=!0:e.has("lovelace")&&(c=s&&o.editMode!==s.editMode,l=!s||o.config!==s.config),l&&(t=o.config.views[this.index],t=Object.assign({},t,{type:t.panel?"panel":t.type||"masonry"})),l&&!this._layoutElement&&(this._layoutElement=(r=t,(0,Te.Tw)("view",r,ze,Re))),l&&(this._createBadges(t),this._createCards(t),this._layoutElement.hass=this.hass,this._layoutElement.narrow=this.narrow,this._layoutElement.lovelace=o,this._layoutElement.index=this.index),a&&(this._badges.forEach((function(e){e.hass=i})),this._cards.forEach((function(e){e.hass=i})),this._layoutElement.hass=this.hass),e.has("narrow")&&(this._layoutElement.narrow=this.narrow),c&&(this._layoutElement.lovelace=o),(l||a||c||e.has("_cards")||e.has("_badges"))&&(this._layoutElement.cards=this._cards,this._layoutElement.badges=this._badges);var u=e.get("hass");(l||c||a&&u&&(i.themes!==u.themes||i.selectedTheme!==u.selectedTheme))&&(0,X.R)(this,i.themes,o.config.views[this.index].theme),this._layoutElement&&!this.lastChild&&this.appendChild(this._layoutElement)}},{kind:"method",key:"_createBadges",value:function(e){var t=this;if(e&&e.badges&&Array.isArray(e.badges)){var n=(0,K.A)(e.badges);this._badges=n.map((function(e){var n=(0,Y.J)(e);return n.hass=t.hass,n}))}else this._badges=[]}},{kind:"method",key:"_createCards",value:function(e){var t=this;e&&e.cards&&Array.isArray(e.cards)?this._cards=e.cards.map((function(e){var n=t.createCardElement(e);return n.hass=t.hass,n})):this._cards=[]}},{kind:"method",key:"_rebuildCard",value:function(e,t){var n=this.createCardElement(t);n.hass=this.hass,e.parentElement&&e.parentElement.replaceChild(n,e),this._cards=this._cards.map((function(t){return t===e?n:t}))}},{kind:"method",key:"_rebuildBadge",value:function(e,t){var n=this.createBadgeElement(t);n.hass=this.hass,e.parentElement&&e.parentElement.replaceChild(n,e),this._badges=this._badges.map((function(t){return t===e?n:t}))}}]}}),o.f4);var Xe=n(6936),Ke=(n(25071),n(32957));function Ye(e){return(Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function et(){var e=Ct(["\n :host {\n --dark-color: #455a64;\n --text-dark-color: #fff;\n -ms-user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n }\n\n ha-app-layout {\n min-height: 100%;\n background: var(\n --lovelace-background,\n var(--primary-background-color)\n );\n }\n ha-tabs {\n width: 100%;\n height: 100%;\n margin-left: 4px;\n --paper-tabs-selection-bar-color: var(--text-primary-color, #fff);\n text-transform: uppercase;\n }\n .edit-mode ha-tabs {\n margin-left: max(env(safe-area-inset-left), 24px);\n margin-right: max(env(safe-area-inset-right), 24px);\n }\n .edit-mode {\n background-color: var(--dark-color, #455a64);\n color: var(--text-dark-color);\n }\n .edit-mode div[main-title] {\n pointer-events: auto;\n }\n paper-tab.iron-selected .edit-icon {\n display: inline-flex;\n }\n .edit-icon {\n color: var(--accent-color);\n padding-left: 8px;\n vertical-align: middle;\n --mdc-theme-text-disabled-on-light: var(--disabled-text-color);\n }\n .edit-icon.view {\n display: none;\n }\n #add-view {\n position: absolute;\n height: 44px;\n }\n #add-view ha-svg-icon {\n background-color: var(--accent-color);\n border-radius: 4px;\n }\n app-toolbar a {\n color: var(--text-primary-color, white);\n }\n mwc-button.warning:not([disabled]) {\n color: var(--error-color);\n }\n #view {\n min-height: calc(100vh - var(--header-height));\n /**\n * Since we only set min-height, if child nodes need percentage\n * heights they must use absolute positioning so we need relative\n * positioning here.\n *\n * https://www.w3.org/TR/CSS2/visudet.html#the-height-property\n */\n position: relative;\n display: flex;\n }\n #view > * {\n /**\n * The view could get larger than the window in Firefox\n * to prevent that we set the max-width to 100%\n * flex-grow: 1 and flex-basis: 100% should make sure the view\n * stays full width.\n *\n * https://github.com/home-assistant/home-assistant-polymer/pull/3806\n */\n flex: 1 1 100%;\n max-width: 100%;\n }\n .hide-tab {\n display: none;\n }\n .menu-link {\n text-decoration: none;\n }\n "]);return et=function(){return e},e}function tt(){var e=Ct(['\n <mwc-icon-button\n label="Start conversation"\n @click=',"\n >\n <ha-svg-icon path=","></ha-svg-icon>\n </mwc-icon-button>\n "]);return tt=function(){return e},e}function nt(){var e=Ct(['\n <span\n style="top: -4px; right: -6px; font-size: 1.0rem; position: absolute; min-width: 20px; box-sizing: border-box; border-radius: 50%; font-weight: 400; background-color: var(--accent-color); line-height: 24px; text-align: center; padding: 0 6px; color: var(--text-primary-color);"\n >\n ',"\n </span>\n "]);return nt=function(){return e},e}function rt(){var e=Ct(['\n <mwc-icon-button\n style="cursor: pointer; position: relative;"\n label="','"\n @click=',"\n >\n <ha-svg-icon path=","></ha-svg-icon>\n ","\n </mwc-icon-button>\n ","\n "]);return rt=function(){return e},e}function it(){var e=Ct(['\n <mwc-icon-button\n id="add-view"\n @click="','"\n title="','"\n >\n <ha-svg-icon .path=',"></ha-svg-icon>\n </mwc-icon-button>\n "]);return it=function(){return e},e}function ot(){var e=Ct(['\n <ha-svg-icon\n title="','"\n class="edit-icon view"\n .path=','\n @click="','"\n ></ha-svg-icon>\n <ha-icon-button-arrow-next\n title="','"\n class="edit-icon view"\n @click="','"\n ?disabled="','"\n ></ha-icon-button-arrow-next>\n ']);return ot=function(){return e},e}function at(){var e=Ct(['\n <ha-icon\n title="','"\n .icon="','"\n ></ha-icon>\n ']);return at=function(){return e},e}function st(){var e=Ct(['\n <ha-icon-button-arrow-prev\n title="','"\n class="edit-icon view"\n @click="','"\n ?disabled="','"\n ></ha-icon-button-arrow-prev>\n ']);return st=function(){return e},e}function ct(){var e=Ct(['\n <paper-tab\n aria-label="','"\n class="','"\n >\n ',"\n ","\n ","\n </paper-tab>\n "]);return ct=function(){return e},e}function lt(){var e=Ct(['\n <div sticky>\n <ha-tabs\n scrollable\n .selected="','"\n @iron-activate="','"\n dir="','"\n >\n ',"\n ","\n </ha-tabs>\n </div>\n "]);return lt=function(){return e},e}function ut(){var e=Ct(['\n <mwc-list-item\n graphic="icon"\n aria-label=',"\n @request-selected=","\n >\n ",'\n <ha-svg-icon\n slot="graphic"\n .path=',"\n ></ha-svg-icon>\n </mwc-list-item>\n "]);return ut=function(){return e},e}function dt(){var e=Ct(['\n <mwc-list-item\n graphic="icon"\n aria-label=',"\n @request-selected=","\n >\n ",'\n <ha-svg-icon\n slot="graphic"\n .path=',"\n ></ha-svg-icon>\n </mwc-list-item>\n "]);return dt=function(){return e},e}function ft(){var e=Ct(["\n <mwc-list-item\n aria-label=",'\n graphic="icon"\n @request-selected="','"\n >\n <span\n >','</span\n >\n <ha-svg-icon\n slot="graphic"\n .path=',"\n ></ha-svg-icon>\n </mwc-list-item>\n <mwc-list-item\n aria-label=",'\n graphic="icon"\n @request-selected="','"\n >\n <span\n >','</span\n >\n <ha-svg-icon\n slot="graphic"\n .path=',"\n ></ha-svg-icon>\n </mwc-list-item>\n "]);return ft=function(){return e},e}function ht(){var e=Ct(["\n <mwc-list-item\n .label=",'\n graphic="icon"\n @request-selected=',"\n >\n <span\n >",'</span\n >\n <ha-svg-icon\n slot="graphic"\n .path=',"\n ></ha-svg-icon>\n </mwc-list-item>\n "]);return ht=function(){return e},e}function pt(){var e=Ct(["\n <mwc-icon-button\n .label=","\n @click=","\n >\n <ha-svg-icon\n .path=","\n ></ha-svg-icon>\n </mwc-icon-button>\n "]);return pt=function(){return e},e}function mt(){var e=Ct(["\n \x3c!-- Enabled for IoB --\x3e\n ","\n ",'\n <ha-button-menu corner="BOTTOM_START">\n <mwc-icon-button\n slot="trigger"\n .label=','\n .title="','"\n >\n <ha-svg-icon .path=',"></ha-svg-icon>\n </mwc-icon-button>\n ","\n ","\n ","\n ",'\n <a\n href="','"\n rel="noreferrer"\n class="menu-link"\n target="_blank"\n >\n <mwc-list-item\n graphic="icon"\n aria-label=',"\n >\n ",'\n <ha-svg-icon\n slot="graphic"\n .path=',"\n ></ha-svg-icon>\n </mwc-list-item>\n </a>\n </ha-button-menu>\n "]);return mt=function(){return e},e}function vt(){var e=Ct(["<div main-title>","</div>"]);return vt=function(){return e},e}function yt(){var e=Ct(['\n <ha-icon\n title="','"\n .icon="','"\n ></ha-icon>\n ']);return yt=function(){return e},e}function bt(){var e=Ct(['\n <paper-tab\n aria-label="','"\n class="','"\n >\n ',"\n </paper-tab>\n "]);return bt=function(){return e},e}function gt(){var e=Ct(['\n <ha-tabs\n scrollable\n .selected="','"\n @iron-activate="','"\n dir="','"\n >\n ',"\n </ha-tabs>\n "]);return gt=function(){return e},e}function wt(){var e=Ct(["\n <app-toolbar>\n \x3c!-- Disabled for IoB --\x3e\n \x3c!--ha-menu-button\n .hass=","\n .narrow=","\n ></ha-menu-button--\x3e\n ","\n ","\n </app-toolbar>\n "]);return wt=function(){return e},e}function kt(){var e=Ct(["\n <mwc-list-item\n aria-label=",'\n @request-selected="','"\n >\n ',"\n </mwc-list-item>\n "]);return kt=function(){return e},e}function _t(){var e=Ct(['\n <app-toolbar class="edit-mode">\n <mwc-icon-button\n .label="','"\n title="','"\n @click="','"\n >\n <ha-svg-icon .path=',"></ha-svg-icon>\n </mwc-icon-button>\n <div main-title>\n ",'\n <mwc-icon-button\n aria-label="','"\n title="','"\n class="edit-icon"\n @click="','"\n >\n <ha-svg-icon .path=','></ha-svg-icon>\n </mwc-icon-button>\n </div>\n <a\n href="','"\n rel="noreferrer"\n class="menu-link"\n target="_blank"\n >\n <mwc-icon-button\n title="','"\n >\n <ha-svg-icon .path=','></ha-svg-icon>\n </mwc-icon-button>\n </a>\n <ha-button-menu corner="BOTTOM_START">\n <mwc-icon-button\n slot="trigger"\n .title="','"\n .label=',"\n >\n <ha-svg-icon .path=","></ha-svg-icon>\n </mwc-icon-button>\n ",'\n <mwc-list-item @request-selected="','">\n ',"\n </mwc-list-item>\n </ha-button-menu>\n </app-toolbar>\n "]);return _t=function(){return e},e}function Et(){var e=Ct(['\n \x3c!-- Inserted for IoB --\x3e\n <notification-drawer .hass="','"></notification-drawer>\n\n <ha-app-layout id="layout">\n <app-header\n slot="header"\n effects="waterfall"\n class=',"\n fixed\n condenses\n >\n ","\n ",'\n </app-header>\n <div id="view" @ll-rebuild="','"></div>\n </ha-app-layout>\n ']);return Et=function(){return e},e}function Ct(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Pt(e,t){return(Pt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Bt(e);if(t){var i=Bt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ot(this,n)}}function Ot(e,t){return!t||"object"!==Ye(t)&&"function"!=typeof t?St(e):t}function St(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jt(){jt=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!Tt(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return Mt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mt(e,t):void 0}}(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=It(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:Rt(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=Rt(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function Dt(e){var t,n=It(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function At(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function Tt(e){return e.decorators&&e.decorators.length}function zt(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function Rt(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function It(e){var t=function(e,t){if("object"!==Ye(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ye(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ye(t)?t:String(t)}function Mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ft(e,t,n){return(Ft="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Bt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function Bt(e){return(Bt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Nt=function(e,t,n,r){var i=jt();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(zt(o.descriptor)||zt(i.descriptor)){if(Tt(o)||Tt(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(Tt(o)){if(Tt(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}At(o,i)}else t.push(o)}return t}(a.d.map(Dt)),e);return i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}(null,(function(e,t){var r=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pt(e,t)}(r,t);var n=xt(r);function r(){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),t=n.call(this),e(St(t)),t._debouncedConfigChanged=(0,k.D)((function(){return t._selectView(t._curView,!0)}),100,!1),t}return r}(t);return{F:r,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value:function(){return!1}},{kind:"field",decorators:[(0,o.Cb)()],key:"route",value:void 0},{kind:"field",decorators:[(0,o.sz)()],key:"_curView",value:void 0},{kind:"field",decorators:[(0,o.IO)("ha-app-layout",!0)],key:"_appLayout",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"_persistentNotifications",value:void 0},{kind:"field",key:"_unsubNotifications",value:void 0},{kind:"field",key:"_viewCache",value:void 0},{kind:"field",key:"_debouncedConfigChanged",value:void 0},{kind:"field",key:"_conversation",value:function(){var e=this;return(0,v.Z)((function(t){return"webkitSpeechRecognition"in window&&(0,y.p)(e.hass,"conversation")}))}},{kind:"method",key:"connectedCallback",value:function(){var e=this;Ft(Bt(r.prototype),"connectedCallback",this).call(this),this._unsubNotifications=(0,Xe.r)(this.hass.connection,(function(t){e._persistentNotifications=t?t.length:0}))}},{kind:"method",key:"disconnectedCallback",value:function(){Ft(Bt(r.prototype),"disconnectedCallback",this).call(this),this._unsubNotifications&&this._unsubNotifications()}},{kind:"method",key:"render",value:function(){var e,t,n,r=this;return(0,o.dy)(Et(),this.hass,(0,m.$)({"edit-mode":this._editMode}),this._editMode?(0,o.dy)(_t(),this.hass.localize("ui.panel.lovelace.menu.exit_edit_mode"),this.hass.localize("ui.panel.lovelace.menu.close"),this._editModeDisable,p.r5M,this.config.title||this.hass.localize("ui.panel.lovelace.editor.header"),this.hass.localize("ui.panel.lovelace.editor.edit_lovelace.edit_title"),this.hass.localize("ui.panel.lovelace.editor.edit_lovelace.edit_title"),this._editLovelace,p.r9,(0,q.R)(this.hass,"/lovelace/"),this.hass.localize("ui.panel.lovelace.menu.help"),p.Xc_,this.hass.localize("ui.panel.lovelace.editor.menu.open"),this.hass.localize("ui.panel.lovelace.editor.menu.open"),p.SXi,(0,o.dy)(kt(),this.hass.localize("ui.panel.lovelace.unused_entities.title"),this._handleUnusedEntities,this.hass.localize("ui.panel.lovelace.unused_entities.title")),this._handleRawEditor,this.hass.localize("ui.panel.lovelace.editor.menu.raw_editor")):(0,o.dy)(wt(),this.hass,this.narrow,this.lovelace.config.views.length>1?(0,o.dy)(gt(),this._curView,this._handleViewSelected,(0,w.Zu)(this.hass),this.lovelace.config.views.map((function(e){return(0,o.dy)(bt(),e.title,(0,m.$)({"hide-tab":Boolean(void 0!==e.visible&&(Array.isArray(e.visible)&&!e.visible.some((function(e){return e.user===r.hass.user.id}))||!1===e.visible))}),e.icon?(0,o.dy)(yt(),e.title,e.icon):e.title||"Unnamed view")}))):(0,o.dy)(vt(),this.config.title),this._hideToolbar?this.renderNotificationButton(!0):(0,o.dy)(mt(),this.renderNotificationButton(),!this.narrow&&this._conversation(this.hass.config.components)?(0,o.dy)(pt(),this.hass.localize("ui.panel.lovelace.menu.start_conversation"),this._showVoiceCommandDialog,p.N3O):"",this.hass.localize("ui.panel.lovelace.editor.menu.open"),this.hass.localize("ui.panel.lovelace.editor.menu.open"),p.SXi,this.narrow&&this._conversation(this.hass.config.components)?(0,o.dy)(ht(),this.hass.localize("ui.panel.lovelace.menu.start_conversation"),this._showVoiceCommandDialog,this.hass.localize("ui.panel.lovelace.menu.start_conversation"),p.N3O):"",this._yamlMode?(0,o.dy)(ft(),this.hass.localize("ui.panel.lovelace.menu.refresh"),this._handleRefresh,this.hass.localize("ui.panel.lovelace.menu.refresh"),p.jcD,this.hass.localize("ui.panel.lovelace.unused_entities.title"),this._handleUnusedEntities,this.hass.localize("ui.panel.lovelace.unused_entities.title"),p.RIj):"","yaml"===(null===(e=this.hass.panels.lovelace)||void 0===e||null===(t=e.config)||void 0===t?void 0:t.mode)?(0,o.dy)(dt(),this.hass.localize("ui.panel.lovelace.menu.reload_resources"),this._handleReloadResources,this.hass.localize("ui.panel.lovelace.menu.reload_resources"),p.jcD):"",(null===(n=this.hass.user)||void 0===n?void 0:n.is_admin)&&!this.hass.config.safe_mode?(0,o.dy)(ut(),this.hass.localize("ui.panel.lovelace.menu.configure_ui"),this._handleEnableEditMode,this.hass.localize("ui.panel.lovelace.menu.configure_ui"),p.Shd):"",(0,q.R)(this.hass,"/lovelace/"),this.hass.localize("ui.panel.lovelace.menu.help"),this.hass.localize("ui.panel.lovelace.menu.help"),p.HET)),this._editMode?(0,o.dy)(lt(),this._curView,this._handleViewSelected,(0,w.Zu)(this.hass),this.lovelace.config.views.map((function(e){return(0,o.dy)(ct(),e.title,(0,m.$)({"hide-tab":Boolean(!r._editMode&&void 0!==e.visible&&(Array.isArray(e.visible)&&!e.visible.some((function(e){return e.user===r.hass.user.id}))||!1===e.visible))}),r._editMode?(0,o.dy)(st(),r.hass.localize("ui.panel.lovelace.editor.edit_view.move_left"),r._moveViewLeft,0===r._curView):"",e.icon?(0,o.dy)(at(),e.title,e.icon):e.title||"Unnamed view",r._editMode?(0,o.dy)(ot(),r.hass.localize("ui.panel.lovelace.editor.edit_view.edit"),p.r9,r._editView,r.hass.localize("ui.panel.lovelace.editor.edit_view.move_right"),r._moveViewRight,r._curView+1===r.lovelace.config.views.length):"")})),this._editMode?(0,o.dy)(it(),this._addView,this.hass.localize("ui.panel.lovelace.editor.edit_view.add"),p.qX5):""):"",this._debouncedConfigChanged)}},{kind:"field",key:"_isVisible",value:function(){var e=this;return function(t){return Boolean(e._editMode||void 0===t.visible||!0===t.visible||Array.isArray(t.visible)&&t.visible.some((function(t){var n;return t.user===(null===(n=e.hass.user)||void 0===n?void 0:n.id)})))}}},{kind:"method",key:"updated",value:function(e){var t=this;Ft(Bt(r.prototype),"updated",this).call(this,e);var n,i=this._viewRoot.lastChild;e.has("hass")&&i&&(i.hass=this.hass),e.has("narrow")&&i&&(i.narrow=this.narrow);var o=!1,a=this.route.path.split("/")[1];if(e.has("route")){var s=this.config.views;if(!a&&s.length)n=s.findIndex(this._isVisible),(0,g.c)(this,"".concat(this.route.prefix,"/").concat(s[n].path||n),!0);else if("hass-unused-entities"===a)n="hass-unused-entities";else if(a){for(var c=a,l=Number(c),u=0,f=0;f<s.length;f++)if(s[f].path===c||f===l){u=f;break}n=u}}if(e.has("lovelace")){var h=e.get("lovelace");if(h&&h.config===this.lovelace.config||(o=!0),!h||h.editMode!==this.lovelace.editMode){var p=this.config&&this.config.views;(0,d.B)(this,"iron-resize"),"storage"===this.lovelace.mode&&"hass-unused-entities"===a&&(n=p.findIndex(this._isVisible),(0,g.c)(this,"".concat(this.route.prefix,"/").concat(p[n].path||n),!0))}!o&&i&&(i.lovelace=this.lovelace)}(void 0!==n||o)&&(o&&void 0===n&&(n=this._curView),(0,_.T)((function(){return t._selectView(n,o)})))}},{kind:"method",key:"renderNotificationButton",value:function(e){return(0,o.dy)(rt(),this.hass.localize("ui.notification_drawer.title"),this._handleShowNotificationDrawer,p.Kox,this._notificationsCount>0?(0,o.dy)(nt(),this._notificationsCount):"",e&&this._conversation(this.hass.config.components)?(0,o.dy)(tt(),this._showVoiceCommandDialog,p.N3O):"")}},{kind:"get",key:"_notificationsCount",value:function(){var e=this.hass.states,t=Object.keys(e).filter((function(e){return"configurator"===e.substr(0,e.indexOf("."))})).map((function(t){return e[t]})).length;return(this._persistentNotifications||0)+t}},{kind:"get",key:"_hideToolbar",value:function(){return!0===this.config.hideToolbar&&-1===window.location.search.indexOf("toolbar")}},{kind:"method",key:"_handleShowNotificationDrawer",value:function(){(0,Ke.d)(this,{narrow:this.narrow})}},{kind:"get",key:"config",value:function(){return this.lovelace.config}},{kind:"get",key:"_yamlMode",value:function(){return"yaml"===this.lovelace.mode}},{kind:"get",key:"_editMode",value:function(){return this.lovelace.editMode}},{kind:"get",key:"_layout",value:function(){return this.shadowRoot.getElementById("layout")}},{kind:"get",key:"_viewRoot",value:function(){return this.shadowRoot.getElementById("view")}},{kind:"method",key:"_handleRefresh",value:function(e){(0,b.Q)(e)&&(0,d.B)(this,"config-refresh")}},{kind:"method",key:"_handleReloadResources",value:function(e){(0,b.Q)(e)&&(this.hass.callService("lovelace","reload_resources"),(0,V.g7)(this,{title:this.hass.localize("ui.panel.lovelace.reload_resources.refresh_header"),text:this.hass.localize("ui.panel.lovelace.reload_resources.refresh_body"),confirm:function(){return location.reload()}}))}},{kind:"method",key:"_handleRawEditor",value:function(e){(0,b.Q)(e)&&this.lovelace.enableFullEditMode()}},{kind:"method",key:"_handleUnusedEntities",value:function(e){var t;(0,b.Q)(e)&&(0,g.c)(this,"".concat(null===(t=this.route)||void 0===t?void 0:t.prefix,"/hass-unused-entities"))}},{kind:"method",key:"_showVoiceCommandDialog",value:function(){(0,U._)(this)}},{kind:"method",key:"_handleEnableEditMode",value:function(e){(0,b.Q)(e)&&(this._yamlMode?(0,V.Ys)(this,{text:"The edit UI is not available when in YAML mode."}):this._enableEditMode())}},{kind:"method",key:"_enableEditMode",value:function(){this.lovelace.setEditMode(!0)}},{kind:"method",key:"_editModeDisable",value:function(){this.lovelace.setEditMode(!1)}},{kind:"method",key:"_editLovelace",value:function(){H(this,this.lovelace)}},{kind:"method",key:"_editView",value:function(){J(this,{lovelace:this.lovelace,viewIndex:this._curView})}},{kind:"method",key:"_moveViewLeft",value:function(){if(0!==this._curView){var e=this.lovelace,t=this._curView,n=this._curView-1;this._curView=n,e.saveConfig((0,W.mA)(e.config,t,n))}}},{kind:"method",key:"_moveViewRight",value:function(){if(this._curView+1!==this.lovelace.config.views.length){var e=this.lovelace,t=this._curView,n=this._curView+1;this._curView=n,e.saveConfig((0,W.mA)(e.config,t,n))}}},{kind:"method",key:"_addView",value:function(){var e=this;J(this,{lovelace:this.lovelace,saveCallback:function(t,n){var r,i=n.path||t;(0,g.c)(e,"".concat(null===(r=e.route)||void 0===r?void 0:r.prefix,"/").concat(i))}})}},{kind:"method",key:"_handleViewSelected",value:function(e){var t,n,r,i,o,a,s,c=e.detail.selected;if(c!==this._curView){var l,u=this.config.views[c].path||c;(0,g.c)(this,"".concat(null===(l=this.route)||void 0===l?void 0:l.prefix,"/").concat(u))}t=this,n=this._layout.header.scrollTarget,r=n,i=Math.random(),o=Date.now(),a=r.scrollTop,s=0-a,t._currentAnimationId=i,function e(){var n,c=Date.now()-o;c>200?r.scrollTop=0:t._currentAnimationId===i&&(r.scrollTop=(n=c,-s*(n/=200)*(n-2)+a),requestAnimationFrame(e.bind(t)))}.call(t)}},{kind:"method",key:"_selectView",value:function(e,t){var r=this;if(t||this._curView!==e){e=void 0===e?0:e,this._curView=e,t&&(this._viewCache={});var i,o=this._viewRoot;if(o.lastChild&&o.removeChild(o.lastChild),"hass-unused-entities"===e){var a=document.createElement("hui-unused-entities");return Promise.all([n.e(9119),n.e(5755),n.e(9494),n.e(7164),n.e(2899),n.e(5804),n.e(1929)]).then(n.bind(n,28279)).then((function(){a.hass=r.hass,a.lovelace=r.lovelace,a.narrow=r.narrow})),void o.appendChild(a)}var s=this.config.views[e];if(s){!t&&this._viewCache[e]?i=this._viewCache[e]:((i=document.createElement("hui-view")).index=e,this._viewCache[e]=i),i.lovelace=this.lovelace,i.hass=this.hass,i.narrow=this.narrow;var c=s.background||this.config.background;c?this._appLayout.style.setProperty("--lovelace-background",c):this._appLayout.style.removeProperty("--lovelace-background"),o.appendChild(i),(0,d.B)(this,"iron-resize")}else this._enableEditMode()}}},{kind:"get",static:!0,key:"styles",value:function(){return[L.Qx,(0,o.iv)(et())]}}]}}),o.oi);function Vt(e){return(Vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ut(e){return function(e){if(Array.isArray(e))return cn(e)}(e)||ln(e)||sn(e)||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 Lt(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,i)}function qt(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Lt(o,r,i,a,s,"next",e)}function s(e){Lt(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Wt(){var e=Zt(["\n <hass-loading-screen\n rootnav\n .hass=","\n .narrow=","\n ></hass-loading-screen>\n "]);return Wt=function(){return e},e}function $t(){var e=Zt(["\n <hui-editor\n .hass=",'\n .lovelace="','"\n .closeEditor="','"\n ></hui-editor>\n ']);return $t=function(){return e},e}function Qt(){var e=Zt(['\n <hass-error-screen\n title="','"\n .error="','"\n >\n <mwc-button raised @click=',">\n ","\n </mwc-button>\n </hass-error-screen>\n "]);return Qt=function(){return e},e}function Ht(){var e=Zt(["\n <hui-root\n .hass=","\n .lovelace=","\n .route=","\n .narrow=","\n @config-refresh=","\n ></hui-root>\n "]);return Ht=function(){return e},e}function Zt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Gt(e,t){return(Gt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=dn(e);if(t){var i=dn(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Xt(this,n)}}function Xt(e,t){return!t||"object"!==Vt(t)&&"function"!=typeof t?Kt(e):t}function Kt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yt(){Yt=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var i=t.placement;if(t.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!nn(e))return n.push(e);var t=this.decorateElement(e,i);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:n,finishers:r};var o=this.decorateConstructor(n,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],i=e.decorators,o=i.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],t);n.push.apply(n,l)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||ln(t)||sn(t)||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.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=an(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:on(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=on(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function en(e){var t,n=an(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function tn(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function nn(e){return e.decorators&&e.decorators.length}function rn(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function on(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function an(e){var t=function(e,t){if("object"!==Vt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Vt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Vt(t)?t:String(t)}function sn(e,t){if(e){if("string"==typeof e)return cn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cn(e,t):void 0}}function cn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ln(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function un(e,t,n){return(un="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=dn(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function dn(e){return(dn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}customElements.define("hui-root",Nt),window.loadCardHelpers=function(){return Promise.all([n.e(4909),n.e(319),n.e(7250),n.e(3552),n.e(2016),n.e(9686)]).then(n.bind(n,49686))};var fn=!1,hn=!1,pn=function(e,t,n,r){var i=Yt();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),n),s=i.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var i,o=e[r];if("method"===o.kind&&(i=t.find(n)))if(rn(o.descriptor)||rn(i.descriptor)){if(nn(o)||nn(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(nn(o)){if(nn(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}tn(o,i)}else t.push(o)}return t}(a.d.map(en)),e);return i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}(null,(function(e,t){var r,p,m,v=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gt(e,t)}(r,t);var n=Jt(r);function r(){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),t=n.call(this),e(Kt(t)),t._closeEditor=t._closeEditor.bind(Kt(t)),t}return r}(t);return{F:v,d:[{kind:"field",decorators:[(0,o.Cb)()],key:"panel",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"narrow",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"route",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"_state",value:function(){return"loading"}},{kind:"field",decorators:[(0,o.sz)()],key:"_errorMsg",value:void 0},{kind:"field",decorators:[(0,o.sz)()],key:"lovelace",value:void 0},{kind:"field",key:"_ignoreNextUpdateEvent",value:function(){return!1}},{kind:"field",key:"_fetchConfigOnConnect",value:function(){return!1}},{kind:"field",key:"_unsubUpdates",value:void 0},{kind:"method",key:"connectedCallback",value:function(){un(dn(v.prototype),"connectedCallback",this).call(this),this.lovelace&&this.hass&&this.lovelace.language!==this.hass.language?this._setLovelaceConfig(this.lovelace.config,this.lovelace.mode):this.lovelace&&"generated"===this.lovelace.mode?(this._state="loading",this._regenerateConfig()):this._fetchConfigOnConnect&&this._fetchConfig(!1)}},{kind:"method",key:"disconnectedCallback",value:function(){un(dn(v.prototype),"disconnectedCallback",this).call(this),null!==this.urlPath&&this._unsubUpdates&&this._unsubUpdates()}},{kind:"method",key:"render",value:function(){var e=this._state;return"loaded"===e?(0,o.dy)(Ht(),this.hass,this.lovelace,this.route,this.narrow,this._forceFetchConfig):"error"===e?(0,o.dy)(Qt(),(0,a.Lh)(this.hass.localize,"lovelace"),this._errorMsg,this._forceFetchConfig,this.hass.localize("ui.panel.lovelace.reload_lovelace")):"yaml-editor"===e?(0,o.dy)($t(),this.hass,this.lovelace,this._closeEditor):(0,o.dy)(Wt(),this.hass,this.narrow)}},{kind:"method",key:"firstUpdated",value:function(){var e=this;this._fetchConfig(!1),this._unsubUpdates||this._subscribeUpdates(),window.addEventListener("connection-status",(function(t){"connected"===t.detail&&e._fetchConfig(!1)}))}},{kind:"method",key:"_regenerateConfig",value:(m=qt(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.UO)(this.hass);case 2:t=e.sent,this._setLovelaceConfig(t,"generated"),this._state="loaded";case 5:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{kind:"method",key:"_subscribeUpdates",value:(p=qt(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,s.Gc)(this.hass.connection,this.urlPath,(function(){return t._lovelaceChanged()}));case 2:this._unsubUpdates=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{kind:"method",key:"_closeEditor",value:function(){this._state="loaded"}},{kind:"method",key:"_lovelaceChanged",value:function(){var e=this;this._ignoreNextUpdateEvent?this._ignoreNextUpdateEvent=!1:this.isConnected?(0,c.C)(this,{message:this.hass.localize("ui.panel.lovelace.changed_toast.message"),action:{action:function(){return e._fetchConfig(!1)},text:this.hass.localize("ui.panel.lovelace.changed_toast.refresh")},duration:0,dismissable:!1}):this._fetchConfigOnConnect=!0}},{kind:"get",key:"urlPath",value:function(){return"lovelace"===this.panel.url_path?null:this.panel.url_path}},{kind:"method",key:"_forceFetchConfig",value:function(){this._fetchConfig(!0)}},{kind:"method",key:"_fetchConfig",value:(r=qt(regeneratorRuntime.mark((function e(t){var n,r,i,o,a,c=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.panel.config.mode,(o=window).llConfProm&&(i=o.llConfProm,o.llConfProm=void 0),hn||(hn=!0,(o.llConfProm||(0,s.eL)(this.hass.connection)).then((function(e){return(0,u.k)(e,c.hass.auth.data.hassUrl)}))),null===this.urlPath&&i||(this.lovelace&&"yaml"===this.lovelace.mode&&(this._ignoreNextUpdateEvent=!0),i=(0,s.Q2)(this.hass.connection,this.urlPath,t)),e.prev=5,e.next=8,i;case 8:n=e.sent,e.next=25;break;case 11:if(e.prev=11,e.t0=e.catch(5),"config_not_found"===e.t0.code){e.next=18;break}return console.log(e.t0),this._state="error",this._errorMsg=e.t0.message,e.abrupt("return");case 18:return e.next=20,this.hass.loadBackendTranslation("title");case 20:return a=e.sent,e.next=23,(0,l.UO)(this.hass,a);case 23:n=e.sent,r="generated";case 25:return e.prev=25,this.lovelace&&"yaml"===this.lovelace.mode&&setTimeout((function(){c._ignoreNextUpdateEvent=!1}),2e3),e.finish(25);case 28:this._state="loaded",this._setLovelaceConfig(n,r);case 30:case"end":return e.stop()}}),e,this,[[5,11,25,28]])}))),function(e){return r.apply(this,arguments)})},{kind:"method",key:"_checkLovelaceConfig",value:function(e){var t=Object.isFrozen(e)?void 0:e;return e.views.forEach((function(n,r){n.badges&&!n.badges.every(Boolean)&&((t=t||Object.assign({},e,{views:Ut(e.views)})).views[r]=Object.assign({},n),t.views[r].badges=n.badges.filter(Boolean))})),t?i()(t):e}},{kind:"method",key:"_setLovelaceConfig",value:function(e,t){var r=this;e=this._checkLovelaceConfig(e);var i,o,a=this.urlPath;this.lovelace={config:e,mode:t,urlPath:this.urlPath,editMode:!!this.lovelace&&this.lovelace.editMode,language:this.hass.language,enableFullEditMode:function(){fn||(fn=!0,Promise.all([n.e(4268),n.e(9033),n.e(1572),n.e(3822),n.e(2747)]).then(n.bind(n,95912))),r._state="yaml-editor"},setEditMode:function(e){var t,i;e&&"generated"===r.lovelace.mode?(t=r,i={lovelace:r.lovelace,mode:r.panel.config.mode},h||(h=!0,(0,d.B)(t,"register-dialog",{dialogShowEvent:f,dialogTag:"hui-dialog-save-config",dialogImport:function(){return Promise.all([n.e(3641),n.e(6372),n.e(9033),n.e(1572),n.e(4821),n.e(3822),n.e(8900),n.e(4538)]).then(n.bind(n,78082))}})),(0,d.B)(t,f,i)):r._updateLovelace({editMode:e})},saveConfig:(o=qt(regeneratorRuntime.mark((function e(t){var n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.lovelace,i=n.config,o=n.mode,t=r._checkLovelaceConfig(t),e.prev=2,r._updateLovelace({config:t,mode:"storage"}),r._ignoreNextUpdateEvent=!0,e.next=7,(0,s.Oh)(r.hass,a,t);case 7:e.next=14;break;case 9:throw e.prev=9,e.t0=e.catch(2),console.error(e.t0),r._updateLovelace({config:i,mode:o}),e.t0;case 14:case"end":return e.stop()}}),e,null,[[2,9]])}))),function(e){return o.apply(this,arguments)}),deleteConfig:(i=qt(regeneratorRuntime.mark((function e(){var t,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.lovelace,n=t.config,i=t.mode,e.prev=1,e.next=4,r.hass.loadBackendTranslation("title");case 4:return o=e.sent,e.t0=r,e.next=8,(0,l.UO)(r.hass,o);case 8:return e.t1=e.sent,e.t2={config:e.t1,mode:"generated",editMode:!1},e.t0._updateLovelace.call(e.t0,e.t2),r._ignoreNextUpdateEvent=!0,e.next=14,(0,s.vj)(r.hass,a);case 14:e.next=21;break;case 16:throw e.prev=16,e.t3=e.catch(1),console.error(e.t3),r._updateLovelace({config:n,mode:i}),e.t3;case 21:case"end":return e.stop()}}),e,null,[[1,16]])}))),function(){return i.apply(this,arguments)})}}},{kind:"method",key:"_updateLovelace",value:function(e){this.lovelace=Object.assign({},this.lovelace,e)}}]}}),o.oi);customElements.define("ha-panel-lovelace",pn)},27322:function(e,t,n){"use strict";n.d(t,{R:function(){return r}});var r=function(e,t){return"https://www.iobroker.net/#".concat(e.language&&e.language.split("-")[0]||"en","/adapters/adapterref/iobroker.lovelace/README.md")}}}]);
//# sourceMappingURL=chunk.5d13b4400c9057e95605.js.map