UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

185 lines (166 loc) 40.2 kB
/*! For license information please see chunk.0b0c4bff38caf19c8906.js.LICENSE.txt */ (self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[177],{43274:(e,t,r)=>{"use strict";r.d(t,{Sb:()=>n,BF:()=>i,Op:()=>o});const n=function(){try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}return!1}(),i=function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}return!1}(),o=function(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}return!1}()},12198:(e,t,r)=>{"use strict";r.d(t,{p:()=>i});var n=r(68928);const i=r(43274).Sb?(e,t)=>e.toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"}):e=>(0,n.WU)(e,"longDate")},44583:(e,t,r)=>{"use strict";r.d(t,{o:()=>o,E:()=>a});var n=r(68928),i=r(43274);const o=i.Op?(e,t)=>e.toLocaleString(t,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}):e=>(0,n.WU)(e,"MMMM D, YYYY, HH:mm"),a=i.Op?(e,t)=>e.toLocaleString(t,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"}):e=>(0,n.WU)(e,"MMMM D, YYYY, HH:mm:ss")},49684:(e,t,r)=>{"use strict";r.d(t,{m:()=>o,V:()=>a});var n=r(68928),i=r(43274);const o=i.BF?(e,t)=>e.toLocaleTimeString(t,{hour:"numeric",minute:"2-digit"}):e=>(0,n.WU)(e,"shortTime"),a=i.BF?(e,t)=>e.toLocaleTimeString(t,{hour:"numeric",minute:"2-digit",second:"2-digit"}):e=>(0,n.WU)(e,"mediumTime")},29171:(e,t,r)=>{"use strict";r.d(t,{D:()=>l});var n=r(56007),i=r(12198),o=r(44583),a=r(49684),s=r(22311);const l=(e,t,r,l)=>{const c=void 0!==l?l:t.state;if(c===n.lz||c===n.nZ)return e("state.default."+c);if(t.attributes.unit_of_measurement)return`${c} ${t.attributes.unit_of_measurement}`;const d=(0,s.N)(t);if("input_datetime"===d){let e;if(!t.attributes.has_time)return e=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day),(0,i.p)(e,r);if(!t.attributes.has_date){const n=new Date;return e=new Date(n.getFullYear(),n.getMonth(),n.getDay(),t.attributes.hour,t.attributes.minute),(0,a.m)(e,r)}return e=new Date(t.attributes.year,t.attributes.month-1,t.attributes.day,t.attributes.hour,t.attributes.minute),(0,o.o)(e,r)}return"humidifier"===d&&"on"===c&&t.attributes.humidity?t.attributes.humidity+"%":t.attributes.device_class&&e(`component.${d}.state.${t.attributes.device_class}.${c}`)||e(`component.${d}.state._.${c}`)||c}},22311:(e,t,r)=>{"use strict";r.d(t,{N:()=>i});var n=r(58831);const i=e=>(0,n.M)(e.entity_id)},44491:(e,t,r)=>{"use strict";var n=r(15652),i=r(55317),o=r(44583),a=(r(53918),r(81689),r(52039),r(30879),r(54567),r(82297)),s=r(28461),l=r(67365),c=r.n(l),d=r(11496),p=r(47181),u=r(87466);function f(){f=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!y(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],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),l=this.toElementFinisherExtras((0,i[o])(s)||s);e=l.element,this.addElementPlacement(e,t),l.finisher&&n.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.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:r}},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 r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?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 r=b(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)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 "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,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 r=g(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function h(e){var t,r=b(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 n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function m(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 v(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function g(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function b(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const w=a.Z.extend({props:{twentyfourHours:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},ranges:{type:Boolean,default:!0},startDate:{type:[String,Date],default:()=>new Date},endDate:{type:[String,Date],default:()=>new Date}},render(e){return e(c(),{props:{"time-picker":!0,"auto-apply":!1,opens:"right","show-dropdowns":!1,"time-picker24-hour":this.twentyfourHours,disabled:this.disabled,ranges:!!this.ranges&&{}},model:{value:{startDate:this.startDate,endDate:this.endDate},callback:e=>{(0,p.B)(this.$el,"change",e)},expression:"dateRange"},scopedSlots:{input:()=>e("slot",{domProps:{name:"input"}}),header:()=>e("slot",{domProps:{name:"header"}}),ranges:()=>e("slot",{domProps:{name:"ranges"}}),footer:()=>e("slot",{domProps:{name:"footer"}})}})}}),E=(0,s.Z)(a.Z,w);!function(e,t,r,n){var i=f();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(v(o.descriptor)||v(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}m(o,i)}else t.push(o)}return t}(a.d.map(h)),e);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,u.Mo)("date-range-picker")],(function(e,t){return{F:class extends t{constructor(){super(),e(this);const t=document.createElement("style");t.innerHTML=`\n ${d.Z}\n .calendars {\n display: flex;\n }\n .daterangepicker {\n left: 0px !important;\n top: auto;\n background-color: var(--card-background-color);\n border: none;\n border-radius: var(--ha-card-border-radius, 4px);\n box-shadow: var(\n --ha-card-box-shadow,\n 0px 2px 1px -1px rgba(0, 0, 0, 0.2),\n 0px 1px 1px 0px rgba(0, 0, 0, 0.14),\n 0px 1px 3px 0px rgba(0, 0, 0, 0.12)\n );\n color: var(--primary-text-color);\n min-width: initial !important;\n }\n .daterangepicker:after {\n border-bottom: 6px solid var(--card-background-color);\n }\n .daterangepicker .calendar-table {\n background-color: var(--card-background-color);\n border: none;\n }\n .daterangepicker .calendar-table td,\n .daterangepicker .calendar-table th {\n background-color: transparent;\n color: var(--secondary-text-color);\n border-radius: 0;\n outline: none;\n width: 32px;\n height: 32px;\n }\n .daterangepicker td.off,\n .daterangepicker td.off.end-date,\n .daterangepicker td.off.in-range,\n .daterangepicker td.off.start-date {\n background-color: var(--secondary-background-color);\n color: var(--disabled-text-color);\n }\n .daterangepicker td.in-range {\n background-color: var(--light-primary-color);\n color: var(--text-light-primary-color, var(--primary-text-color));\n }\n .daterangepicker td.active,\n .daterangepicker td.active:hover {\n background-color: var(--primary-color);\n color: var(--text-primary-color);\n }\n .daterangepicker td.start-date.end-date {\n border-radius: 50%;\n }\n .daterangepicker td.start-date {\n border-radius: 50% 0 0 50%;\n }\n .daterangepicker td.end-date {\n border-radius: 0 50% 50% 0;\n }\n .reportrange-text {\n background: none !important;\n padding: 0 !important;\n border: none !important;\n }\n .daterangepicker .calendar-table .next span,\n .daterangepicker .calendar-table .prev span {\n border: solid var(--primary-text-color);\n border-width: 0 2px 2px 0;\n }\n .daterangepicker .ranges li {\n outline: none;\n }\n .daterangepicker .ranges li:hover {\n background-color: var(--secondary-background-color);\n }\n .daterangepicker .ranges li.active {\n background-color: var(--primary-color);\n color: var(--text-primary-color);\n }\n .daterangepicker select.ampmselect,\n .daterangepicker select.hourselect,\n .daterangepicker select.minuteselect,\n .daterangepicker select.secondselect {\n background: transparent;\n border: 1px solid var(--divider-color);\n color: var(--primary-color);\n }\n .daterangepicker .drp-buttons .btn {\n border: 1px solid var(--primary-color);\n background-color: transparent;\n color: var(--primary-color);\n border-radius: 4px;\n padding: 8px;\n cursor: pointer;\n }\n .calendars-container {\n flex-direction: column;\n align-items: center;\n }\n .drp-calendar.col.right .calendar-table {\n display: none;\n }\n .daterangepicker.show-ranges .drp-calendar.left {\n border-left: 0px;\n }\n .daterangepicker .drp-calendar.left {\n padding: 8px;\n }\n .daterangepicker.show-calendar .ranges {\n margin-top: 0;\n padding-top: 8px;\n border-right: 1px solid var(--divider-color);\n }\n @media only screen and (max-width: 800px) {\n .calendars {\n flex-direction: column;\n }\n }\n .calendar-table {\n padding: 0 !important;\n } \n `;const r=this.shadowRoot;r.appendChild(t),r.addEventListener("click",(e=>e.stopPropagation()))}},d:[]}}),E);var x=r(87744);function D(){D=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!S(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],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),l=this.toElementFinisherExtras((0,i[o])(s)||s);e=l.element,this.addElementPlacement(e,t),l.finisher&&n.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.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:r}},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 T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(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 r=z(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)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 "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,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:A(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 r=A(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function P(e){var t,r=z(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 n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function C(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function S(e){return e.decorators&&e.decorators.length}function _(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function A(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function z(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}!function(e,t,r,n){var i=D();if(n)for(var o=0;o<n.length;o++)i=n[o](i);var a=t((function(e){i.initializeInstanceElements(e,s.elements)}),r),s=i.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(_(o.descriptor)||_(i.descriptor)){if(S(o)||S(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(S(o)){if(S(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}C(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,n.Mo)("ha-date-range-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"startDate",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"endDate",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"ranges",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"_hour24format",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"_rtlDirection",value:()=>"ltr"},{kind:"method",key:"updated",value:function(e){if(e.has("hass")){const t=e.get("hass");t&&t.language===this.hass.language||(this._hour24format=this._compute24hourFormat(),this._rtlDirection=(0,x.Zu)(this.hass))}}},{kind:"method",key:"render",value:function(){return n.dy` <date-range-picker ?disabled=${this.disabled} twentyfour-hours=${this._hour24format} start-date=${this.startDate} end-date=${this.endDate} ?ranges=${void 0!==this.ranges} > <div slot="input" class="date-range-inputs"> <ha-svg-icon .path=${i.xnT}></ha-svg-icon> <paper-input .value=${(0,o.o)(this.startDate,this.hass.language)} .label=${this.hass.localize("ui.components.date-range-picker.start_date")} .disabled=${this.disabled} @click=${this._handleInputClick} readonly ></paper-input> <paper-input .value=${(0,o.o)(this.endDate,this.hass.language)} label=${this.hass.localize("ui.components.date-range-picker.end_date")} .disabled=${this.disabled} @click=${this._handleInputClick} readonly ></paper-input> </div> ${this.ranges?n.dy`<div slot="ranges" class="date-range-ranges" .dir=${this._rtlDirection} > <mwc-list @action=${this._setDateRange} activatable> ${Object.keys(this.ranges).map((e=>n.dy`<mwc-list-item> ${e} </mwc-list-item>`))} </mwc-list> </div>`:""} <div slot="footer" class="date-range-footer"> <mwc-button @click=${this._cancelDateRange} >${this.hass.localize("ui.common.cancel")}</mwc-button > <mwc-button @click=${this._applyDateRange} >${this.hass.localize("ui.components.date-range-picker.select")}</mwc-button > </div> </date-range-picker> `}},{kind:"method",key:"_compute24hourFormat",value:function(){return 2===new Intl.DateTimeFormat(this.hass.language,{hour:"numeric"}).formatToParts(new Date(2020,0,1,13)).find((e=>"hour"===e.type)).value.length}},{kind:"method",key:"_setDateRange",value:function(e){const t=Object.values(this.ranges)[e.detail.index],r=this._dateRangePicker;r.clickRange(t),r.clickedApply()}},{kind:"method",key:"_cancelDateRange",value:function(){this._dateRangePicker.clickCancel()}},{kind:"method",key:"_applyDateRange",value:function(){this._dateRangePicker.clickedApply()}},{kind:"get",key:"_dateRangePicker",value:function(){return this.shadowRoot.querySelector("date-range-picker").vueComponent.$children[0]}},{kind:"method",key:"_handleInputClick",value:function(){this._dateRangePicker.open&&(this._dateRangePicker.open=!1)}},{kind:"get",static:!0,key:"styles",value:function(){return n.iv` ha-svg-icon { margin-right: 8px; } .date-range-inputs { display: flex; align-items: center; } .date-range-ranges { border-right: 1px solid var(--divider-color); } .date-range-footer { display: flex; justify-content: flex-end; padding: 8px; border-top: 1px solid var(--divider-color); } paper-input { display: inline-block; max-width: 250px; min-width: 200px; } paper-input:last-child { margin-left: 8px; } @media only screen and (max-width: 800px) { .date-range-ranges { border-right: none; border-bottom: 1px solid var(--divider-color); } } @media only screen and (max-width: 500px) { paper-input { min-width: inherit; } ha-svg-icon { display: none; } } `}}]}}),n.oi)},10983:(e,t,r)=>{"use strict";r(25230);var n=r(15652);r(16509);function i(){i=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(r){t.forEach((function(t){t.kind===r&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var r=e.prototype;["method","field"].forEach((function(n){t.forEach((function(t){var i=t.placement;if(t.kind===n&&("static"===i||"prototype"===i)){var o="static"===i?e:r;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var r=t.descriptor;if("field"===t.kind){var n=t.initializer;r={enumerable:r.enumerable,writable:r.writable,configurable:r.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,r)},decorateClass:function(e,t){var r=[],n=[],i={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,i)}),this),e.forEach((function(e){if(!s(e))return r.push(e);var t=this.decorateElement(e,i);r.push(t.element),r.push.apply(r,t.extras),n.push.apply(n,t.finishers)}),this),!t)return{elements:r,finishers:n};var o=this.decorateConstructor(r,t);return n.push.apply(n,o.finishers),o.finishers=n,o},addElementPlacement:function(e,t,r){var n=t[e.placement];if(!r&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var r=[],n=[],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),l=this.toElementFinisherExtras((0,i[o])(s)||s);e=l.element,this.addElementPlacement(e,t),l.finisher&&n.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);r.push.apply(r,c)}}return{element:e,finishers:n,extras:r}},decorateConstructor:function(e,t){for(var r=[],n=t.length-1;n>=0;n--){var i=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[n])(i)||i);if(void 0!==o.finisher&&r.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:r}},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 p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(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 r=d(e.key),n=String(e.placement);if("static"!==n&&"prototype"!==n&&"own"!==n)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 "'+n+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:r,placement:n,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 r=c(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:r}},runClassFinishers:function(e,t){for(var r=0;r<t.length;r++){var n=(0,t[r])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,r){if(void 0!==e[t])throw new TypeError(r+" can't have a ."+t+" property.")}};return e}function o(e){var t,r=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 n={kind:"field"===e.kind?"field":"method",key:r,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function a(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function s(e){return e.decorators&&e.decorators.length}function l(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function c(e,t){var r=e[t];if(void 0!==r&&"function"!=typeof r)throw new TypeError("Expected '"+t+"' to be a function");return r}function d(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}!function(e,t,r,n){var c=i();if(n)for(var d=0;d<n.length;d++)c=n[d](c);var p=t((function(e){c.initializeInstanceElements(e,u.elements)}),r),u=c.decorateClass(function(e){for(var t=[],r=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},n=0;n<e.length;n++){var i,o=e[n];if("method"===o.kind&&(i=t.find(r)))if(l(o.descriptor)||l(i.descriptor)){if(s(o)||s(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(s(o)){if(s(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}a(o,i)}else t.push(o)}return t}(p.d.map(o)),e);c.initializeClassElements(p.F,u.elements),c.runClassFinishers(p.F,u.finishers)}([(0,n.Mo)("ha-icon-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"icon",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"label",value:()=>""},{kind:"method",key:"createRenderRoot",value:function(){return this.attachShadow({mode:"open",delegatesFocus:!0})}},{kind:"method",key:"render",value:function(){return n.dy` <mwc-icon-button .label=${this.label} .disabled=${this.disabled}> <ha-icon .icon=${this.icon}></ha-icon> </mwc-icon-button> `}},{kind:"get",static:!0,key:"styles",value:function(){return n.iv` :host { display: inline-block; outline: none; } :host([disabled]) { pointer-events: none; } mwc-icon-button { --mdc-theme-on-primary: currentColor; --mdc-theme-text-disabled-on-light: var(--disabled-text-color); } ha-icon { --ha-icon-display: inline; } `}}]}}),n.oi)},56007:(e,t,r)=>{"use strict";r.d(t,{nZ:()=>n,lz:()=>i,V_:()=>o,B8:()=>a});const n="unavailable",i="unknown",o=[n,i],a=["air_quality","alarm_control_panel","alert","automation","binary_sensor","calendar","camera","counter","cover","dominos","fan","geo_location","group","image_processing","input_boolean","input_datetime","input_number","input_select","input_text","light","lock","mailbox","media_player","person","plant","remember_the_milk","remote","scene","script","sensor","switch","timer","utility_meter","vacuum","weather","wink","zha","zwave"]},27849:(e,t,r)=>{"use strict";r(39841);var n=r(50856);r(28426);class i extends(customElements.get("app-header-layout")){static get template(){return n.d` <style> :host { display: block; /** * Force app-header-layout to have its own stacking context so that its parent can * control the stacking of it relative to other elements (e.g. app-drawer-layout). * This could be done using \`isolation: isolate\`, but that's not well supported * across browsers. */ position: relative; z-index: 0; } #wrapper ::slotted([slot="header"]) { @apply --layout-fixed-top; z-index: 1; } #wrapper.initializing ::slotted([slot="header"]) { position: relative; } :host([has-scrolling-region]) { height: 100%; } :host([has-scrolling-region]) #wrapper ::slotted([slot="header"]) { position: absolute; } :host([has-scrolling-region]) #wrapper.initializing ::slotted([slot="header"]) { position: relative; } :host([has-scrolling-region]) #wrapper #contentContainer { @apply --layout-fit; overflow-y: auto; -webkit-overflow-scrolling: touch; } :host([has-scrolling-region]) #wrapper.initializing #contentContainer { position: relative; } #contentContainer { /* Create a stacking context here so that all children appear below the header. */ position: relative; z-index: 0; /* Using 'transform' will cause 'position: fixed' elements to behave like 'position: absolute' relative to this element. */ transform: translate(0); margin-left: env(safe-area-inset-left); margin-right: env(safe-area-inset-right); } @media print { :host([has-scrolling-region]) #wrapper #contentContainer { overflow-y: visible; } } </style> <div id="wrapper" class="initializing"> <slot id="headerSlot" name="header"></slot> <div id="contentContainer"><slot></slot></div> <slot id="fab" name="fab"></slot> </div> `}}customElements.define("ha-app-layout",i)},1265:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=(0,r(76389).o)((e=>class extends e{static get properties(){return{hass:Object,localize:{type:Function,computed:"__computeLocalize(hass.localize)"}}}__computeLocalize(e){return e}}))}}]); //# sourceMappingURL=chunk.0b0c4bff38caf19c8906.js.map