iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
8 lines • 49.4 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["74763"],{96814:function(e,t,i){i(9359),i(31526),e.exports=function e(t){return Object.freeze(t),Object.getOwnPropertyNames(t).forEach((function(i){!t.hasOwnProperty(i)||null===t[i]||"object"!=typeof t[i]&&"function"!=typeof t[i]||Object.isFrozen(t[i])||e(t[i])})),t}},13245:function(e,t,i){"use strict";i.d(t,{$y:()=>s,fs:()=>n,j:()=>a});i(40251);const o=(e,t,i)=>new Promise(((o,a)=>{const n=document.createElement(e);let s="src",r="body";switch(n.onload=()=>o(t),n.onerror=()=>a(t),e){case"script":n.async=!0,i&&(n.type=i);break;case"link":n.type="text/css",n.rel="stylesheet",s="href",r="head"}n[s]=t,document[r].appendChild(n)})),a=e=>o("link",e),n=e=>o("script",e),s=e=>o("script",e,"module")},87707:function(e,t,i){"use strict";i.d(t,{Q:()=>o});const o=e=>!(!e.detail.selected||"property"!==e.detail.source)&&(e.currentTarget.selected=!1,!0)},35830:function(e,t,i){"use strict";i.d(t,{q:()=>o});const o=e=>{const t=window.location.pathname;return e?t+"?"+e:t}},54237:function(e,t,i){"use strict";i.r(t),i.d(t,{HaIconButtonArrowNext:()=>d});var o=i(61701),a=(i(71695),i(47021),i(57243)),n=i(50778),s=i(5111);i(23334);let r,l=e=>e;let d=(0,o.Z)([(0,n.Mo)("ha-icon-button-arrow-next")],(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)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_icon",value(){return"rtl"===s.E.document.dir?"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z":"M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"}},{kind:"method",key:"render",value:function(){var e;return(0,a.dy)(r||(r=l` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.next"))||"Next",this._icon)}}]}}),a.oi)},54202:function(e,t,i){"use strict";i.r(t),i.d(t,{HaIconButtonArrowPrev:()=>d});var o=i(61701),a=(i(71695),i(47021),i(57243)),n=i(50778),s=i(5111);i(23334);let r,l=e=>e;let d=(0,o.Z)([(0,n.Mo)("ha-icon-button-arrow-prev")],(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)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_icon",value(){return"rtl"===s.E.document.dir?"M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z":"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"}},{kind:"method",key:"render",value:function(){var e;return(0,a.dy)(r||(r=l` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.back"))||"Back",this._icon)}}]}}),a.oi)},17170:function(e,t,i){"use strict";i.a(e,(async function(e,o){try{i.r(t),i.d(t,{HaSpinner:()=>v});var a=i(61701),n=i(72621),s=(i(71695),i(47021),i(97677)),r=i(43580),l=i(57243),d=i(50778),c=e([s]);s=(c.then?(await c)():c)[0];let h,u=e=>e,v=(0,a.Z)([(0,d.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value(){return[r.Z,(0,l.iv)(h||(h=u`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}]}}),s.Z);o()}catch(h){o(h)}}))},77197:function(e,t,i){"use strict";var o=i(61701),a=i(72621),n=(i(71695),i(9359),i(31526),i(47021),i(89373),i(50778));const s=customElements.get("paper-tabs");let r;(0,o.Z)([(0,n.Mo)("ha-tabs")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:"_firstTabWidth",value(){return 0}},{kind:"field",key:"_lastTabWidth",value(){return 0}},{kind:"field",key:"_lastLeftHiddenState",value(){return!1}},{kind:"field",key:"_lastRightHiddenState",value(){return!1}},{kind:"get",static:!0,key:"template",value:function(){if(!r){r=s.template.cloneNode(!0);const e=r.content.querySelector("style");r.content.querySelectorAll("paper-icon-button").forEach((e=>{e.setAttribute("noink","")})),e.appendChild(document.createTextNode("\n #selectionBar {\n box-sizing: border-box;\n }\n .not-visible {\n display: none;\n }\n paper-icon-button {\n width: 24px;\n height: 48px;\n padding: 0;\n margin: 0;\n }\n "))}return r}},{kind:"method",key:"_tabChanged",value:function(e,t){(0,a.Z)(i,"_tabChanged",this,3)([e,t]);const o=this.querySelectorAll("paper-tab:not(.hide-tab)");o.length>0&&(this._firstTabWidth=o[0].clientWidth,this._lastTabWidth=o[o.length-1].clientWidth);const n=this.querySelector(".iron-selected");n&&(n.scrollIntoView(),this._affectScroll(0))}},{kind:"method",key:"_affectScroll",value:function(e){if(0===this._firstTabWidth||0===this._lastTabWidth)return;this.$.tabsContainer.scrollLeft+=e;const t=this.$.tabsContainer.scrollLeft,i="rtl"===this.dir,o=Math.abs(t)<this._firstTabWidth,a=Math.abs(t)+this._lastTabWidth>this._tabContainerScrollSize;this._leftHidden=i?a:o,this._rightHidden=i?o:a,i?this._lastRightHiddenState!==this._rightHidden&&(this._lastRightHiddenState=this._rightHidden,this.$.tabsContainer.scrollLeft-=this._rightHidden?-23:23):this._lastLeftHiddenState!==this._leftHidden&&(this._lastLeftHiddenState=this._leftHidden,this.$.tabsContainer.scrollLeft+=this._leftHidden?-23:23)}}]}}),s)},61610:function(e,t,i){"use strict";i.d(t,{Gc:()=>o});const o=(e,t,i)=>e.subscribeEvents((e=>{e.data.url_path===t&&i()}),"lovelace_updated")},6649:function(e,t,i){"use strict";i.d(t,{JR:()=>a,Y:()=>n,iM:()=>s,j2:()=>o});i(19423);const o=e=>e.callWS({type:"lovelace/dashboards/list"}),a=(e,t)=>e.callWS(Object.assign({type:"lovelace/dashboards/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"lovelace/dashboards/update",dashboard_id:t},i)),s=(e,t)=>e.callWS({type:"lovelace/dashboards/delete",dashboard_id:t})},20:function(e,t,i){"use strict";i.d(t,{SN:()=>a,eL:()=>o,fg:()=>s,id:()=>n});i(19423);const o=e=>e.sendMessagePromise({type:"lovelace/resources"}),a=(e,t)=>e.callWS(Object.assign({type:"lovelace/resources/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"lovelace/resources/update",resource_id:t},i)),s=(e,t)=>e.callWS({type:"lovelace/resources/delete",resource_id:t})},34515:function(e,t,i){"use strict";i.r(t);var o=i(61701),a=(i(71695),i(47021),i(31622),i(57243)),n=i(50778);i(54202),i(43344),i(99426);let s,r,l,d,c,h=e=>e;(0,o.Z)([(0,n.Mo)("hass-error-screen")],(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)({type:Boolean})],key:"toolbar",value(){return!0}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"rootnav",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)()],key:"error",value:void 0},{kind:"method",key:"render",value:function(){var e,t;return(0,a.dy)(s||(s=h` ${0} <div class="content"> <ha-alert alert-type="error">${0}</ha-alert> <slot> <mwc-button ="${0}"> ${0} </mwc-button> </slot> </div> `),this.toolbar?(0,a.dy)(r||(r=h`<div class="toolbar"> ${0} </div>`),this.rootnav||null!==(e=history.state)&&void 0!==e&&e.root?(0,a.dy)(l||(l=h` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):(0,a.dy)(d||(d=h` <ha-icon-button-arrow-prev .hass="${0}" ="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)):"",this.error,this._handleBack,null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))}},{kind:"method",key:"_handleBack",value:function(){history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,a.iv)(c||(c=h`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:400;color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box} (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev{pointer-events:auto}.content{color:var(--primary-text-color);height:calc(100% - var(--header-height));display:flex;padding:16px;align-items:center;justify-content:center;flex-direction:column;box-sizing:border-box}a{color:var(--primary-color)}ha-alert{margin-bottom:16px}`))]}}]}}),a.oi)},75375:function(e,t,i){"use strict";i.a(e,(async function(e,o){try{i.r(t);var a=i(61701),n=(i(71695),i(47021),i(57243)),s=i(50778),r=i(17170),l=(i(54202),i(43344),i(28008)),d=e([r]);r=(d.then?(await d)():d)[0];let c,h,u,v,f,p,b=e=>e;(0,a.Z)([(0,s.Mo)("hass-loading-screen")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"no-toolbar"})],key:"noToolbar",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"rootnav",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)()],key:"message",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,n.dy)(c||(c=b` ${0} <div class="content"> <ha-spinner></ha-spinner> ${0} </div> `),this.noToolbar?"":(0,n.dy)(h||(h=b`<div class="toolbar"> ${0} </div>`),this.rootnav||null!==(e=history.state)&&void 0!==e&&e.root?(0,n.dy)(u||(u=b` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):(0,n.dy)(v||(v=b` <ha-icon-button-arrow-prev .hass="${0}" ="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)),this.message?(0,n.dy)(f||(f=b`<div id="loading-text">${0}</div>`),this.message):n.Ld)}},{kind:"method",key:"_handleBack",value:function(){history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[l.Qx,(0,n.iv)(p||(p=b`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:400;color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box} (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto}.content{height:calc(100% - var(--header-height));display:flex;flex-direction:column;align-items:center;justify-content:center}#loading-text{max-width:350px;margin-top:16px}`))]}}]}}),n.oi);o()}catch(c){o(c)}}))},13144:function(e,t,i){"use strict";i.d(t,{w:()=>n});i(71695),i(40251),i(47021);var o=i(36522);const a=()=>Promise.all([i.e("97983"),i.e("63055"),i.e("90987")]).then(i.bind(i,6827)),n=(e,t)=>{(0,o.B)(e,"show-dialog",{dialogTag:"dialog-lovelace-dashboard-detail",dialogImport:a,dialogParams:t})}},48990:function(e,t,i){"use strict";i.d(t,{A5:()=>s});i(71695),i(9359),i(68107),i(56475),i(70104),i(19423),i(47021);var o=i(54305),a=i(48977),n=i(10571);const s=e=>{if((0,a.Tx)(e))return e;const t=Object.assign({},e);return t.views&&(t.views=t.views.map(r)),t},r=e=>{if((0,n.s)(e))return e;const t=Object.assign({},e);return t.badges&&!t.badges.every(Boolean)&&(t.badges=t.badges.filter(Boolean)),t.sections&&(t.sections=t.sections.map(l)),t},l=e=>{const t=Object.assign({},e);if(e.title){if(!(0,o.N)(t)){const e={type:"heading",heading:t.title};t.cards=[e,...t.cards||[]]}delete t.title}return t}},34216:function(e,t,i){"use strict";i.d(t,{k:()=>s});i(71695),i(9359),i(31526),i(11740),i(47021),i(72700),i(8038),i(71513),i(75656),i(50100),i(18084);var o=i(13245);const a={},n={},s=(e,t)=>{e.forEach((e=>{const i=new URL(e.url,t.auth.data.hassUrl).toString();switch(e.type){case"css":if(i in a)break;a[i]=(0,o.j)(i);break;case"js":if(i in n)break;n[i]=(0,o.fs)(i);break;case"module":(0,o.$y)(i);break;default:console.warn(`Unknown resource type specified: ${e.type}`)}}))}},23759:function(e,t,i){"use strict";i.d(t,{L:()=>n});i(71695),i(40251),i(47021);var o=i(36522);const a=()=>Promise.all([i.e("97983"),i.e("59985"),i.e("9979")]).then(i.bind(i,86614)),n=(e,t)=>{(0,o.B)(e,"show-dialog",{dialogTag:"dialog-dashboard-strategy-editor",dialogImport:a,dialogParams:t})}},8823:function(e,t,i){"use strict";i.d(t,{Z:()=>s});i(71695),i(40251),i(47021);var o=i(36522);const a="show-save-config";let n=!1;const s=(e,t)=>{n||(n=!0,(0,o.B)(e,"register-dialog",{dialogShowEvent:a,dialogTag:"hui-dialog-save-config",dialogImport:()=>Promise.all([i.e("97983"),i.e("30247")]).then(i.bind(i,44111))})),(0,o.B)(e,a,t)}},62127:function(e,t,i){"use strict";i.d(t,{k:()=>s});i(71695),i(40251),i(47021);var o=i(36522);let a=!1;const n="show-edit-view",s=(e,t)=>{a||(a=!0,(e=>{(0,o.B)(e,"register-dialog",{dialogShowEvent:n,dialogTag:"hui-dialog-edit-view",dialogImport:()=>Promise.all([i.e("46379"),i.e("97983"),i.e("78943"),i.e("15722"),i.e("42311"),i.e("27090"),i.e("3049"),i.e("72308"),i.e("20123")]).then(i.bind(i,29809))})})(e)),(0,o.B)(e,n,t)}},45143:function(e,t,i){"use strict";i.a(e,(async function(e,o){try{i.r(t),i.d(t,{LovelacePanel:()=>z});var a=i(61701),n=i(72621),s=(i(71695),i(19423),i(40251),i(47021),i(31622),i(96814)),r=i.n(s),l=i(57243),d=i(50778),c=i(35830),h=i(58776),u=i(57816),v=i(61610),f=i(48977),p=i(20),b=(i(34515),i(75375)),g=i(72473),k=i(48990),m=i(34216),y=i(8823),w=i(83257),_=i(28421),x=e([b,w]);[b,w]=x.then?(await x)():x;let C,$,V,M,H=e=>e;window.loadCardHelpers=()=>Promise.all([i.e("79931"),i.e("3371"),i.e("72974"),i.e("59555")]).then(i.bind(i,12660));const L={strategy:{type:"original-states"}};let A=!1,S=!1,z=(0,a.Z)([(0,d.Mo)("ha-panel-lovelace")],(function(e,t){class o extends t{constructor(...t){super(...t),e(this)}}return{F:o,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"panel",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_panelState",value(){return"loading"}},{kind:"field",decorators:[(0,d.SB)()],key:"_errorMsg",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"lovelace",value:void 0},{kind:"field",key:"_ignoreNextUpdateEvent",value(){return!1}},{kind:"field",key:"_fetchConfigOnConnect",value(){return!1}},{kind:"field",key:"_unsubUpdates",value:void 0},{kind:"field",key:"_loading",value(){return!1}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(o,"connectedCallback",this,3)([]),this.lovelace&&this.hass&&this.lovelace.locale!==this.hass.locale?this._setLovelaceConfig(this.lovelace.config,this.lovelace.rawConfig,this.lovelace.mode):this.lovelace&&"generated"===this.lovelace.mode?(this._panelState="loading",this._regenerateConfig()):this._fetchConfigOnConnect&&this._fetchConfig(!1),window.addEventListener("connection-status",this._handleConnectionStatus)}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(o,"disconnectedCallback",this,3)([]),null!==this.urlPath&&this._unsubUpdates&&(this._unsubUpdates.then((e=>e())),this._unsubUpdates=void 0),window.removeEventListener("connection-status",this._handleConnectionStatus)}},{kind:"method",key:"render",value:function(){const e=this._panelState;return"loaded"===e?(0,l.dy)(C||(C=H` <hui-root .panel="${0}" .hass="${0}" .lovelace="${0}" .route="${0}" .narrow="${0}" -refresh="${0}"></hui-root> `),this.panel,this.hass,this.lovelace,this.route,this.narrow,this._forceFetchConfig):"error"===e?(0,l.dy)($||($=H` <hass-error-screen .hass="${0}" title="${0}" .error="${0}"> <mwc-button raised ="${0}"> ${0} </mwc-button> </hass-error-screen> `),this.hass,(0,u.Lh)(this.hass.localize,"lovelace"),this._errorMsg,this._forceFetchConfig,this.hass.localize("ui.panel.lovelace.reload_lovelace")):"yaml-editor"===e?(0,l.dy)(V||(V=H` <hui-editor .hass="${0}" .lovelace="${0}" .closeEditor="${0}"></hui-editor> `),this.hass,this.lovelace,this._closeEditor):(0,l.dy)(M||(M=H` <hass-loading-screen rootnav .hass="${0}" .narrow="${0}"></hass-loading-screen> `),this.hass,this.narrow)}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(o,"willUpdate",this,3)([e]),this.lovelace||"error"===this._panelState||this._loading||this._fetchConfig(!1)}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(o,"firstUpdated",this,3)([e]),this._unsubUpdates||this._subscribeUpdates()}},{kind:"field",key:"_handleConnectionStatus",value(){return e=>{"connected"===e.detail&&this._fetchConfig(!1)}}},{kind:"method",key:"_regenerateConfig",value:async function(){const e=await(0,_.to)(L,this.hass);this._setLovelaceConfig(e,L,"generated"),this._panelState="loaded"}},{kind:"method",key:"_subscribeUpdates",value:async function(){this._unsubUpdates=(0,v.Gc)(this.hass.connection,this.urlPath,(()=>this._lovelaceChanged()))}},{kind:"field",key:"_closeEditor",value(){return()=>{this._panelState="loaded"}}},{kind:"method",key:"_lovelaceChanged",value:function(){this._ignoreNextUpdateEvent?this._ignoreNextUpdateEvent=!1:this.isConnected?(0,g.C)(this,{message:this.hass.localize("ui.panel.lovelace.changed_toast.message"),action:{action:()=>this._fetchConfig(!1),text:this.hass.localize("ui.common.refresh")},duration:-1,dismissable:!1}):this._fetchConfigOnConnect=!0}},{kind:"get",key:"urlPath",value:function(){return"lovelace"===this.panel.url_path?null:this.panel.url_path}},{kind:"method",key:"_forceFetchConfig",value:function(){this._fetchConfig(!0)}},{kind:"method",key:"_fetchConfig",value:async function(e){let t,i;this._loading=!0;let o,a=this.panel.config.mode;const n=window;n.llConfProm&&(o=n.llConfProm,n.llConfProm=void 0),S||(S=!0,(n.llResProm||(0,p.eL)(this.hass.connection)).then((e=>(0,m.k)(e,this.hass)))),null===this.urlPath&&o||(this.lovelace&&"yaml"===this.lovelace.mode&&(this._ignoreNextUpdateEvent=!0),o=(0,f.Q2)(this.hass.connection,this.urlPath,e));try{if(i=await o,(0,f.Tx)(i)){var s;if(null===(s=this.hass)||void 0===s||!s.entities||!this.hass.devices||!this.hass.areas)return;t=await(0,_.to)(i,this.hass)}else t=i}catch(l){var r;if("config_not_found"!==l.code)return console.log(l),this._panelState="error",void(this._errorMsg=l.message);if(null===(r=this.hass)||void 0===r||!r.entities||!this.hass.devices||!this.hass.areas)return;t=await(0,_.to)(L,this.hass),i=L,a="generated"}finally{this._loading=!1,this.lovelace&&"yaml"===this.lovelace.mode&&setTimeout((()=>{this._ignoreNextUpdateEvent=!1}),2e3)}this._panelState="yaml-editor"===this._panelState?this._panelState:"loaded",this._setLovelaceConfig(t,i,a)}},{kind:"method",key:"_checkLovelaceConfig",value:function(e){const t=(0,k.A5)(e);return r()(t)}},{kind:"method",key:"_setLovelaceConfig",value:function(e,t,o){e=this._checkLovelaceConfig(e);const a=this.urlPath;this.lovelace={config:e,rawConfig:t,mode:o,urlPath:this.urlPath,editMode:!!this.lovelace&&this.lovelace.editMode,locale:this.hass.locale,enableFullEditMode:()=>{A||(A=!0,Promise.all([i.e("94611"),i.e("93505"),i.e("90678")]).then(i.bind(i,59207))),this._panelState="yaml-editor"},setEditMode:e=>{"generated"===this.lovelace.mode&&e?(0,y.Z)(this,{lovelace:this.lovelace,mode:this.panel.config.mode,narrow:this.narrow}):(0,f.Tx)(this.lovelace.rawConfig)&&e?this.lovelace.enableFullEditMode():this._updateLovelace({editMode:e})},saveConfig:async e=>{const{config:t,rawConfig:i,mode:o}=this.lovelace;let n;e=this._checkLovelaceConfig(e),n=(0,f.Tx)(e)?await(0,_.to)(e,this.hass):e;try{this._updateLovelace({config:n,rawConfig:e,mode:"storage"}),this._ignoreNextUpdateEvent=!0,await(0,f.Oh)(this.hass,a,e)}catch(s){throw console.error(s),this._updateLovelace({config:t,rawConfig:i,mode:o}),s}},deleteConfig:async()=>{const{config:e,rawConfig:t,mode:i}=this.lovelace;try{const e=await(0,_.to)(L,this.hass);this._updateLovelace({config:e,rawConfig:L,mode:"generated",editMode:!1}),this._ignoreNextUpdateEvent=!0,await(0,f.vj)(this.hass,a)}catch(o){throw console.error(o),this._updateLovelace({config:e,rawConfig:t,mode:i}),o}},showToast:e=>(0,g.C)(this,e)}}},{kind:"method",key:"_updateLovelace",value:function(e){this.lovelace=Object.assign(Object.assign({},this.lovelace),e),"editMode"in e&&window.history.replaceState(null,"",(0,c.q)(e.editMode?(0,h.j4)({edit:"1"}):(0,h.pc)("edit")))}}]}}),l.oi);o()}catch(C){o(C)}}))},83257:function(e,t,i){"use strict";i.a(e,(async function(e,t){try{var o=i(61701),a=i(72621),n=(i(22152),i(71695),i(92745),i(9359),i(56475),i(1331),i(31526),i(70104),i(52924),i(40251),i(19134),i(47706),i(47021),i(31622),i(87319),i(54207),i(89373),i(57243)),s=i(50778),r=i(35359),l=i(20552),d=i(27486),c=i(72344),h=i(36522),u=i(87707),v=i(83523),f=i(35830),p=i(58776),b=i(20172),g=i(22381),k=i(76320),m=(i(34273),i(65981),i(23334),i(54237),i(54202),i(43344),i(37583),i(77197),i(48977)),y=i(6649),w=i(62162),_=i(76131),x=i(85026),C=i(91163),$=i(28008),V=i(73192),M=i(13144),H=i(27353),L=i(23759),A=i(8823),S=i(62127),z=i(28421),E=i(32930),B=i(3166),P=(i(33679),i(62504),i(83716)),T=i(90037),Z=e([B]);B=(Z.then?(await Z)():Z)[0];let U,N,j,R,D,O,F,I,W,Q,q,Y,G,J,K,X,ee,te,ie,oe,ae,ne,se,re,le,de=e=>e;const ce="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",he="M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M10,16V19.08L13.08,16H20V4H4V16H10M17,11H15V9H17V11M13,11H11V9H13V11M9,11H7V9H9V11Z",ue="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",ve="M15,7H20.5L15,1.5V7M8,0H16L22,6V18A2,2 0 0,1 20,20H8C6.89,20 6,19.1 6,18V2A2,2 0 0,1 8,0M4,4V22H20V24H4A2,2 0 0,1 2,22V4H4Z",fe="M5,15.5L7.5,20H2.5L5,15.5M9,19H21V17H9V19M5,9.5L7.5,14H2.5L5,9.5M9,13H21V11H9V13M5,3.5L7.5,8H2.5L5,3.5M9,7H21V5H9V7Z",pe="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",be="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",ge="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",ke="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",me="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",ye="M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",we="M13,3V9H21V3M13,21H21V11H13M3,21H11V15H3M3,13H11V3H3V13Z",_e="M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M14,21A2,2 0 0,1 12,23A2,2 0 0,1 10,21";(0,o.Z)([(0,s.Mo)("hui-root")],(function(e,t){class o extends t{constructor(){super(),e(this),this._debouncedConfigChanged=(0,g.D)((()=>this._selectView(this._curView,!0)),100,!1)}}return{F:o,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"panel",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"lovelace",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_curView",value:void 0},{kind:"field",key:"_viewCache",value:void 0},{kind:"field",key:"_viewScrollPositions",value(){return{}}},{kind:"field",key:"_restoreScroll",value(){return!1}},{kind:"field",key:"_debouncedConfigChanged",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"_persistentNotifications",value:void 0},{kind:"field",key:"_unsubNotifications",value:void 0},{kind:"field",key:"_conversation",value(){return(0,d.Z)((e=>(0,c.p)(this.hass,"conversation")))}},{kind:"method",key:"_renderActionItems",value:function(){var e,t,i;const o=[];this._editMode?o.push((0,n.dy)(U||(U=de`<mwc-button outlined class="exit-edit-mode" .label="${0}" ="${0}"></mwc-button> <a href="${0}" rel="noreferrer" class="menu-link" target="_blank"> <ha-icon-button .label="${0}" .path="${0}"></ha-icon-button> </a>`),this.hass.localize("ui.panel.lovelace.menu.exit_edit_mode"),this._editModeDisable,(0,V.R)(this.hass,"/dashboards/"),this.hass.localize("ui.panel.lovelace.menu.help"),pe)):o.push(this._renderNotificationButton());const a=[{icon:fe,key:"ui.panel.lovelace.unused_entities.title",overflowAction:this._handleUnusedEntities,visible:this._editMode&&!0,overflow:!0},{icon:ce,key:"ui.panel.lovelace.editor.menu.raw_editor",overflowAction:this._handleRawEditor,visible:this._editMode,overflow:!0},{icon:we,key:"ui.panel.lovelace.editor.menu.manage_dashboards",overflowAction:this._handleManageDashboards,visible:!1,overflow:!0},{icon:ve,key:"ui.panel.lovelace.editor.menu.manage_resources",overflowAction:this._handleManageResources,visible:this._editMode&&(null===(e=this.hass.userData)||void 0===e?void 0:e.showAdvanced),overflow:!0},{icon:be,key:"ui.panel.lovelace.menu.search",buttonAction:this._showQuickBar,overflowAction:this._handleShowQuickBar,visible:!this._editMode,overflow:this.narrow},{icon:he,key:"ui.panel.lovelace.menu.assist",buttonAction:this._showVoiceCommandDialog,overflowAction:this._handleShowVoiceCommandDialog,visible:!this._editMode&&this._conversation(this.hass.config.components),overflow:this.narrow},{icon:me,key:"ui.common.refresh",overflowAction:this._handleRefresh,visible:!this._editMode&&this._yamlMode,overflow:!0},{icon:ye,key:"ui.panel.lovelace.unused_entities.title",overflowAction:this._handleUnusedEntities,visible:!this._editMode&&this._yamlMode,overflow:!0},{icon:me,key:"ui.panel.lovelace.menu.reload_resources",overflowAction:this._handleReloadResources,visible:!this._editMode&&"yaml"===(null===(t=this.hass.panels.lovelace)||void 0===t||null===(t=t.config)||void 0===t?void 0:t.mode),overflow:!0},{icon:ge,key:"ui.panel.lovelace.menu.configure_ui",overflowAction:this._handleEnableEditMode,buttonAction:this._enableEditMode,visible:!this._editMode&&(null===(i=this.hass.user)||void 0===i?void 0:i.is_admin)&&!this.hass.config.recovery_mode,overflow:!0,overflow_can_promote:!0}],s=a.filter((e=>e.visible&&e.overflow)),r=1===s.length&&s[0].overflow_can_promote;if(a.filter((e=>e.visible&&(!e.overflow||r))).forEach((e=>{o.push((0,n.dy)(N||(N=de`<ha-icon-button slot="actionItems" .label="${0}" .path="${0}" ="${0}"></ha-icon-button>`),this.hass.localize(e.key),e.icon,e.buttonAction))})),s.length&&!r){const e=[];s.forEach((t=>{e.push((0,n.dy)(j||(j=de`<mwc-list-item graphic="icon" -selected="${0}"> ${0} <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> </mwc-list-item>`),t.overflowAction,this.hass.localize(t.key),t.icon))})),o.push((0,n.dy)(R||(R=de`<ha-button-menu slot="actionItems"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> ${0} </ha-button-menu>`),this.hass.localize("ui.panel.lovelace.editor.menu.open"),ue,e))}return(0,n.dy)(D||(D=de`${0}`),o)}},{kind:"method",key:"render",value:function(){var e,t,i,o;const a=null!==(e=null===(t=this.lovelace)||void 0===t?void 0:t.config.views)&&void 0!==e?e:[],s="number"==typeof this._curView?a[this._curView]:void 0,d=this.panel?(0,w._N)(this.hass,this.panel):void 0,c=(null==s?void 0:s.background)||this.config.background;return(0,n.dy)(O||(O=de` <div class="${0}"> <div class="header"> <div class="toolbar"> ${0} </div> ${0} </div> <hui-view-container .hass="${0}" .theme="${0}" id="view" -rebuild="${0}"> <hui-view-background .hass="${0}" .background="${0}"> </hui-view-background> </hui-view-container> </div> `),(0,r.$)({"edit-mode":this._editMode}),this._editMode?(0,n.dy)(F||(F=de` <div class="main-title"> ${0} <ha-icon-button slot="actionItems" .label="${0}" .path="${0}" class="edit-icon" ="${0}"></ha-icon-button> </div> <div class="action-items">${0}</div> `),d||this.hass.localize("ui.panel.lovelace.editor.header"),this.hass.localize("ui.panel.lovelace.editor.edit_lovelace.edit_title"),ge,this._editDashboard,this._renderActionItems()):(0,n.dy)(I||(I=de` ${0} ${0} <div class="action-items">${0}</div> `),null!=s&&s.subview?(0,n.dy)(W||(W=de` <ha-icon-button-arrow-prev slot="navigationIcon" ="${0}"></ha-icon-button-arrow-prev> `),this._goBack):(0,n.dy)(Q||(Q=de` <ha-menu-button slot="navigationIcon" .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow),null!=s&&s.subview?(0,n.dy)(q||(q=de`<div class="main-title">${0}</div>`),s.title):a.filter((e=>!e.subview)).length>1?(0,n.dy)(Y||(Y=de` <ha-tabs slot="title" scrollable .selected="${0}" -activate="${0}" dir="${0}"> ${0} </ha-tabs> `),this._curView,this._handleViewSelected,(0,b.Zu)(this.hass),a.map((e=>(0,n.dy)(G||(G=de` <paper-tab aria-label="${0}" class="${0}"> ${0} </paper-tab> `),(0,l.o)(e.title),(0,r.$)({"hide-tab":Boolean(e.subview||void 0!==e.visible&&(Array.isArray(e.visible)&&!e.visible.some((e=>{var t;return e.user===(null===(t=this.hass.user)||void 0===t?void 0:t.id)}))||!1===e.visible))}),e.icon?(0,n.dy)(J||(J=de` <ha-icon title="${0}" .icon="${0}"></ha-icon> `),(0,l.o)(e.title),e.icon):e.title||"Unnamed view")))):(0,n.dy)(K||(K=de` <div class="main-title"> ${0} </div> `),null!==(i=null===(o=a[0])||void 0===o?void 0:o.title)&&void 0!==i?i:d),this._renderActionItems()),this._editMode?(0,n.dy)(X||(X=de` <paper-tabs scrollable .selected="${0}" -activate="${0}" dir="${0}"> ${0} ${0} </paper-tabs> `),this._curView,this._handleViewSelected,(0,b.Zu)(this.hass),a.map((e=>(0,n.dy)(ee||(ee=de` <paper-tab aria-label="${0}" class="${0}"> ${0} ${0} ${0} </paper-tab> `),(0,l.o)(e.title),(0,r.$)({"hide-tab":Boolean(!this._editMode&&void 0!==e.visible&&(Array.isArray(e.visible)&&!e.visible.some((e=>{var t;return e.user===(null===(t=this.hass.user)||void 0===t?void 0:t.id)}))||!1===e.visible))}),this._editMode?(0,n.dy)(te||(te=de` <ha-icon-button-arrow-prev .hass="${0}" .label="${0}" class="edit-icon view" ="${0}" ?disabled="${0}"></ha-icon-button-arrow-prev> `),this.hass,this.hass.localize("ui.panel.lovelace.editor.edit_view.move_left"),this._moveViewLeft,0===this._curView):"",e.icon?(0,n.dy)(ie||(ie=de` <ha-icon class="${0}" title="${0}" .icon="${0}"></ha-icon> `),(0,r.$)({"child-view-icon":Boolean(e.subview)}),(0,l.o)(e.title),e.icon):e.title||"Unnamed view",this._editMode?(0,n.dy)(oe||(oe=de` <ha-svg-icon title="${0}" class="edit-icon view" .path="${0}" ="${0}"></ha-svg-icon> <ha-icon-button-arrow-next .hass="${0}" .label="${0}" class="edit-icon view" ="${0}" ?disabled="${0}"></ha-icon-button-arrow-next> `),this.hass.localize("ui.panel.lovelace.editor.edit_view.edit"),ge,this._editView,this.hass,this.hass.localize("ui.panel.lovelace.editor.edit_view.move_right"),this._moveViewRight,this._curView+1===a.length):""))),this._editMode?(0,n.dy)(ae||(ae=de` <ha-icon-button id="add-view" ="${0}" .label="${0}" .path="${0}"></ha-icon-button> `),this._addView,this.hass.localize("ui.panel.lovelace.editor.edit_view.add"),ke):""):"",this.hass,null==s?void 0:s.theme,this._debouncedConfigChanged,this.hass,c)}},{kind:"field",key:"_handleWindowScroll",value(){return()=>{this.toggleAttribute("scrolled",0!==window.scrollY)}}},{kind:"field",key:"_handlePopState",value(){return()=>{this._restoreScroll=!0}}},{kind:"field",key:"_isVisible",value(){return e=>Boolean(this._editMode||void 0===e.visible||!0===e.visible||Array.isArray(e.visible)&&e.visible.some((e=>{var t;return e.user===(null===(t=this.hass.user)||void 0===t?void 0:t.id)})))}},{kind:"method",key:"_clearParam",value:function(e){window.history.replaceState(null,"",(0,f.q)((0,p.pc)(e)))}},{kind:"method",key:"firstUpdated",value:function(e){(0,a.Z)(o,"firstUpdated",this,3)([e]);const t=(0,p.Q2)();var i;"1"===t.edit?(this._clearParam("edit"),null!==(i=this.hass.user)&&void 0!==i&&i.is_admin&&"storage"===this.lovelace.mode&&this.lovelace.setEditMode(!0)):"1"===t.conversation&&(this._clearParam("conversation"),this._showVoiceCommandDialog());window.addEventListener("scroll",this._handleWindowScroll,{passive:!0})}},{kind:"method",key:"connectedCallback",value:function(){(0,a.Z)(o,"connectedCallback",this,3)([]),window.addEventListener("scroll",this._handleWindowScroll,{passive:!0}),window.addEventListener("popstate",this._handlePopState),window.history.scrollRestoration="manual",this._unsubNotifications=(0,P.r)(this.hass.connection,(e=>{this._persistentNotifications=(null==e?void 0:e.length)||0}))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)(o,"disconnectedCallback",this,3)([]),window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("popstate",this._handlePopState),this.toggleAttribute("scrolled",0!==window.scrollY),window.history.scrollRestoration="auto",this._unsubNotifications&&this._unsubNotifications()}},{kind:"method",key:"updated",value:function(e){(0,a.Z)(o,"updated",this,3)([e]);const t=this._viewRoot.lastChild;let i;e.has("hass")&&t&&(t.hass=this.hass),e.has("narrow")&&t&&(t.narrow=this.narrow);let n=!1,s=this.route.path.split("/")[1];if(s=s?decodeURI(s):void 0,e.has("route")){const e=this.config.views;if(!s&&e.length)i=e.findIndex(this._isVisible),this._navigateToView(e[i].path||i,!0);else if("hass-unused-entities"===s)i="hass-unused-entities";else if(s){const t=s,o=Number(t);let a=0;for(let i=0;i<e.length;i++)if(e[i].path===t||i===o){a=i;break}i=a}}if(e.has("lovelace")){const o=e.get("lovelace");if(o&&o.config===this.lovelace.config||(n=!0),!o||o.editMode!==this.lovelace.editMode){const e=this.config&&this.config.views;"storage"===this.lovelace.mode&&"hass-unused-entities"===s&&(i=e.findIndex(this._isVisible),this._navigateToView(e[i].path||i,!0))}!n&&t&&(t.lovelace=this.lovelace)}(void 0!==i||n)&&(n&&void 0===i&&(i=this._curView),(0,k.T)((()=>{if(e.has("route")){const e=this._restoreScroll&&this._viewScrollPositions[i]||0;this._restoreScroll=!1,requestAnimationFrame((()=>scrollTo({behavior:"auto",top:e})))}this._selectView(i,n)})))}},{kind:"method",key:"_renderNotificationButton",value:function(){const e=document.body.getElementsByTagName("ha-sidebar");console.log("Got sidebars:",e);return e.length>0?(0,n.dy)(ne||(ne=de`""`)):(0,n.dy)(se||(se=de` <mwc-icon-button style="cursor:pointer;position:relative" label="${0}" ="${0}"> <ha-svg-icon path="${0}"></ha-svg-icon> ${0} </mwc-icon-button> `),this.hass.localize("ui.notification_drawer.title"),this._handleShowNotificationDrawer,_e,this._notificationsCount>0?(0,n.dy)(re||(re=de` <span style="top:-4px;right:-6px;font-size:1rem;position:absolute;min-width:20px;box-sizing:border-box;border-radius:50%;font-weight:400;background-color:var(--accent-color);line-height:24px;text-align:center;padding:0 6px;color:var(--text-primary-color)"> ${0} </span> `),this._notificationsCount):"")}},{kind:"get",key:"_notificationsCount",value:function(){const e=this.hass.states,t=Object.keys(e).filter((e=>"configurator"===e.substr(0,e.indexOf(".")))).map((t=>e[t])).length;return(this._persistentNotifications||0)+t}},{kind:"method",key:"_handleShowNotificationDrawer",value:function(){(0,T.d)(this,{narrow:this.narrow})}},{kind:"get",key:"config",value:function(){return this.lovelace.config}},{kind:"get",key:"_yamlMode",value:function(){return"yaml"===this.lovelace.mode}},{kind:"get",key:"_editMode",value:function(){return this.lovelace.editMode}},{kind:"get",key:"_viewRoot",value:function(){return this.shadowRoot.getElementById("view")}},{kind:"method",key:"_handleRefresh",value:function(e){(0,u.Q)(e)&&(0,h.B)(this,"config-refresh")}},{kind:"method",key:"_handleReloadResources",value:function(e){(0,u.Q)(e)&&(this.hass.callService("lovelace","reload_resources"),(0,_.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.lovelace.reload_resources.refresh_header"),text:this.hass.localize("ui.panel.lovelace.reload_resources.refresh_body"),confirmText:this.hass.localize("ui.common.refresh"),dismissText:this.hass.localize("ui.common.not_now"),confirm:()=>location.reload()}))}},{kind:"method",key:"_handleShowQuickBar",value:function(e){(0,u.Q)(e)&&this._showQuickBar()}},{kind:"method",key:"_showQuickBar",value:function(){(0,x.Hk)(this,{mode:x.Ie.Entity,hint:this.hass.enableShortcuts?this.hass.localize("ui.tips.key_e_hint"):void 0})}},{kind:"method",key:"_goBack",value:function(){var e,t;const i=null!==(e=null===(t=this.lovelace)||void 0===t?void 0:t.config.views)&&void 0!==e?e:[],o="number"==typeof this._curView?i[this._curView]:void 0;null!=(null==o?void 0:o.back_path)?(0,v.c)(o.back_path,{replace:!0}):history.length>1?history.back():i[0].subview?(0,v.c)("/"):(0,v.c)(this.route.prefix,{replace:!0})}},{kind:"method",key:"_handleRawEditor",value:function(e){(0,u.Q)(e)&&this.lovelace.enableFullEditMode()}},{kind:"method",key:"_handleManageDashboards",value:function(e){(0,u.Q)(e)&&(0,v.c)("/config/lovelace/dashboards")}},{kind:"method",key:"_handleManageResources",value:function(e){(0,u.Q)(e)&&(0,v.c)("/config/lovelace/resources")}},{kind:"method",key:"_handleUnusedEntities",value:function(e){var t;(0,u.Q)(e)&&(0,v.c)(`${null===(t=this.route)||void 0===t?void 0:t.prefix}/hass-unused-entities`)}},{kind:"method",key:"_handleShowVoiceCommandDialog",value:function(e){(0,u.Q)(e)&&this._showVoiceCommandDialog()}},{kind:"method",key:"_showVoiceCommandDialog",value:function(){(0,C._)(this,this.hass,{pipeline_id:"last_used"})}},{kind:"method",key:"_handleEnableEditMode",value:function(e){(0,u.Q)(e)&&this._enableEditMode()}},{kind:"method",key:"_enableEditMode",value:async function(){if(this._yamlMode)(0,_.showAlertDialog)(this,{text:this.hass.localize("ui.panel.lovelace.editor.yaml_unsupported")});else if(!(0,m.Tx)(this.lovelace.rawConfig)||(0,E.ug)(this.lovelace.rawConfig.strategy))this.lovelace.setEditMode(!0);else{var e;const t=await(0,z.lN)("dashboard",this.lovelace.rawConfig.strategy.type).catch((e=>{}));if(null!=t&&t.noEditor)return void(0,A.Z)(this,{lovelace:this.lovelace,mode:"storage",narrow:this.narrow});const i=null===(e=this.route)||void 0===e?void 0:e.prefix.slice(1);await this.hass.loadFragmentTranslation("config");const o=(await(0,y.j2)(this.hass)).find((e=>e.url_path===i));(0,L.L)(this,{config:this.lovelace.rawConfig,saveConfig:this.lovelace.saveConfig,takeControl:()=>{(0,A.Z)(this,{lovelace:this.lovelace,mode:"storage",narrow:this.narrow})},deleteDashboard:async()=>{if(!(await(0,_.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.lovelace.dashboards.confirm_delete_title",{dashboard_title:o.title}),text:this.hass.localize("ui.panel.config.lovelace.dashboards.confirm_delete_text"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})))return!1;try{return await(0,y.iM)(this.hass,o.id),!0}catch(e){return!1}}})}}},{kind:"method",key:"_editModeDisable",value:function(){this.lovelace.setEditMode(!1)}},{kind:"method",key:"_editDashboard",value:async function(){var e;const t=null===(e=this.route)||void 0===e?void 0:e.prefix.slice(1);await this.hass.loadFragmentTranslation("config");const i=(await(0,y.j2)(this.hass)).find((e=>e.url_path===t));(0,M.w)(this,{dashboard:i,urlPath:t,updateDashboard:async e=>{await(0,y.Y)(this.hass,i.id,e)},removeDashboard:async()=>{if(!(await(0,_.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.lovelace.dashboards.confirm_delete_title",{dashboard_title:i.title}),text:this.hass.localize("ui.panel.config.lovelace.dashboards.confirm_delete_text"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})))return!1;try{return await(0,y.iM)(this.hass,i.id),!0}catch(e){return!1}}})}},{kind:"method",key:"_navigateToView",value:function(e,t){const i=this.lovelace.editMode?`${this.route.prefix}/${e}?${(0,p.j4)({edit:"1"})}`:`${this.route.prefix}/${e}${location.search}`;`${location.pathname}${location.search}`!==i&&(0,v.c)(i,{replace:t})}},{kind:"method",key:"_editView",value:function(){(0,S.k)(this,{lovelace:this.lovelace,viewIndex:this._curView,saveCallback:(e,t)=>{const i=t.path||e;this._navigateToView(i)}})}},{kind:"method",key:"_moveViewLeft",value:function(e){if(e.stopPropagation(),0===this._curView)return;const t=this.lovelace,i=this._curView,o=this._curView-1;this._curView=o,this.config.views[i].path||this._navigateToView(o,!0),t.saveConfig((0,H.mA)(t.config,i,o))}},{kind:"method",key:"_moveViewRight",value:function(e){if(e.stopPropagation(),this._curView+1===this.lovelace.config.views.length)return;const t=this.lovelace,i=this._curView,o=this._curView+1;this._curView=o,this.config.views[i].path||this._navigateToView(o,!0),t.saveConfig((0,H.mA)(t.config,i,o))}},{kind:"method",key:"_addView",value:function(){(0,S.k)(this,{lovelace:this.lovelace,saveCallback:(e,t)=>{const i=t.path||e;this._navigateToView(i)}})}},{kind:"method",key:"_handleViewSelected",value:function(e){e.preventDefault();const t=e.detail.selected;if(t!==this._curView){const e=this.config.views[t].path||t;this._navigateToView(e)}else this._editMode||scrollTo({behavior:"smooth",top:0})}},{kind:"method",key:"_selectView",value:function(e,t){if(!t&&this._curView===e)return;null!=this._curView&&(this._viewScrollPositions[this._curView]=window.scrollY),e=void 0===e?0:e,this._curView=e,t&&(this._viewCache={},this._viewScrollPositions={});const o=this._viewRoot;if(o.lastChild&&o.removeChild(o.lastChild),"hass-unused-entities"===e){const e=document.createElement("hui-unused-entities");return Promise.all([i.e("46379"),i.e("41103"),i.e("58529"),i.e("52876"),i.e("69642")]).then(i.bind(i,39507)).then((()=>{e.hass=this.hass,e.lovelace=this.lovelace,e.narrow=this.narrow})),void o.appendChild(e)}let a;this.config.views[e]?(!t&&this._viewCache[e]?a=this._viewCache[e]:(a=document.createElement("hui-view"),a.index=e,this._viewCache[e]=a),a.lovelace=this.lovelace,a.hass=this.hass,a.narrow=this.narrow,o.appendChild(a)):this.lovelace.setEditMode(!0)}},{kind:"get",static:!0,key:"styles",value:function(){return[$.Qx,(0,n.iv)(le||(le=de`:host{-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none}.header{background-color:var(--app-header-background-color);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);position:fixed;top:0;width:var(--mdc-top-app-bar-width,100%);-webkit-backdrop-filter:var(--app-header-backdrop-filter,none);backdrop-filter:var(--app-header-backdrop-filter,none);padding-top:env(safe-area-inset-top);z-index:4;transition:box-shadow .2s linear}:host([scrolled]) .header{box-shadow:var(--mdc-top-app-bar-fixed-box-shadow,0px 2px 4px -1px rgba(0,0,0,.2),0px 4px 5px 0px rgba(0,0,0,.14),0px 1px 10px 0px rgba(0,0,0,.12))}.edit-mode .header{background-color:var(--app-header-edit-background-color,#455a64);color:var(--app-header-edit-text-color,#fff)}.toolbar{height:var(--header-height);display:flex;align-items:center;font-size:20px;padding:0px 12px;font-weight:400;box-sizing:border-box} (max-width:599px){.toolbar{padding:0 4px}}.main-title{margin:var(--margin-title);line-height:20px;flex-grow:1}.action-items{white-space:nowrap;display:flex;align-items:center}ha-tabs{width:100%;height:100%;margin-left:4px;margin-inline-start:4px;margin-inline-end:initial}ha-tabs,paper-tabs{--paper-tabs-selection-bar-color:var(
--app-header-selection-bar-color,
var(--app-header-text-color, #fff)
);text-transform:uppercase}.edit-mode div[main-title]{pointer-events:auto}.edit-mode paper-tabs{background-color:var(--app-header-edit-background-color,#455a64);color:var(--app-header-edit-text-color,#fff)}paper-tab.iron-selected .edit-icon{display:inline-flex}.edit-icon{color:var(--accent-color);padding-left:8px;padding-inline-start:8px;vertical-align:middle;--mdc-theme-text-disabled-on-light:var(--disabled-text-color);direction:var(--direction)}.edit-icon.view{display:none}#add-view{position:absolute;height:44px}#add-view ha-svg-icon{background-color:var(--accent-color);border-radius:4px}a{color:var(--text-primary-color,#fff)}mwc-button.warning:not([disabled]){color:var(--error-color)}hui-view-container{position:relative;display:flex;min-height:100vh;box-sizing:border-box;padding-top:calc(var(--header-height) + env(safe-area-inset-top));padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-inline-start:env(safe-area-inset-left);padding-inline-end:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom)}hui-view-container>*{flex:1 1 100%;max-width:100%}.edit-mode hui-view-container{padding-top:calc(var(--header-height) + 48px + env(safe-area-inset-top))}.hide-tab{display:none}.menu-link{text-decoration:none}.exit-edit-mode{--mdc-theme-primary:var(--app-header-edit-text-color, #fff);--mdc-button-outline-color:var(--app-header-edit-text-color, #fff);--mdc-typography-button-font-size:14px}.child-view-icon{opacity:.5}`))]}}]}}),n.oi);t()}catch(U){t(U)}}))},62504:function(e,t,i){"use strict";var o=i(61701),a=i(72621),n=(i(22152),i(19083),i(71695),i(61006),i(47021),i(57243)),s=i(50778);let r,l=e=>e;(0,o.Z)([(0,s.Mo)("hui-view-background")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"background",value:void 0},{kind:"method",key:"render",value:function(){return n.Ld}},{kind:"method",key:"_applyTheme",value:function(){const e=getComputedStyle(this).getPropertyValue("--lovelace-background"),t=this._isFixedBackground(this.background||e),i=this._computeBackgroundProperty(this.background);this.toggleAttribute("fixed-background",t),this.style.setProperty("--view-background",i);const o=this._computeBackgroundOpacityProperty(this.background);this.style.setProperty("--view-background-opacity",o)}},{kind:"method",key:"_isFixedBackground",value:function(e){return"string"==typeof e?e.split(" ").includes("fixed"):"object"==typeof e&&"fixed"===e.attachment}},{kind:"method",key:"_computeBackgroundProperty",value:function(e){if("object"==typeof e&&e.image){var t,i,o;return`${null!==(t=e.alignment)&&void 0!==t?t:"center"} / ${null!==(i=e.size)&&void 0!==i?i:"cover"} ${null!==(o=e.repeat)&&void 0!==o?o:"no-repeat"} url('${this.hass.hassUrl(e.image)}')`}return"string"==typeof e?e:null}},{kind:"method",key:"_computeBackgroundOpacityProperty",value:function(e){return"object"==typeof e&&e.image&&e.opacity?`${e.opacity}%`:null}},{kind:"method",key:"willUpdate",value:function(e){if((0,a.Z)(i,"willUpdate",this,3)([e]),e.has("hass")&&this.hass){const t=e.get("hass");if(!t||this.hass.themes!==t.themes||this.hass.selectedTheme!==t.selectedTheme)return void this._applyTheme()}e.has("background")&&this._applyTheme()}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(r||(r=l`:host([fixed-background]){display:block;z-index:-1;position:fixed;background-attachment:scroll!important}:host(:not([fixed-background])){z-index:-1;position:absolute}:host{top:0;left:0;right:0;bottom:0;height:100%;width:100%;background:var(--view-background,var(--lovelace-background,var(--primary-background-color)));opacity:var(--view-background-opacity)}`))}}]}}),n.oi)},73192:function(e,t,i){"use strict";i.d(t,{R:()=>o});const o=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`}}]);
//# sourceMappingURL=74763.65940183c3eca4a5.js.map