UNPKG

iobroker.lovelace

Version:

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

2 lines 44.2 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[7305],{44608:function(t,e,n){"use strict";var r,i=n(50424),o=n(55358),a=n(7323),s=(n(31206),n(78956)),c=n(50856),l=n(28426),u=n(44583),f=n(1265),d=n(72986),h=n(33367),p=n(21683),y=n(49684);n(10983);function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function g(t,e,n){return(g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=O(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function _(t,e){return(_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=O(t);if(e){var i=O(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return k(this,n)}}function k(t,e){return!e||"object"!==m(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function O(t){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var x,C=null,T=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_(t,e)}(l,t);var e,i,o,a=w(l);function l(){return b(this,l),a.apply(this,arguments)}return e=l,o=[{key:"template",get:function(){return(0,c.d)(r||(t=['\n <style>\n :host {\n display: block;\n }\n .chartHeader {\n padding: 6px 0 0 0;\n width: 100%;\n display: flex;\n flex-direction: row;\n }\n .chartHeader > div {\n vertical-align: top;\n padding: 0 8px;\n }\n .chartHeader > div.chartTitle {\n padding-top: 8px;\n flex: 0 0 0;\n max-width: 30%;\n }\n .chartHeader > div.chartLegend {\n flex: 1 1;\n min-width: 70%;\n }\n :root {\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n }\n .chartTooltip {\n font-size: 90%;\n opacity: 1;\n position: absolute;\n background: rgba(80, 80, 80, 0.9);\n color: white;\n border-radius: 3px;\n pointer-events: none;\n transform: translate(-50%, 12px);\n z-index: 1000;\n width: 200px;\n transition: opacity 0.15s ease-in-out;\n }\n :host([rtl]) .chartTooltip {\n direction: rtl;\n }\n .chartLegend ul,\n .chartTooltip ul {\n display: inline-block;\n padding: 0 0px;\n margin: 5px 0 0 0;\n width: 100%;\n }\n .chartTooltip ul {\n margin: 0 3px;\n }\n .chartTooltip li {\n display: block;\n white-space: pre-line;\n }\n .chartTooltip li::first-line {\n line-height: 0;\n }\n .chartTooltip .title {\n text-align: center;\n font-weight: 500;\n }\n .chartTooltip .beforeBody {\n text-align: center;\n font-weight: 300;\n word-break: break-all;\n }\n .chartLegend li {\n display: inline-block;\n padding: 0 6px;\n max-width: 49%;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n box-sizing: border-box;\n }\n .chartLegend li:nth-child(odd):last-of-type {\n /* Make last item take full width if it is odd-numbered. */\n max-width: 100%;\n }\n .chartLegend li[data-hidden] {\n text-decoration: line-through;\n }\n .chartLegend em,\n .chartTooltip em {\n border-radius: 5px;\n display: inline-block;\n height: 10px;\n margin-right: 4px;\n width: 10px;\n }\n :host([rtl]) .chartTooltip em {\n margin-right: inherit;\n margin-left: 4px;\n }\n ha-icon-button {\n color: var(--secondary-text-color);\n }\n </style>\n <template is="dom-if" if="[[unit]]">\n <div class="chartHeader">\n <div class="chartTitle">[[unit]]</div>\n <div class="chartLegend">\n <ul>\n <template is="dom-repeat" items="[[metas]]">\n <li on-click="_legendClick" data-hidden$="[[item.hidden]]">\n <em style$="background-color:[[item.bgColor]]"></em>\n [[item.label]]\n </li>\n </template>\n </ul>\n </div>\n </div>\n </template>\n <div id="chartTarget" style="height:40px; width:100%">\n <canvas id="chartCanvas"></canvas>\n <div\n class$="chartTooltip [[tooltip.yAlign]]"\n style$="opacity:[[tooltip.opacity]]; top:[[tooltip.top]]; left:[[tooltip.left]]; padding:[[tooltip.yPadding]]px [[tooltip.xPadding]]px"\n >\n <div class="title">[[tooltip.title]]</div>\n <template is="dom-if" if="[[tooltip.beforeBody]]">\n <div class="beforeBody">[[tooltip.beforeBody]]</div>\n </template>\n <div>\n <ul>\n <template is="dom-repeat" items="[[tooltip.lines]]">\n <li>\n <em style$="background-color:[[item.bgColor]]"></em\n >[[item.text]]\n </li>\n </template>\n </ul>\n </div>\n </div>\n </div>\n '],e||(e=t.slice(0)),r=Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))));var t,e}},{key:"properties",get:function(){return{data:Object,identifier:String,rendered:{type:Boolean,notify:!0,value:!1,readOnly:!0},metas:{type:Array,value:function(){return[]}},tooltip:{type:Object,value:function(){return{opacity:"0",left:"0",top:"0",xPadding:"5",yPadding:"3"}}},unit:Object,rtl:{type:Boolean,reflectToAttribute:!0}}}},{key:"observers",get:function(){return["onPropsChange(data)"]}},{key:"getColorList",value:function(t){var e=!1;t>10&&(e=!0,t=Math.ceil(t/2));for(var n=360/t,r=[],i=0;i<t;i++)r[i]=Color().hsl(n*i,80,38),e&&(r[i+t]=Color().hsl(n*i,80,62));return r}},{key:"getColorGenerator",value:function(t,e){var n=["ff0029","66a61e","377eb8","984ea3","00d2d5","ff7f00","af8d00","7f80cd","b3e900","c42e60","a65628","f781bf","8dd3c7","bebada","fb8072","80b1d3","fdb462","fccde5","bc80bd","ffed6f","c4eaff","cf8c00","1b9e77","d95f02","e7298a","e6ab02","a6761d","0097ff","00d067","f43600","4ba93b","5779bb","927acc","97ee3f","bf3947","9f5b00","f48758","8caed6","f2b94f","eff26e","e43872","d9b100","9d7a00","698cff","d9d9d9","00d27e","d06800","009f82","c49200","cbe8ff","fecddf","c27eb6","8cd2ce","c4b8d9","f883b0","a49100","f48800","27d0df","a04a9b"];function r(t){return Color("#"+n[t%n.length])}var i={},o=0;return e>0&&(o=e),t&&Object.keys(t).forEach((function(e){var n=t[e];isFinite(n)?i[e.toLowerCase()]=r(n):i[e.toLowerCase()]=Color(t[e])})),function(t,e){var n,a=e[3];if(null===a)return Color().hsl(0,40,38);if(void 0===a)return Color().hsl(120,40,38);var s=a.toLowerCase();return void 0===n&&(e[4]&&(s="on"===s?"off":"off"===s?"on":s),n=i[s]),void 0===n&&(n=r(o),o++,i[s]=n),n}}}],(i=[{key:"chart",get:function(){return this._chart}},{key:"connectedCallback",value:function(){var t=this;g(O(l.prototype),"connectedCallback",this).call(this),this._isAttached=!0,this.onPropsChange(),this._resizeListener=function(){t._debouncer=s.d.debounce(t._debouncer,p.Wc.after(10),(function(){t._isAttached&&t.resizeChart()}))},"function"==typeof ResizeObserver?(this.resizeObserver=new ResizeObserver((function(e){e.forEach((function(){t._resizeListener()}))})),this.resizeObserver.observe(this.$.chartTarget)):this.addEventListener("iron-resize",this._resizeListener),null===C&&(C=Promise.all([n.e(5070),n.e(9213)]).then(n.bind(n,79109))),C.then((function(e){t.ChartClass=e.default,t.onPropsChange()}))}},{key:"disconnectedCallback",value:function(){g(O(l.prototype),"disconnectedCallback",this).call(this),this._isAttached=!1,this.resizeObserver&&this.resizeObserver.unobserve(this.$.chartTarget),this.removeEventListener("iron-resize",this._resizeListener),void 0!==this._resizeTimer&&(clearInterval(this._resizeTimer),this._resizeTimer=void 0)}},{key:"onPropsChange",value:function(){this._isAttached&&this.ChartClass&&this.data&&this.drawChart()}},{key:"_customTooltips",value:function(t){if(0!==t.opacity){t.yAlign?this.set(["tooltip","yAlign"],t.yAlign):this.set(["tooltip","yAlign"],"no-transform");var e=t.title&&t.title[0]||"";this.set(["tooltip","title"],e),t.beforeBody&&this.set(["tooltip","beforeBody"],t.beforeBody.join("\n"));var n=t.body.map((function(t){return t.lines}));t.body&&this.set(["tooltip","lines"],n.map((function(e,n){var r=t.labelColors[n];return{color:r.borderColor,bgColor:r.backgroundColor,text:e.join("\n")}})));var r=this.$.chartTarget.clientWidth,i=t.caretX,o=this._chart.canvas.offsetTop+t.caretY;t.caretX+100>r?i=r-100:t.caretX<100&&(i=100),i+=this._chart.canvas.offsetLeft,this.tooltip=Object.assign({},this.tooltip,{opacity:1,left:"".concat(i,"px"),top:"".concat(o,"px")})}else this.set(["tooltip","opacity"],0)}},{key:"_legendClick",value:function(t){(t=t||window.event).stopPropagation();for(var e=t.target||t.srcElement;"LI"!==e.nodeName;)e=e.parentElement;var n=t.model.itemsIndex,r=this._chart.getDatasetMeta(n);r.hidden=null===r.hidden?!this._chart.data.datasets[n].hidden:null,this.set(["metas",n,"hidden"],this._chart.isDatasetVisible(n)?null:"hidden"),this._chart.update()}},{key:"_drawLegend",value:function(){var t=this,e=this._chart,n=this._oldIdentifier&&this.identifier===this._oldIdentifier;this._oldIdentifier=this.identifier,this.set("metas",this._chart.data.datasets.map((function(r,i){return{label:r.label,color:r.color,bgColor:r.backgroundColor,hidden:n&&i<t.metas.length?t.metas[i].hidden:!e.isDatasetVisible(i)}})));var r=!1;if(n)for(var i=0;i<this.metas.length;i++){var o=e.getDatasetMeta(i);!!o.hidden!=!!this.metas[i].hidden&&(r=!0),o.hidden=!!this.metas[i].hidden||null}r&&e.update(),this.unit=this.data.unit}},{key:"_formatTickValue",value:function(t,e,n){if(0===n.length)return t;var r=new Date(n[e].value);return(0,y.mr)(r,this.hass.locale)}},{key:"drawChart",value:function(){var t=this,e=this.data.data,n=this.$.chartCanvas;if(e.datasets&&e.datasets.length||this._chart){if("timeline"!==this.data.type&&e.datasets.length>0)for(var r=e.datasets.length,i=this.constructor.getColorList(r),o=0;o<r;o++)e.datasets[o].borderColor=i[o].rgbString(),e.datasets[o].backgroundColor=i[o].alpha(.6).rgbaString();if(this._chart)this._customTooltips({opacity:0}),this._chart.data=e,this._chart.update({duration:0}),this.isTimeline?this._chart.options.scales.yAxes[0].gridLines.display=e.length>1:!0===this.data.legend&&this._drawLegend(),this.resizeChart();else{if(!e.datasets)return;this._customTooltips({opacity:0});var a=[{afterRender:function(){return t._setRendered(!0)}}],s={responsive:!0,maintainAspectRatio:!1,animation:{duration:0},hover:{animationDuration:0},responsiveAnimationDuration:0,tooltips:{enabled:!1,custom:this._customTooltips.bind(this)},legend:{display:!1},line:{spanGaps:!0},elements:{font:"12px 'Roboto', 'sans-serif'"},ticks:{fontFamily:"'Roboto', 'sans-serif'"}};(s=Chart.helpers.merge(s,this.data.options)).scales.xAxes[0].ticks.callback=this._formatTickValue.bind(this),"timeline"===this.data.type?(this.set("isTimeline",!0),void 0!==this.data.colors&&(this._colorFunc=this.constructor.getColorGenerator(this.data.colors.staticColors,this.data.colors.staticColorIndex)),void 0!==this._colorFunc&&(s.elements.colorFunction=this._colorFunc),1===e.datasets.length&&(s.scales.yAxes[0].ticks?s.scales.yAxes[0].ticks.display=!1:s.scales.yAxes[0].ticks={display:!1},s.scales.yAxes[0].gridLines?s.scales.yAxes[0].gridLines.display=!1:s.scales.yAxes[0].gridLines={display:!1}),this.$.chartTarget.style.height="50px"):this.$.chartTarget.style.height="160px";var c={type:this.data.type,data:this.data.data,options:s,plugins:a};this._chart=new this.ChartClass(n,c),!0!==this.isTimeline&&!0===this.data.legend&&this._drawLegend(),this.resizeChart()}}}},{key:"resizeChart",value:function(){this._chart&&(void 0!==this._resizeTimer?(clearInterval(this._resizeTimer),this._resizeTimer=void 0,this._resizeChart()):this._resizeTimer=setInterval(this.resizeChart.bind(this),10))}},{key:"_resizeChart",value:function(){var t=this.$.chartTarget,e=this.data.data;if(0!==e.datasets.length)if(this.isTimeline){var n=this._chart.chartArea.top,r=this._chart.chartArea.bottom,i=this._chart.canvas.clientHeight;if(r>0&&(this._axisHeight=i-r+n),!this._axisHeight)return t.style.height="50px",this._chart.resize(),void this.resizeChart();if(this._axisHeight){var o=30*e.datasets.length+this._axisHeight+"px";t.style.height!==o&&(t.style.height=o),this._chart.resize()}}else this._chart.resize()}}])&&v(e.prototype,i),o&&v(e,o),l}((0,h.P)([d.z],l.H3));function E(t){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function S(t,e,n){return(S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=R(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function z(t,e){return(z=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function D(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=R(t);if(e){var i=R(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return A(this,n)}}function A(t,e){return!e||"object"!==E(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function R(t){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}customElements.define("ha-chart-base",T);var L=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&z(t,e)}(o,t);var e,n,r,i=D(o);function o(){return j(this,o),i.apply(this,arguments)}return e=o,r=[{key:"template",get:function(){return(0,c.d)(x||(t=['\n <style>\n :host {\n display: block;\n overflow: hidden;\n height: 0;\n transition: height 0.3s ease-in-out;\n }\n </style>\n <ha-chart-base\n id="chart"\n hass="[[hass]]"\n data="[[chartData]]"\n identifier="[[identifier]]"\n rendered="{{rendered}}"\n ></ha-chart-base>\n '],e||(e=t.slice(0)),x=Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))));var t,e}},{key:"properties",get:function(){return{hass:{type:Object},chartData:Object,data:Object,names:Object,unit:String,identifier:String,isSingleDevice:{type:Boolean,value:!1},endTime:Object,rendered:{type:Boolean,value:!1,observer:"_onRenderedChanged"}}}},{key:"observers",get:function(){return["dataChanged(data, endTime, isSingleDevice)"]}}],(n=[{key:"connectedCallback",value:function(){S(R(o.prototype),"connectedCallback",this).call(this),this._isAttached=!0,this.drawChart()}},{key:"ready",value:function(){var t=this;S(R(o.prototype),"ready",this).call(this),this.addEventListener("transitionend",(function(){t.style.overflow="auto"}))}},{key:"dataChanged",value:function(){this.drawChart()}},{key:"_onRenderedChanged",value:function(t){t&&this.animateHeight()}},{key:"animateHeight",value:function(){var t=this;requestAnimationFrame((function(){return requestAnimationFrame((function(){t.style.height=t.$.chart.scrollHeight+"px"}))}))}},{key:"drawChart",value:function(){var t=this;if(this._isAttached){var e,n=this.unit,r=this.data,i=[];if(0!==r.length){(e=this.endTime||new Date(Math.max.apply(null,r.map((function(t){return new Date(t.states[t.states.length-1].last_changed)})))))>new Date&&(e=new Date);var o=this.names||{};r.forEach((function(r){var a,c=r.domain,l=o[r.entity_id]||r.name,u=[];function f(t,n){n&&(t>e||(u.forEach((function(e,r){null===n[r]&&a&&null!==a[r]&&e.data.push({x:t,y:a[r]}),e.data.push({x:t,y:n[r]})})),a=n))}function d(t,e,r){var i=!1,o=!1;r&&(i="origin"),e&&(o="before"),u.push({label:t,fill:i,steppedLine:o,pointRadius:0,data:[],unitText:n})}if("thermostat"===c||"climate"===c||"water_heater"===c){var h=r.states.some((function(t){return t.attributes&&t.attributes.hvac_action})),p="climate"===c&&h?function(t){return"heating"===t.attributes.hvac_action}:function(t){return"heat"===t.state},y="climate"===c&&h?function(t){return"cooling"===t.attributes.hvac_action}:function(t){return"cool"===t.state},m=r.states.some(p),b=r.states.some(y),v=r.states.some((function(t){return t.attributes&&t.attributes.target_temp_high!==t.attributes.target_temp_low}));d("".concat(t.hass.localize("ui.card.climate.current_temperature","name",l)),!0),m&&d("".concat(t.hass.localize("ui.card.climate.heating","name",l)),!0,!0),b&&d("".concat(t.hass.localize("ui.card.climate.cooling","name",l)),!0,!0),v?(d("".concat(t.hass.localize("ui.card.climate.target_temperature_mode","name",l,"mode",t.hass.localize("ui.card.climate.high"))),!0),d("".concat(t.hass.localize("ui.card.climate.target_temperature_mode","name",l,"mode",t.hass.localize("ui.card.climate.low"))),!0)):d("".concat(t.hass.localize("ui.card.climate.target_temperature_entity","name",l)),!0),r.states.forEach((function(t){if(t.attributes){var e=s(t.attributes.current_temperature),n=[e];if(m&&n.push(p(t)?e:null),b&&n.push(y(t)?e:null),v){var r=s(t.attributes.target_temp_high),i=s(t.attributes.target_temp_low);n.push(r,i),f(new Date(t.last_changed),n)}else{var o=s(t.attributes.temperature);n.push(o),f(new Date(t.last_changed),n)}}}))}else if("humidifier"===c)d("".concat(t.hass.localize("ui.card.humidifier.target_humidity_entity","name",l)),!0),d("".concat(t.hass.localize("ui.card.humidifier.on_entity","name",l)),!0,!0),r.states.forEach((function(t){if(t.attributes){var e=s(t.attributes.humidity),n=[e];n.push("on"===t.state?e:null),f(new Date(t.last_changed),n)}}));else{d(l,"sensor"===c);var g=null,_=null,w=null;r.states.forEach((function(t){var e=s(t.state),n=new Date(t.last_changed);if(null!==e&&null!==w){var r=n.getTime(),i=w.getTime(),o=_.getTime();f(w,[(i-o)/(r-o)*(e-g)+g]),f(new Date(i+1),[null]),f(n,[e]),_=n,g=e,w=null}else null!==e&&null===w?(f(n,[e]),_=n,g=e):null===e&&null===w&&null!==g&&(w=n)}))}f(e,a),Array.prototype.push.apply(i,u)}));var a={type:"line",unit:n,legend:!this.isSingleDevice,options:{scales:{xAxes:[{type:"time",ticks:{major:{fontStyle:"bold"},source:"auto",sampleSize:5,autoSkipPadding:20,maxRotation:0}}],yAxes:[{ticks:{maxTicksLimit:7}}]},tooltips:{mode:"neareach",callbacks:{title:function(e,n){var r=e[0],i=n.datasets[r.datasetIndex].data[r.index].x;return(0,u.E)(i,t.hass.locale)}}},hover:{mode:"neareach"},layout:{padding:{top:5}},elements:{line:{tension:.1,pointRadius:0,borderWidth:1.5},point:{hitRadius:5}},plugins:{filler:{propagate:!0}}},data:{labels:[],datasets:i}};this.chartData=a}}function s(t){var e=parseFloat(t);return isFinite(e)?e:null}}}])&&P(e.prototype,n),r&&P(e,r),o}((0,f.Z)(l.H3));customElements.define("state-history-chart-line",L);var B,I=n(58831),F=n(87744);function H(t){return(H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function N(t,e,n){return(N="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=q(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function G(t,e){return(G=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function V(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=q(t);if(e){var i=q(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return W(this,n)}}function W(t,e){return!e||"object"!==H(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function q(t){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var U,X,Z,J,Y,K,Q,tt,et=new Set(["battery","door","garage_door","gas","lock","opening","problem","safety","smoke","window"]),nt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&G(t,e)}(o,t);var e,n,r,i=V(o);function o(){return $(this,o),i.apply(this,arguments)}return e=o,r=[{key:"template",get:function(){return(0,c.d)(B||(t=['\n <style>\n :host {\n display: block;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n }\n :host([rendered]) {\n opacity: 1;\n }\n\n ha-chart-base {\n direction: ltr;\n }\n </style>\n <ha-chart-base\n hass="[[hass]]"\n data="[[chartData]]"\n rendered="{{rendered}}"\n rtl="{{rtl}}"\n ></ha-chart-base>\n '],e||(e=t.slice(0)),B=Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))));var t,e}},{key:"properties",get:function(){return{hass:{type:Object},chartData:Object,data:{type:Object,observer:"dataChanged"},names:Object,noSingle:Boolean,endTime:Date,rendered:{type:Boolean,value:!1,reflectToAttribute:!0},rtl:{reflectToAttribute:!0,computed:"_computeRTL(hass)"}}}},{key:"observers",get:function(){return["dataChanged(data, endTime, localize, language)"]}}],(n=[{key:"connectedCallback",value:function(){N(q(o.prototype),"connectedCallback",this).call(this),this._isAttached=!0,this.drawChart()}},{key:"dataChanged",value:function(){this.drawChart()}},{key:"drawChart",value:function(){var t=this,e=this.data;if(this._isAttached){e||(e=[]);var n=new Date(e.reduce((function(t,e){return Math.min(t,new Date(e.data[0].last_changed))}),new Date)),r=this.endTime||new Date(e.reduce((function(t,e){return Math.max(t,new Date(e.data[e.data.length-1].last_changed))}),n));r>new Date&&(r=new Date);var i=[],o=[],a=this.names||{};e.forEach((function(e){var s,c=null,l=null,u=n,f=a[e.entity_id]||e.name,d="binary_sensor"===(0,I.M)(e.entity_id)&&et.has(t.hass.states[e.entity_id].attributes.device_class),h=[];e.data.forEach((function(t){var e=t.state;void 0!==e&&""!==e||(e=null),new Date(t.last_changed)>r||(null!==c&&e!==c?(s=new Date(t.last_changed),h.push([u,s,l,c,d]),c=e,l=t.state_localize,u=s):null===c&&(c=e,l=t.state_localize,u=new Date(t.last_changed)))})),null!==c&&h.push([u,r,l,c,d]),o.push({data:h,entity_id:e.entity_id}),i.push(f)}));var s={type:"timeline",options:{tooltips:{callbacks:{label:function(e,n){var r=n.datasets[e.datasetIndex].data[e.index],i=(0,u.E)(r[0],t.hass.locale),o=(0,u.E)(r[1],t.hass.locale);return[r[2],i,o]},beforeBody:function(e,n){return t.hass.userData&&t.hass.userData.showAdvanced&&e[0]&&n.datasets[e[0].datasetIndex].entity_id||""}}},scales:{xAxes:[{ticks:{major:{fontStyle:"bold"},sampleSize:5,autoSkipPadding:50,maxRotation:0},categoryPercentage:void 0,barPercentage:void 0,time:{format:void 0}}],yAxes:[{afterSetDimensions:function(t){t.maxWidth=.18*t.chart.width},position:this._computeRTL?"right":"left",categoryPercentage:void 0,barPercentage:void 0,time:{format:void 0}}]}},datasets:{categoryPercentage:.8,barPercentage:.9},data:{labels:i,datasets:o},colors:{staticColors:{on:1,off:0,home:1,not_home:0,unavailable:"#a0a0a0",unknown:"#606060",idle:2},staticColorIndex:3}};this.chartData=s}}},{key:"_computeRTL",value:function(t){return(0,F.HE)(t)}}])&&M(e.prototype,n),r&&M(e,r),o}((0,f.Z)(l.H3));function rt(t){return(rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function it(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function at(t,e){return(at=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function st(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ut(t);if(e){var i=ut(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ct(this,n)}}function ct(t,e){return!e||"object"!==rt(e)&&"function"!=typeof e?lt(t):e}function lt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ut(t){return(ut=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ft(){ft=function(){return t};var t={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(t,e){["method","field"].forEach((function(n){e.forEach((function(e){e.kind===n&&"own"===e.placement&&this.defineClassElement(t,e)}),this)}),this)},initializeClassElements:function(t,e){var n=t.prototype;["method","field"].forEach((function(r){e.forEach((function(e){var i=e.placement;if(e.kind===r&&("static"===i||"prototype"===i)){var o="static"===i?t:n;this.defineClassElement(o,e)}}),this)}),this)},defineClassElement:function(t,e){var n=e.descriptor;if("field"===e.kind){var r=e.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(t)}}Object.defineProperty(t,e.key,n)},decorateClass:function(t,e){var n=[],r=[],i={static:[],prototype:[],own:[]};if(t.forEach((function(t){this.addElementPlacement(t,i)}),this),t.forEach((function(t){if(!pt(t))return n.push(t);var e=this.decorateElement(t,i);n.push(e.element),n.push.apply(n,e.extras),r.push.apply(r,e.finishers)}),this),!e)return{elements:n,finishers:r};var o=this.decorateConstructor(n,e);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(t,e,n){var r=e[t.placement];if(!n&&-1!==r.indexOf(t.key))throw new TypeError("Duplicated element ("+t.key+")");r.push(t.key)},decorateElement:function(t,e){for(var n=[],r=[],i=t.decorators,o=i.length-1;o>=0;o--){var a=e[t.placement];a.splice(a.indexOf(t.key),1);var s=this.fromElementDescriptor(t),c=this.toElementFinisherExtras((0,i[o])(s)||s);t=c.element,this.addElementPlacement(t,e),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var u=0;u<l.length;u++)this.addElementPlacement(l[u],e);n.push.apply(n,l)}}return{element:t,finishers:r,extras:n}},decorateConstructor:function(t,e){for(var n=[],r=e.length-1;r>=0;r--){var i=this.fromClassDescriptor(t),o=this.toClassDescriptor((0,e[r])(i)||i);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){t=o.elements;for(var a=0;a<t.length-1;a++)for(var s=a+1;s<t.length;s++)if(t[a].key===t[s].key&&t[a].placement===t[s].placement)throw new TypeError("Duplicated element ("+t[a].key+")")}}return{elements:t,finishers:n}},fromElementDescriptor:function(t){var e={kind:t.kind,key:t.key,placement:t.placement,descriptor:t.descriptor};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===t.kind&&(e.initializer=t.initializer),e},toElementDescriptors:function(t){var e;if(void 0!==t)return(e=t,function(t){if(Array.isArray(t))return t}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return vt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vt(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(t){var e=this.toElementDescriptor(t);return this.disallowProperty(t,"finisher","An element descriptor"),this.disallowProperty(t,"extras","An element descriptor"),e}),this)},toElementDescriptor:function(t){var e=String(t.kind);if("method"!==e&&"field"!==e)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+e+'"');var n=bt(t.key),r=String(t.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=t.descriptor;this.disallowProperty(t,"elements","An element descriptor");var o={kind:e,key:n,placement:r,descriptor:Object.assign({},i)};return"field"!==e?this.disallowProperty(t,"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=t.initializer),o},toElementFinisherExtras:function(t){return{element:this.toElementDescriptor(t),finisher:mt(t,"finisher"),extras:this.toElementDescriptors(t.extras)}},fromClassDescriptor:function(t){var e={kind:"class",elements:t.map(this.fromElementDescriptor,this)};return Object.defineProperty(e,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),e},toClassDescriptor:function(t){var e=String(t.kind);if("class"!==e)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+e+'"');this.disallowProperty(t,"key","A class descriptor"),this.disallowProperty(t,"placement","A class descriptor"),this.disallowProperty(t,"descriptor","A class descriptor"),this.disallowProperty(t,"initializer","A class descriptor"),this.disallowProperty(t,"extras","A class descriptor");var n=mt(t,"finisher");return{elements:this.toElementDescriptors(t.elements),finisher:n}},runClassFinishers:function(t,e){for(var n=0;n<e.length;n++){var r=(0,e[n])(t);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");t=r}}return t},disallowProperty:function(t,e,n){if(void 0!==t[e])throw new TypeError(n+" can't have a ."+e+" property.")}};return t}function dt(t){var e,n=bt(t.key);"method"===t.kind?e={value:t.value,writable:!0,configurable:!0,enumerable:!1}:"get"===t.kind?e={get:t.value,configurable:!0,enumerable:!1}:"set"===t.kind?e={set:t.value,configurable:!0,enumerable:!1}:"field"===t.kind&&(e={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===t.kind?"field":"method",key:n,placement:t.static?"static":"field"===t.kind?"own":"prototype",descriptor:e};return t.decorators&&(r.decorators=t.decorators),"field"===t.kind&&(r.initializer=t.value),r}function ht(t,e){void 0!==t.descriptor.get?e.descriptor.get=t.descriptor.get:e.descriptor.set=t.descriptor.set}function pt(t){return t.decorators&&t.decorators.length}function yt(t){return void 0!==t&&!(void 0===t.value&&void 0===t.writable)}function mt(t,e){var n=t[e];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+e+"' to be a function");return n}function bt(t){var e=function(t,e){if("object"!==rt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==rt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===rt(e)?e:String(e)}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}customElements.define("state-history-chart-timeline",nt);!function(t,e,n,r){var i=ft();if(r)for(var o=0;o<r.length;o++)i=r[o](i);var a=e((function(t){i.initializeInstanceElements(t,s.elements)}),n),s=i.decorateClass(function(t){for(var e=[],n=function(t){return"method"===t.kind&&t.key===o.key&&t.placement===o.placement},r=0;r<t.length;r++){var i,o=t[r];if("method"===o.kind&&(i=e.find(n)))if(yt(o.descriptor)||yt(i.descriptor)){if(pt(o)||pt(i))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");i.descriptor=o.descriptor}else{if(pt(o)){if(pt(i))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");i.decorators=o.decorators}ht(o,i)}else e.push(o)}return e}(a.d.map(dt)),t);i.initializeClassElements(a.F,s.elements),i.runClassFinishers(a.F,s.finishers)}([(0,o.Mo)("state-history-charts")],(function(t,e){return{F:function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&at(t,e)}(r,e);var n=st(r);function r(){var e;ot(this,r);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return e=n.call.apply(n,[this].concat(o)),t(lt(e)),e}return r}(e),d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"historyData",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"names",value:function(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"endTime",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"upToNow",value:function(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"no-single"})],key:"noSingle",value:function(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"isLoadingData",value:function(){return!1}},{kind:"method",key:"render",value:function(){var t=this;if(!(0,a.p)(this.hass,"history"))return(0,i.dy)(U||(U=it([' <div class="info">\n ',"\n </div>"])),this.hass.localize("ui.components.history_charts.history_disabled"));if(this.isLoadingData&&!this.historyData)return(0,i.dy)(X||(X=it([' <div class="info">\n ',"\n </div>"])),this.hass.localize("ui.components.history_charts.loading_history"));if(this._isHistoryEmpty())return(0,i.dy)(Z||(Z=it([' <div class="info">\n ',"\n </div>"])),this.hass.localize("ui.components.history_charts.no_history_found"));var e=this.upToNow?new Date:this.endTime||new Date;return(0,i.dy)(J||(J=it(["\n ","\n ","\n "])),this.historyData.timeline.length?(0,i.dy)(Y||(Y=it(["\n <state-history-chart-timeline\n .hass=","\n .data=","\n .endTime=","\n .noSingle=","\n .names=","\n ></state-history-chart-timeline>\n "])),this.hass,this.historyData.timeline,e,this.noSingle,this.names):(0,i.dy)(K||(K=it([""]))),this.historyData.line.map((function(n){return(0,i.dy)(Q||(Q=it(["\n <state-history-chart-line\n .hass=","\n .unit=","\n .data=","\n .identifier=","\n .isSingleDevice=","\n .endTime=","\n .names=","\n ></state-history-chart-line>\n "])),t.hass,n.unit,n.data,n.identifier,!t.noSingle&&n.data&&1===n.data.length,e,t.names)})))}},{kind:"method",key:"shouldUpdate",value:function(t){return!(1===t.size&&t.has("hass"))}},{kind:"method",key:"_isHistoryEmpty",value:function(){var t=!this.historyData||!this.historyData.timeline||!this.historyData.line||0===this.historyData.timeline.length&&0===this.historyData.line.length;return!this.isLoadingData&&t}},{kind:"get",static:!0,key:"styles",value:function(){return(0,i.iv)(tt||(tt=it(["\n :host {\n display: block;\n /* height of single timeline chart = 58px */\n min-height: 58px;\n }\n .info {\n text-align: center;\n line-height: 58px;\n color: var(--secondary-text-color);\n }\n "])))}}]}}),i.oi)},58763:function(t,e,n){"use strict";n.d(e,{vq:function(){return u},_J:function(){return f},Nu:function(){return h}});var r=n(29171),i=n(22311),o=n(91741);function a(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var c=["climate","humidifier","water_heater"],l=["temperature","current_temperature","target_temp_low","target_temp_high","hvac_action","humidity","mode"],u=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5?arguments[5]:void 0,a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],s="history/period";return n&&(s+="/"+n.toISOString()),s+="?filter_entity_id="+e,r&&(s+="&end_time="+r.toISOString()),i&&(s+="&skip_initial_state"),void 0!==o&&(s+="&significant_changes_only=".concat(Number(o))),a&&(s+="&minimal_response"),t.callApi("GET",s)},f=function(t,e,n,r){return t.callApi("GET","history/period/".concat(e.toISOString(),"?end_time=").concat(n.toISOString(),"&minimal_response").concat(r?"&filter_entity_id=".concat(r):""))},d=function(t,e){return t.state===e.state&&(!t.attributes||!e.attributes||l.every((function(n){return t.attributes[n]===e.attributes[n]})))},h=function(t,e,n){var s={},u=[];return e?(e.forEach((function(e){if(0!==e.length){var c,l=e.find((function(t){return t.attributes&&"unit_of_measurement"in t.attributes}));(c=l?l.attributes.unit_of_measurement:{climate:t.config.unit_system.temperature,counter:"#",humidifier:"%",input_number:"#",number:"#",water_heater:t.config.unit_system.temperature}[(0,i.N)(e[0])])?c in s?s[c].push(e):s[c]=[e]:u.push(function(t,e,n){var i,s=[],c=n.length-1,l=a(n);try{for(l.s();!(i=l.n()).done;){var u=i.value;s.length>0&&u.state===s[s.length-1].state||(u.entity_id||(u.attributes=n[c].attributes,u.entity_id=n[c].entity_id),s.push({state_localize:(0,r.D)(t,u,e),state:u.state,last_changed:u.last_changed}))}}catch(f){l.e(f)}finally{l.f()}return{name:(0,o.C)(n[0]),entity_id:n[0].entity_id,data:s}}(n,t.locale,e))}})),{line:Object.keys(s).map((function(t){return function(t,e){var n,r=[],s=a(e);try{for(s.s();!(n=s.n()).done;){var u,f=n.value,h=f[f.length-1],p=(0,i.N)(h),y=[],m=a(f);try{for(m.s();!(u=m.n()).done;){var b=u.value,v=void 0;if(c.includes(p)){v={state:b.state,last_changed:b.last_updated,attributes:{}};var g,_=a(l);try{for(_.s();!(g=_.n()).done;){var w=g.value;w in b.attributes&&(v.attributes[w]=b.attributes[w])}}catch(k){_.e(k)}finally{_.f()}}else v=b;y.length>1&&d(v,y[y.length-1])&&d(v,y[y.length-2])||y.push(v)}}catch(k){m.e(k)}finally{m.f()}r.push({domain:p,name:(0,o.C)(h),entity_id:h.entity_id,states:y})}}catch(k){s.e(k)}finally{s.f()}return{unit:t,identifier:e.map((function(t){return t[0].entity_id})).join(""),data:r}}(t,s[t])})),timeline:u}):{line:[],timeline:[]}}},1265:function(t,e,n){"use strict";var r=n(76389);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=u(t);if(e){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}function l(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}e.Z=(0,r.o)((function(t){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(l,t);var e,n,r,i=c(l);function l(){return o(this,l),i.apply(this,arguments)}return e=l,r=[{key:"properties",get:function(){return{hass:Object,localize:{type:Function,computed:"__computeLocalize(hass.localize)"}}}}],(n=[{key:"__computeLocalize",value:function(t){return t}}])&&a(e.prototype,n),r&&a(e,r),l}(t)}))}}]); //# sourceMappingURL=chunk.3f8a4895748ef7d36bcf.js.map