UNPKG

iobroker.lovelace

Version:

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

5 lines 46.8 kB
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["30341"],{95262:function(t,e,i){"use strict";function a(t){return null==t||Array.isArray(t)?t:[t]}i.d(e,{r:()=>a})},92636:function(t,e,i){"use strict";i.d(e,{z:()=>a});i(19083),i(61006);const a=t=>(e,i)=>t.includes(e,i)},49976:function(t,e,i){"use strict";i.d(e,{U:()=>a});const a=t=>t.stopPropagation()},59847:function(t,e,i){"use strict";i.d(e,{N:()=>n});var a=i(73850);const n=t=>(0,a.M)(t.entity_id)},75278:function(t,e,i){"use strict";i.d(e,{e:()=>a});const a=(t,e)=>n(t.attributes,e),n=(t,e)=>!!(t.supported_features&e)},42983:function(t,e,i){"use strict";i.a(t,(async function(t,e){try{var a=i(61701),n=(i(19083),i(71695),i(92745),i(61893),i(9359),i(56475),i(31526),i(40251),i(61006),i(47021),i(87319),i(57243)),s=i(50778),d=i(27486),o=i(95262),c=i(36522),r=i(1416),l=i(17705),u=i(73192),h=i(94279),f=(i(37583),i(5460)),p=i(24360),m=t([h,f]);[h,f]=m.then?(await m)():m;let v,g,b,_,y=t=>t;(0,a.Z)([(0,s.Mo)("ha-statistic-picker")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"statistic-types"})],key:"statisticTypes",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"allow-custom-entity"})],key:"allowCustomEntity",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1,type:Array})],key:"statisticIds",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Array,attribute:"include-statistics-unit-of-measurement"})],key:"includeStatisticsUnitOfMeasurement",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"include-unit-class"})],key:"includeUnitClass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"include-device-class"})],key:"includeDeviceClass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"entities-only"})],key:"entitiesOnly",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Array,attribute:"exclude-statistics"})],key:"excludeStatistics",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"helpMissingEntityUrl",value(){return"/more-info/statistics/"}},{kind:"field",decorators:[(0,s.SB)()],key:"_opened",value:void 0},{kind:"field",decorators:[(0,s.IO)("ha-combo-box",!0)],key:"comboBox",value:void 0},{kind:"field",key:"_init",value(){return!1}},{kind:"field",key:"_statistics",value(){return[]}},{kind:"field",decorators:[(0,s.SB)()],key:"_filteredItems",value(){}},{kind:"field",key:"_rowRenderer",value(){return t=>(0,n.dy)(v||(v=y`<mwc-list-item graphic="avatar" twoline> ${0} <span>${0}</span> <span slot="secondary">${0}</span> </mwc-list-item>`),t.state?(0,n.dy)(g||(g=y`<state-badge slot="graphic" .stateObj="${0}" .hass="${0}"></state-badge>`),t.state,this.hass):"",t.name,""===t.id||"__missing"===t.id?(0,n.dy)(b||(b=y`<a target="_blank" rel="noopener noreferrer" href="${0}">${0}</a>`),(0,u.R)(this.hass,this.helpMissingEntityUrl),this.hass.localize("ui.components.statistic-picker.learn_more")):t.id)}},{kind:"field",key:"_getStatistics",value(){return(0,d.Z)(((t,e,i,a,n,s,d)=>{if(!t.length)return[{id:"",name:this.hass.localize("ui.components.statistic-picker.no_statistics"),strings:[]}];if(e){const i=(0,o.r)(e);t=t.filter((t=>i.includes(t.statistics_unit_of_measurement)))}if(i){const e=(0,o.r)(i);t=t.filter((t=>e.includes(t.unit_class)))}if(a){const e=(0,o.r)(a);t=t.filter((t=>{const i=this.hass.states[t.statistic_id];return!i||e.includes(i.attributes.device_class||"")}))}const c=[];return t.forEach((t=>{if(s&&t.statistic_id!==d&&s.includes(t.statistic_id))return;const e=this.hass.states[t.statistic_id];if(!e){if(!n){const e=t.statistic_id,i=(0,l.Kd)(this.hass,t.statistic_id,t);c.push({id:e,name:i,strings:[e,i]})}return}const i=t.statistic_id,a=(0,l.Kd)(this.hass,t.statistic_id,t);c.push({id:i,name:a,state:e,strings:[i,a]})})),c.length?(c.length>1&&c.sort(((t,e)=>(0,r.$K)(t.name||"",e.name||"",this.hass.locale.language))),c.push({id:"__missing",name:this.hass.localize("ui.components.statistic-picker.missing_entity"),strings:[]}),c):[{id:"",name:this.hass.localize("ui.components.statistic-picker.no_match"),strings:[]}]}))}},{kind:"method",key:"open",value:function(){var t;null===(t=this.comboBox)||void 0===t||t.open()}},{kind:"method",key:"focus",value:function(){var t;null===(t=this.comboBox)||void 0===t||t.focus()}},{kind:"method",key:"willUpdate",value:function(t){(!this.hasUpdated&&!this.statisticIds||t.has("statisticTypes"))&&this._getStatisticIds(),(!this._init&&this.statisticIds||t.has("_opened")&&this._opened)&&(this._init=!0,this.hasUpdated?this._statistics=this._getStatistics(this.statisticIds,this.includeStatisticsUnitOfMeasurement,this.includeUnitClass,this.includeDeviceClass,this.entitiesOnly,this.excludeStatistics,this.value):this.updateComplete.then((()=>{this._statistics=this._getStatistics(this.statisticIds,this.includeStatisticsUnitOfMeasurement,this.includeUnitClass,this.includeDeviceClass,this.entitiesOnly,this.excludeStatistics,this.value)})))}},{kind:"method",key:"render",value:function(){var t;return 0===this._statistics.length?n.Ld:(0,n.dy)(_||(_=y` <ha-combo-box .hass="${0}" .label="${0}" .value="${0}" .renderer="${0}" .disabled="${0}" .allowCustomValue="${0}" .items="${0}" .filteredItems="${0}" item-value-path="id" item-id-path="id" item-label-path="name" @opened-changed="${0}" @value-changed="${0}" @filter-changed="${0}"></ha-combo-box> `),this.hass,void 0===this.label&&this.hass?this.hass.localize("ui.components.statistic-picker.statistic"):this.label,this._value,this._rowRenderer,this.disabled,this.allowCustomEntity,this._statistics,null!==(t=this._filteredItems)&&void 0!==t?t:this._statistics,this._openedChanged,this._statisticChanged,this._filterChanged)}},{kind:"method",key:"_getStatisticIds",value:async function(){this.statisticIds=await(0,l.uR)(this.hass,this.statisticTypes)}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_statisticChanged",value:function(t){t.stopPropagation();let e=t.detail.value;"__missing"===e&&(e=""),e!==this._value&&this._setValue(e)}},{kind:"method",key:"_openedChanged",value:function(t){this._opened=t.detail.value}},{kind:"method",key:"_filterChanged",value:function(t){const e=t.detail.value.toLowerCase();this._filteredItems=e.length?(0,p.q)(e,this._statistics):void 0}},{kind:"method",key:"_setValue",value:function(t){this.value=t,setTimeout((()=>{(0,c.B)(this,"value-changed",{value:t}),(0,c.B)(this,"change")}),0)}}]}}),n.oi);e()}catch(v){e(v)}}))},73729:function(t,e,i){"use strict";i.d(e,{i:()=>m});var a=i(61701),n=i(72621),s=(i(22152),i(71695),i(47021),i(74966)),d=i(51408),o=i(57243),c=i(50778),r=i(76525);i(23334);let l,u,h,f=t=>t;const p=["button","ha-list-item"],m=(t,e)=>{var i;return(0,o.dy)(l||(l=f` <div class="header_title"> <ha-icon-button .label="${0}" .path="${0}" dialogAction="close" class="header_button"></ha-icon-button> <span>${0}</span> </div> `),null!==(i=null==t?void 0:t.localize("ui.common.close"))&&void 0!==i?i:"Close","M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",e)};(0,a.Z)([(0,c.Mo)("ha-dialog")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",key:r.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(t,e){var i;null===(i=this.contentElement)||void 0===i||i.scrollTo(t,e)}},{kind:"method",key:"renderHeading",value:function(){return(0,o.dy)(u||(u=f`<slot name="heading"> ${0} </slot>`),(0,n.Z)(i,"renderHeading",this,3)([]))}},{kind:"method",key:"firstUpdated",value:function(){var t;(0,n.Z)(i,"firstUpdated",this,3)([]),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,p].join(", "),this._updateScrolledAttribute(),null===(t=this.contentElement)||void 0===t||t.addEventListener("scroll",this._onScroll,{passive:!0})}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this.contentElement.removeEventListener("scroll",this._onScroll)}},{kind:"field",key:"_onScroll",value(){return()=>{this._updateScrolledAttribute()}}},{kind:"method",key:"_updateScrolledAttribute",value:function(){this.contentElement&&this.toggleAttribute("scrolled",0!==this.contentElement.scrollTop)}},{kind:"field",static:!0,key:"styles",value(){return[d.W,(0,o.iv)(h||(h=f`:host([scrolled]) ::slotted(ha-dialog-header){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.mdc-dialog{--mdc-dialog-scroll-divider-color:var( --dialog-scroll-divider-color, var(--divider-color) );z-index:var(--dialog-z-index,8);-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));--mdc-dialog-box-shadow:var(--dialog-box-shadow, none);--mdc-typography-headline6-font-weight:400;--mdc-typography-headline6-font-size:1.574rem}.mdc-dialog__actions{justify-content:var(--justify-action-buttons,flex-end);padding-bottom:max(env(safe-area-inset-bottom),24px)}.mdc-dialog__actions span:first-child{flex:var(--secondary-action-button-flex,unset)}.mdc-dialog__actions span:nth-child(2){flex:var(--primary-action-button-flex,unset)}.mdc-dialog__container{align-items:var(--vertical-align-dialog,center)}.mdc-dialog__title{padding:24px 24px 0 24px}.mdc-dialog__title:has(span){padding:12px 12px 0}.mdc-dialog__actions{padding:12px 24px 12px 24px}.mdc-dialog__title::before{content:unset}.mdc-dialog .mdc-dialog__content{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,24px)}:host([hideactions]) .mdc-dialog .mdc-dialog__content{padding-bottom:max(var(--dialog-content-padding,24px),env(safe-area-inset-bottom))}.mdc-dialog .mdc-dialog__surface{position:var(--dialog-surface-position,relative);top:var(--dialog-surface-top);margin-top:var(--dialog-surface-margin-top);min-height:var(--mdc-dialog-min-height,auto);border-radius:var(--ha-dialog-border-radius,28px);-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);background:var(--ha-dialog-surface-background,var(--mdc-theme-surface,#fff))}:host([flexContent]) .mdc-dialog .mdc-dialog__content{display:flex;flex-direction:column}.header_title{display:flex;align-items:center;direction:var(--direction)}.header_title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;padding-left:4px}.header_button{text-decoration:none;color:inherit;inset-inline-start:initial;inset-inline-end:-12px;direction:var(--direction)}.dialog-actions{inset-inline-start:initial!important;inset-inline-end:0px!important;direction:var(--direction)}`))]}}]}}),s.M)},55486:function(t,e,i){"use strict";var a=i(61701),n=(i(71695),i(47021),i(4918)),s=i(6394),d=i(57243),o=i(50778),c=i(35359),r=i(36522);let l,u,h=t=>t;(0,a.Z)([(0,o.Mo)("ha-formfield")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"method",key:"render",value:function(){const t={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return(0,d.dy)(l||(l=h` <div class="mdc-form-field ${0}"> <slot></slot> <label class="mdc-label" @click="${0}"> <slot name="label">${0}</slot> </label> </div>`),(0,c.$)(t),this._labelClick,this.label)}},{kind:"method",key:"_labelClick",value:function(){const t=this.input;if(t&&(t.focus(),!t.disabled))switch(t.tagName){case"HA-CHECKBOX":t.checked=!t.checked,(0,r.B)(t,"change");break;case"HA-RADIO":t.checked=!0,(0,r.B)(t,"change");break;default:t.click()}}},{kind:"field",static:!0,key:"styles",value(){return[s.W,(0,d.iv)(u||(u=h`:host(:not([alignEnd])) ::slotted(ha-switch){margin-right:10px;margin-inline-end:10px;margin-inline-start:inline}.mdc-form-field{align-items:var(--ha-formfield-align-items,center);gap:4px}.mdc-form-field>label{direction:var(--direction);margin-inline-start:0;margin-inline-end:auto;padding:0}:host([disabled]) label{color:var(--disabled-text-color)}`))]}}]}}),n.a)},65981:function(t,e,i){"use strict";i.r(e),i.d(e,{HaIcon:()=>$});var a=i(61701),n=i(72621),s=(i(19083),i(71695),i(40251),i(61006),i(47021),i(57243)),d=i(50778),o=i(36522),c=i(22381),r=i(80654),l=(i(92745),i(9359),i(31526),i(27608)),u=i(27486),h=i(37394);const f=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}'),p=(0,u.Z)((async()=>{const t=(0,l.MT)("hass-icon-db","mdi-icon-store");{const e=await(0,l.U2)("_version",t);e?e!==f.version&&(await(0,l.ZH)(t),(0,l.t8)("_version",f.version,t)):(0,l.t8)("_version",f.version,t)}return t})),m=["mdi","hass","hassio","hademo"];let v=[];i(37583);let g,b,_,y=t=>t;const k={},x={},w=(0,c.D)((()=>(async t=>{const e=Object.keys(t),i=await Promise.all(Object.values(t));(await p())("readwrite",(a=>{i.forEach(((i,n)=>{Object.entries(i).forEach((([t,e])=>{a.put(e,t)})),delete t[e[n]]}))}))})(x)),2e3),C={};let $=(0,a.Z)([(0,d.Mo)("ha-icon")],(function(t,e){class a extends e{constructor(...e){super(...e),t(this)}}return{F:a,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_path",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_secondaryPath",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_viewBox",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_legacy",value(){return!1}},{kind:"method",key:"willUpdate",value:function(t){(0,n.Z)(a,"willUpdate",this,3)([t]),t.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}},{kind:"method",key:"render",value:function(){return this.icon?this._legacy?(0,s.dy)(g||(g=y` <iron-icon .icon="${0}"></iron-icon>`),this.icon):(0,s.dy)(b||(b=y`<ha-svg-icon .path="${0}" .secondaryPath="${0}" .viewBox="${0}"></ha-svg-icon>`),this._path,this._secondaryPath,this._viewBox):s.Ld}},{kind:"method",key:"_loadIcon",value:async function(){if(!this.icon)return;const t=this.icon,[e,a]=this.icon.split(":",2);let n,s=a;if(!e||!s)return;if(!m.includes(e)){const i=r.g[e];return i?void(i&&"function"==typeof i.getIcon&&this._setCustomPath(i.getIcon(s),t)):void(this._legacy=!0)}if(this._legacy=!1,s in k){const t=k[s];let i;t.newName?(i=`Icon ${e}:${s} was renamed to ${e}:${t.newName}, please change your config, it will be removed in version ${t.removeIn}.`,s=t.newName):i=`Icon ${e}:${s} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${t.removeIn}.`,console.warn(i),(0,o.B)(this,"write_log",{level:"warning",message:i})}if(s in C)return void(this._path=C[s]);if("home-assistant"===s){const e=(await i.e("48348").then(i.bind(i,30511))).mdiHomeAssistant;return this.icon===t&&(this._path=e),void(C[s]=e)}try{n=await(t=>new Promise(((e,i)=>{if(v.push([t,e,i]),v.length>1)return;const a=p();(0,h.n)(1e3,(async()=>{(await a)("readonly",(t=>{for(const[e,i,a]of v)(0,l.RV)(t.get(e)).then((t=>i(t))).catch((t=>a(t)));v=[]}))})()).catch((t=>{for(const[,,e]of v)e(t);v=[]}))})))(s)}catch(u){n=void 0}if(n)return this.icon===t&&(this._path=n),void(C[s]=n);const d=(t=>{let e;for(const i of f.parts){if(void 0!==i.start&&t<i.start)break;e=i}return e.file})(s);if(d in x)return void this._setPath(x[d],s,t);const c=fetch(`/static/mdi/${d}.json`).then((t=>t.json()));x[d]=c,this._setPath(c,s,t),w()}},{kind:"method",key:"_setCustomPath",value:async function(t,e){const i=await t;this.icon===e&&(this._path=i.path,this._secondaryPath=i.secondaryPath,this._viewBox=i.viewBox)}},{kind:"method",key:"_setPath",value:async function(t,e,i){const a=await t;this.icon===i&&(this._path=a[e]),C[e]=a[e]}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(_||(_=y`:host{fill:currentcolor}`))}}]}}),s.oi)},7285:function(t,e,i){"use strict";i.d(e,{M:()=>f});var a=i(61701),n=i(72621),s=(i(71695),i(47021),i(65703)),d=i(46289),o=i(57243),c=i(50778);let r,l,u,h=t=>t,f=(0,a.Z)([(0,c.Mo)("ha-list-item")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,n.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[d.W,(0,o.iv)(r||(r=h`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,o.iv)(l||(l=h`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,o.iv)(u||(u=h``))]}}]}}),s.K)},72781:function(t,e,i){"use strict";var a=i(61701),n=(i(71695),i(47021),i(47711)),s=i(81577),d=i(57243),o=i(50778);let c,r=t=>t;(0,a.Z)([(0,o.Mo)("ha-radio")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[s.W,(0,d.iv)(c||(c=r`:host{--mdc-theme-secondary:var(--primary-color)}`))]}}]}}),n.J)},92824:function(t,e,i){"use strict";var a=i(61701),n=i(72621),s=(i(71695),i(40251),i(47021),i(60930)),d=i(9714),o=i(57243),c=i(50778),r=i(22381),l=i(76320);i(23334);let u,h,f,p,m=t=>t;(0,a.Z)([(0,c.Mo)("ha-select")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",decorators:[(0,c.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,c.Cb)({type:Boolean,reflect:!0})],key:"clearable",value(){return!1}},{kind:"field",decorators:[(0,c.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value(){return!1}},{kind:"field",decorators:[(0,c.Cb)()],key:"options",value:void 0},{kind:"method",key:"render",value:function(){return(0,o.dy)(u||(u=m` ${0} ${0} `),(0,n.Z)(i,"render",this,3)([]),this.clearable&&!this.required&&!this.disabled&&this.value?(0,o.dy)(h||(h=m`<ha-icon-button label="clear" @click="${0}" .path="${0}"></ha-icon-button>`),this._clearValue,"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"):o.Ld)}},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?(0,o.dy)(f||(f=m`<span class="mdc-select__icon"><slot name="icon"></slot></span>`)):o.Ld}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),window.addEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"firstUpdated",value:async function(){var t;((0,n.Z)(i,"firstUpdated",this,3)([]),this.inlineArrow)&&(null===(t=this.shadowRoot)||void 0===t||null===(t=t.querySelector(".mdc-select__selected-text-container"))||void 0===t||t.classList.add("inline-arrow"))}},{kind:"method",key:"updated",value:function(t){if((0,n.Z)(i,"updated",this,3)([t]),t.has("inlineArrow")){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".mdc-select__selected-text-container");this.inlineArrow?null==t||t.classList.add("inline-arrow"):null==t||t.classList.remove("inline-arrow")}t.get("options")&&(this.layoutOptions(),this.selectByValue(this.value))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),window.removeEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"_clearValue",value:function(){!this.disabled&&this.value&&(this.valueSetDirectly=!0,this.select(-1),this.mdcFoundation.handleChange())}},{kind:"field",key:"_translationsUpdated",value(){return(0,r.D)((async()=>{await(0,l.y)(),this.layoutOptions()}),500)}},{kind:"field",static:!0,key:"styles",value(){return[d.W,(0,o.iv)(p||(p=m`:host([clearable]){position:relative}.mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:var(--secondary-text-color)}.mdc-select__anchor{width:var(--ha-select-min-width,200px)}.mdc-select--filled .mdc-select__anchor{height:var(--ha-select-height,56px)}.mdc-select--filled .mdc-floating-label{inset-inline-start:12px;inset-inline-end:initial;direction:var(--direction)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{inset-inline-start:48px;inset-inline-end:initial;direction:var(--direction)}.mdc-select .mdc-select__anchor{padding-inline-start:12px;padding-inline-end:0px;direction:var(--direction)}.mdc-select__anchor .mdc-floating-label--float-above{transform-origin:var(--float-start)}.mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,0px)}:host([clearable]) .mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:absolute;top:10px;right:28px;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);inset-inline-start:initial;inset-inline-end:28px;direction:var(--direction)}.inline-arrow{flex-grow:0}`))]}}]}}),s.K)},51223:function(t,e,i){"use strict";i.a(t,(async function(t,e){try{var a=i(61701),n=(i(71695),i(47021),i(57243)),s=i(50778),d=i(94571),o=i(59847),c=i(45729),r=(i(65981),i(37583),t([c]));c=(r.then?(await r)():r)[0];let l,u,h,f,p=t=>t;(0,a.Z)([(0,s.Mo)("ha-state-icon")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"stateValue",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"icon",value:void 0},{kind:"method",key:"render",value:function(){var t,e;const i=this.icon||this.stateObj&&(null===(t=this.hass)||void 0===t||null===(t=t.entities[this.stateObj.entity_id])||void 0===t?void 0:t.icon)||(null===(e=this.stateObj)||void 0===e?void 0:e.attributes.icon);if(i)return(0,n.dy)(l||(l=p`<ha-icon .icon="${0}"></ha-icon>`),i);if(!this.stateObj)return n.Ld;if(!this.hass)return this._renderFallback();const a=(0,c.gD)(this.hass,this.stateObj,this.stateValue).then((t=>t?(0,n.dy)(u||(u=p`<ha-icon .icon="${0}"></ha-icon>`),t):this._renderFallback()));return(0,n.dy)(h||(h=p`${0}`),(0,d.C)(a))}},{kind:"method",key:"_renderFallback",value:function(){const t=(0,o.N)(this.stateObj);return(0,n.dy)(f||(f=p` <ha-svg-icon .path="${0}"></ha-svg-icon> `),c.Ls[t]||c.Rb)}}]}}),n.oi);e()}catch(l){e(l)}}))},83166:function(t,e,i){"use strict";var a=i(61701),n=i(72621),s=(i(71695),i(47021),i(1105)),d=i(33990),o=i(57243),c=i(50778),r=i(5111);let l,u,h,f,p=t=>t;(0,a.Z)([(0,c.Mo)("ha-textfield")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",decorators:[(0,c.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,c.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,c.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,c.Cb)({type:Boolean})],key:"iconTrailing",value(){return!1}},{kind:"field",decorators:[(0,c.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,c.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,c.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,c.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(t){(0,n.Z)(i,"updated",this,3)([t]),(t.has("invalid")||t.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||t.has("invalid")&&void 0!==t.get("invalid"))&&this.reportValidity()),t.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),t.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),t.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(t,e=!1){const i=e?"trailing":"leading";return(0,o.dy)(l||(l=p` <span class="mdc-text-field__icon mdc-text-field__icon--${0}" tabindex="${0}"> <slot name="${0}Icon"></slot> </span> `),i,e?1:-1,i)}},{kind:"field",static:!0,key:"styles",value(){return[d.W,(0,o.iv)(u||(u=p`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}input[type=color]{height:20px}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=color]::-webkit-color-swatch-wrapper{padding:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}#helper-text ha-markdown{display:inline-block}`)),"rtl"===r.E.document.dir?(0,o.iv)(h||(h=p`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}`)):(0,o.iv)(f||(f=p``))]}}]}}),s.P)},43546:function(t,e,i){"use strict";i.d(e,{Cp:()=>d,TZ:()=>o,W2:()=>s,YY:()=>r,iI:()=>n,j2:()=>c,oT:()=>a});i(19083),i(9359),i(70104),i(77439),i(19423),i(40251),i(97499),i(61006);const a=t=>t.map((t=>{if("string"!==t.type)return t;switch(t.name){case"username":return Object.assign(Object.assign({},t),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},t),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},t),{},{autocomplete:"one-time-code",autofocus:!0});default:return t}})),n=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),s=async(t,e,i,a)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:i,password:a}),d=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:i}),o=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:i}),c=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:i}),r=(t,e,i)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:i})},47844:function(t,e,i){"use strict";i.d(e,{T9:()=>f,kU:()=>d,i4:()=>l,sF:()=>n,z9:()=>k,nk:()=>r,Mw:()=>v,Ch:()=>c,Lr:()=>h,jU:()=>o,Xn:()=>m,r:()=>p,B:()=>b,ou:()=>y,zj:()=>_,qW:()=>s});i(19423),i(40251),i(88044),i(71695),i(47021);var a=i(43546);const n=[1,2,3,4,6,8],s=2,d="hls",o="web_rtc",c=(t,e,i)=>`${t}&width=${e}&height=${i}`,r=t=>`/api/camera_proxy_stream/${t.entity_id}?token=${t.attributes.access_token}`,l=async(t,e,i,a)=>{const n=await(async(t,e,i,a,n,...s)=>{let d=a[t];d||(d=a[t]={});const o=d[n];if(o)return o;const c=i(a,n,...s);return d[n]=c,c.then((()=>setTimeout((()=>{d[n]=void 0}),e)),(()=>{d[n]=void 0})),c})("_cameraTmbUrl",9e3,u,t,e);return c(n,i,a)},u=async(t,e)=>{const i=await(0,a.iI)(t,`/api/camera_proxy/${e}`);return t.hassUrl(i.path)},h=async(t,e,i)=>{const a={type:"camera/stream",entity_id:e};i&&(a.format=i);const n=await t.callWS(a);return n.url=t.hassUrl(n.url),n},f=(t,e,i,a)=>t.connection.subscribeMessage(a,{type:"camera/webrtc/offer",entity_id:e,offer:i}),p=(t,e,i,a)=>t.callWS({type:"camera/webrtc/candidate",entity_id:e,session_id:i,candidate:a}),m=(t,e)=>t.callWS({type:"camera/get_prefs",entity_id:e}),v=(t,e,i)=>t.callWS(Object.assign({type:"camera/update_prefs",entity_id:e},i)),g="media-source://camera/",b=t=>t.startsWith(g),_=t=>t.substring(22),y=async(t,e)=>t.callWS({type:"camera/capabilities",entity_id:e}),k=async(t,e)=>t.callWS({type:"camera/webrtc/get_client_config",entity_id:e})},80654:function(t,e,i){"use strict";i.d(e,{g:()=>d});const a=window;"customIconsets"in a||(a.customIconsets={});const n=a.customIconsets,s=window;"customIcons"in s||(s.customIcons={});const d=new Proxy(s.customIcons,{get:(t,e)=>{var i;return null!==(i=t[e])&&void 0!==i?i:n[e]?{getIcon:n[e]}:void 0}})},96194:function(t,e,i){"use strict";i.d(e,{ON:()=>d,PX:()=>o,V_:()=>c,lz:()=>s,nZ:()=>n,rk:()=>l});var a=i(92636);const n="unavailable",s="unknown",d="on",o="off",c=[n,s],r=[n,s,o],l=(0,a.z)(c);(0,a.z)(r)},69919:function(t,e,i){"use strict";i.a(t,(async function(t,a){try{i.d(e,{EX:()=>f,Fj:()=>x,M$:()=>w,SO:()=>p,Sk:()=>v,TN:()=>$,UJ:()=>g,Ym:()=>C,hF:()=>m});i(19083),i(61893),i(9359),i(56475),i(70104),i(40251);var n=i(73358),s=i(73850),d=i(59847),o=i(75278),c=i(50602),r=i(1416),l=i(76131),u=i(72473),h=t([c]);c=(h.then?(await h)():h)[0];let f=function(t){return t[t.INSTALL=1]="INSTALL",t[t.SPECIFIC_VERSION=2]="SPECIFIC_VERSION",t[t.PROGRESS=4]="PROGRESS",t[t.BACKUP=8]="BACKUP",t[t.RELEASE_NOTES=16]="RELEASE_NOTES",t}({});const p=t=>(0,o.e)(t,f.PROGRESS)&&null!==t.attributes.update_percentage,m=(t,e=!1)=>(t.state===n.uo||e&&Boolean(t.attributes.skipped_version))&&(0,o.e)(t,f.INSTALL),v=t=>!!t.attributes.in_progress,g=(t,e)=>t.callWS({type:"update/release_notes",entity_id:e}),b="ioBroker Core",_="ioBroker Supervisor",y="ioBroker Operating System",k=(t,e)=>Object.values(t).filter((t=>"update"===(0,d.N)(t))).sort(((t,i)=>t.attributes.title===b?-3:i.attributes.title===b?3:t.attributes.title===y?-2:i.attributes.title===y?2:t.attributes.title===_?-1:i.attributes.title===_?1:(0,r.fe)(t.attributes.title||t.attributes.friendly_name||"",i.attributes.title||i.attributes.friendly_name||"",e))),x=(t,e=!1)=>k(t).filter((t=>m(t,e))),w=async(t,e)=>{const i=k(e.states,e.locale.language).map((t=>t.entity_id));if(!i.length)return void(0,l.showAlertDialog)(t,{title:e.localize("ui.panel.config.updates.no_update_entities.title"),text:e.localize("ui.panel.config.updates.no_update_entities.description"),warning:!0});(0,u.C)(t,{message:e.localize("ui.panel.config.updates.checking_updates")});let a=0;const n=await e.connection.subscribeEvents((i=>{"update"===(0,s.M)(i.data.entity_id)&&(a++,(0,u.C)(t,{message:e.localize("ui.panel.config.updates.updates_refreshed",{count:a})}))}),"state_changed");await e.callService("homeassistant","update_entity",{entity_id:i}),await new Promise((t=>{setTimeout(t,15e3)})),n(),0===a&&(0,u.C)(t,{message:e.localize("ui.panel.config.updates.no_new_updates")})},C=(t,e)=>{const i=t.state,a=t.attributes;if("off"===i){return a.latest_version&&a.skipped_version===a.latest_version?a.latest_version:e.formatEntityState(t)}if("on"===i&&v(t)){return(0,o.e)(t,f.PROGRESS)&&null!==a.update_percentage?e.localize("ui.card.update.installing_with_progress",{progress:(0,c.uf)(a.update_percentage,e.locale,{maximumFractionDigits:a.display_precision,minimumFractionDigits:a.display_precision})}):e.localize("ui.card.update.installing")}return e.formatEntityState(t)},$=(t,e)=>{var i;if("hassio"!==(null===(i=e[t.entity_id])||void 0===i?void 0:i.domain))return"generic";const a=t.attributes.title||"";return a===b?"home_assistant":[b,_,y].includes(a)?"generic":"addon"};a()}catch(f){a(f)}}))},29001:function(t,e,i){"use strict";i.a(t,(async function(t,a){try{i.r(e),i.d(e,{DialogEnergyDeviceSettings:()=>$});var n=i(61701),s=(i(19083),i(71695),i(92745),i(9359),i(56475),i(31526),i(70104),i(19423),i(40251),i(47021),i(31622),i(57243)),d=i(50778),o=i(36522),c=i(49976),r=i(58725),l=i(42983),u=(i(73729),i(55486),i(72781),i(92824),i(1118)),h=i(17705),f=i(96309),p=i(28008),m=t([r,l,u]);[r,l,u]=m.then?(await m)():m;let v,g,b,_,y,k,x=t=>t;const w="M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",C=["energy"];let $=(0,n.Z)([(0,d.Mo)("dialog-energy-device-settings")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_device",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_energy_units",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_error",value:void 0},{kind:"field",key:"_excludeList",value:void 0},{kind:"field",key:"_possibleParents",value(){return[]}},{kind:"method",key:"showDialog",value:async function(t){this._params=t,this._device=this._params.device,this._computePossibleParents(),this._energy_units=(await(0,f.J9)(this.hass,"energy")).units,this._excludeList=this._params.device_consumptions.map((t=>t.stat_consumption)).filter((t=>{var e;return t!==(null===(e=this._device)||void 0===e?void 0:e.stat_consumption)}))}},{kind:"method",key:"_computePossibleParents",value:function(){if(!this._device||!this._params)return void(this._possibleParents=[]);const t=[],e=this._params.device_consumptions;!function i(a){e.forEach((e=>{e.included_in_stat===a&&(t.push(e.stat_consumption),i(e.stat_consumption))}))}(this._device.stat_consumption),this._possibleParents=this._params.device_consumptions.filter((e=>{var i;return e.stat_consumption!==this._device.stat_consumption&&e.stat_consumption!==(null===(i=this._params)||void 0===i||null===(i=i.device)||void 0===i?void 0:i.stat_consumption)&&!t.includes(e.stat_consumption)}))}},{kind:"method",key:"closeDialog",value:function(){return this._params=void 0,this._device=void 0,this._error=void 0,this._excludeList=void 0,(0,o.B)(this,"dialog-closed",{dialog:this.localName}),!0}},{kind:"method",key:"render",value:function(){var t,e,i,a,n;if(!this._params)return s.Ld;const d=(null===(t=this._energy_units)||void 0===t?void 0:t.join(", "))||"";return(0,s.dy)(v||(v=x` <ha-dialog open .heading="${0}" @closed="${0}"> ${0} <div> ${0} </div> <ha-statistic-picker .hass="${0}" .helpMissingEntityUrl="${0}" .includeUnitClass="${0}" .value="${0}" .label="${0}" .excludeStatistics="${0}" @value-changed="${0}" dialogInitialFocus></ha-statistic-picker> <ha-textfield .label="${0}" type="text" .disabled="${0}" .value="${0}" .placeholder="${0}" @input="${0}"> </ha-textfield> <ha-select .label="${0}" .value="${0}" .helper="${0}" .disabled="${0}" @selected="${0}" @closed="${0}" fixedMenuPosition naturalMenuWidth clearable> ${0} </ha-select> <mwc-button @click="${0}" slot="secondaryAction"> ${0} </mwc-button> <mwc-button @click="${0}" .disabled="${0}" slot="primaryAction"> ${0} </mwc-button> </ha-dialog> `),(0,s.dy)(g||(g=x`<ha-svg-icon .path="${0}" style="--mdc-icon-size:32px"></ha-svg-icon> ${0}`),w,this.hass.localize("ui.panel.config.energy.device_consumption.dialog.header")),this.closeDialog,this._error?(0,s.dy)(b||(b=x`<p class="error">${0}</p>`),this._error):"",this.hass.localize("ui.panel.config.energy.device_consumption.dialog.selected_stat_intro",{unit:d}),this.hass,u.kJ,C,null===(e=this._device)||void 0===e?void 0:e.stat_consumption,this.hass.localize("ui.panel.config.energy.device_consumption.dialog.device_consumption_energy"),this._excludeList,this._statisticChanged,this.hass.localize("ui.panel.config.energy.device_consumption.dialog.display_name"),!this._device,(null===(i=this._device)||void 0===i?void 0:i.name)||"",this._device?(0,h.Kd)(this.hass,this._device.stat_consumption,null===(a=this._params)||void 0===a||null===(a=a.statsMetadata)||void 0===a?void 0:a[this._device.stat_consumption]):"",this._nameChanged,this.hass.localize("ui.panel.config.energy.device_consumption.dialog.included_in_device"),(null===(n=this._device)||void 0===n?void 0:n.included_in_stat)||"",this.hass.localize("ui.panel.config.energy.device_consumption.dialog.included_in_device_helper"),!this._device,this._parentSelected,c.U,this._possibleParents.length?this._possibleParents.map((t=>{var e;return(0,s.dy)(y||(y=x` <mwc-list-item .value="${0}">${0}</mwc-list-item> `),t.stat_consumption,t.name||(0,h.Kd)(this.hass,t.stat_consumption,null===(e=this._params)||void 0===e||null===(e=e.statsMetadata)||void 0===e?void 0:e[t.stat_consumption]))})):(0,s.dy)(_||(_=x` <mwc-list-item disabled="disabled" value="-">${0}</mwc-list-item> `),this.hass.localize("ui.panel.config.energy.device_consumption.dialog.no_upstream_devices")),this.closeDialog,this.hass.localize("ui.common.cancel"),this._save,!this._device,this.hass.localize("ui.common.save"))}},{kind:"method",key:"_statisticChanged",value:function(t){t.detail.value?(this._device={stat_consumption:t.detail.value},this._computePossibleParents()):this._device=void 0}},{kind:"method",key:"_nameChanged",value:function(t){const e=Object.assign(Object.assign({},this._device),{},{name:t.target.value});e.name||delete e.name,this._device=e}},{kind:"method",key:"_parentSelected",value:function(t){const e=Object.assign(Object.assign({},this._device),{},{included_in_stat:t.target.value});e.included_in_stat||delete e.included_in_stat,this._device=e}},{kind:"method",key:"_save",value:async function(){try{await this._params.saveCallback(this._device),this.closeDialog()}catch(t){this._error=t.message}}},{kind:"get",static:!0,key:"styles",value:function(){return[p.yu,(0,s.iv)(k||(k=x`ha-statistic-picker{width:100%}ha-select{margin-top:16px;width:100%}ha-textfield{margin-top:16px;width:100%}`))]}}]}}),s.oi);a()}catch(v){a(v)}}))},96530:function(t,e,i){"use strict";i.d(e,{X:()=>s,y:()=>n});var a=i(92636);const n=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],s=(0,a.z)(n)},30511:function(t,e,i){"use strict";i.r(e),i.d(e,{mdiHomeAssistant:()=>a});const a="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"},22152:function(){Element.prototype.toggleAttribute||(Element.prototype.toggleAttribute=function(t,e){return void 0!==e&&(e=!!e),this.hasAttribute(t)?!!e||(this.removeAttribute(t),!1):!1!==e&&(this.setAttribute(t,""),!0)})},31948:function(t,e,i){"use strict";i.a(t,(async function(t,e){try{i(71695),i(40251),i(47021);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await i.e("73378").then(i.bind(i,88198))).default),e()}catch(a){e(a)}}),1)}}]); //# sourceMappingURL=30341.1cd2b617bc023f7b.js.map