iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 30.6 kB
JavaScript
export const __webpack_ids__=["98714"];export const __webpack_modules__={4935:function(e,a,t){var i=t(44249),o=t(72621),s=t(57243),n=t(15093),r=t(7285);(0,i.Z)([(0,n.Mo)("ha-clickable-list-item")],(function(e,a){class t extends a{constructor(...a){super(...a),e(this)}}return{F:t,d:[{kind:"field",decorators:[(0,n.Cb)()],key:"href",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"disable-href",type:Boolean})],key:"disableHref",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({attribute:"open-new-tab",type:Boolean,reflect:!0})],key:"openNewTab",value:()=>!1},{kind:"field",decorators:[(0,n.IO)("a")],key:"_anchor",value:void 0},{kind:"method",key:"render",value:function(){const e=(0,o.Z)(t,"render",this,3)([]),a=this.href||"";return s.dy`${this.disableHref?s.dy`<a href="#" class="disabled">${e}</a>`:s.dy`<a target="${this.openNewTab?"_blank":""}" href="${a}">${e}</a>`}`}},{kind:"method",key:"firstUpdated",value:function(){(0,o.Z)(t,"firstUpdated",this,3)([]),this.addEventListener("keydown",(e=>{"Enter"!==e.key&&" "!==e.key||this._anchor.click()}))}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,o.Z)(t,"styles",this),s.iv`a{width:100%;height:100%;display:flex;align-items:center;overflow:hidden}.disabled{pointer-events:none}`]}}]}}),r.M)},20130:function(e,a,t){var i=t(44249),o=t(72621),s=t(39785),n=t(52876),r=t(15093),d=t(57243),l=t(5111);(0,i.Z)([(0,r.Mo)("ha-fab")],(function(e,a){class t extends a{constructor(...a){super(...a),e(this)}}return{F:t,d:[{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)(t,"firstUpdated",this,3)([e]),this.style.setProperty("--mdc-theme-secondary","var(--primary-color)")}},{kind:"field",static:!0,key:"styles",value:()=>[n.W,d.iv`:host .mdc-fab--extended .mdc-fab__icon{margin-inline-start:-8px;margin-inline-end:12px;direction:var(--direction)}:disabled{--mdc-theme-secondary:var(--disabled-text-color);pointer-events:none}`,"rtl"===l.E.document.dir?d.iv`:host .mdc-fab--extended .mdc-fab__icon{direction:rtl}`:d.iv``]}]}}),s._)},65981:function(e,a,t){t.r(a),t.d(a,{HaIcon:()=>w});var i=t(44249),o=t(72621),s=t(57243),n=t(15093),r=t(36522),d=t(22381),l=t(80654),c=(t(92745),t(9359),t(31526),t(27608)),h=t(27486),f=t(37394);const u=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"}]}'),b=(0,h.Z)((async()=>{const e=(0,c.MT)("hass-icon-db","mdi-icon-store");{const a=await(0,c.U2)("_version",e);a?a!==u.version&&(await(0,c.ZH)(e),(0,c.t8)("_version",u.version,e)):(0,c.t8)("_version",u.version,e)}return e})),p=["mdi","hass","hassio","hademo"];let m=[];t(37583);const v={},y={},g=(0,d.D)((()=>(async e=>{const a=Object.keys(e),t=await Promise.all(Object.values(e));(await b())("readwrite",(i=>{t.forEach(((t,o)=>{Object.entries(t).forEach((([e,a])=>{i.put(a,e)})),delete e[a[o]]}))}))})(y)),2e3),k={};let w=(0,i.Z)([(0,n.Mo)("ha-icon")],(function(e,a){class i extends a{constructor(...a){super(...a),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,n.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_path",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_secondaryPath",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_viewBox",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_legacy",value:()=>!1},{kind:"method",key:"willUpdate",value:function(e){(0,o.Z)(i,"willUpdate",this,3)([e]),e.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?s.dy` <iron-icon .icon="${this.icon}"></iron-icon>`:s.dy`<ha-svg-icon .path="${this._path}" .secondaryPath="${this._secondaryPath}" .viewBox="${this._viewBox}"></ha-svg-icon>`:s.Ld}},{kind:"method",key:"_loadIcon",value:async function(){if(!this.icon)return;const e=this.icon,[a,i]=this.icon.split(":",2);let o,s=i;if(!a||!s)return;if(!p.includes(a)){const t=l.g[a];return t?void(t&&"function"==typeof t.getIcon&&this._setCustomPath(t.getIcon(s),e)):void(this._legacy=!0)}if(this._legacy=!1,s in v){const e=v[s];let t;e.newName?(t=`Icon ${a}:${s} was renamed to ${a}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,s=e.newName):t=`Icon ${a}:${s} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${e.removeIn}.`,console.warn(t),(0,r.B)(this,"write_log",{level:"warning",message:t})}if(s in k)return void(this._path=k[s]);if("home-assistant"===s){const a=(await t.e("48348").then(t.bind(t,30511))).mdiHomeAssistant;return this.icon===e&&(this._path=a),void(k[s]=a)}try{o=await(e=>new Promise(((a,t)=>{if(m.push([e,a,t]),m.length>1)return;const i=b();(0,f.n)(1e3,(async()=>{(await i)("readonly",(e=>{for(const[a,t,i]of m)(0,c.RV)(e.get(a)).then((e=>t(e))).catch((e=>i(e)));m=[]}))})()).catch((e=>{for(const[,,a]of m)a(e);m=[]}))})))(s)}catch(e){o=void 0}if(o)return this.icon===e&&(this._path=o),void(k[s]=o);const n=(e=>{let a;for(const t of u.parts){if(void 0!==t.start&&e<t.start)break;a=t}return a.file})(s);if(n in y)return void this._setPath(y[n],s,e);const d=fetch(`/static/mdi/${n}.json`).then((e=>e.json()));y[n]=d,this._setPath(d,s,e),g()}},{kind:"method",key:"_setCustomPath",value:async function(e,a){const t=await e;this.icon===a&&(this._path=t.path,this._secondaryPath=t.secondaryPath,this._viewBox=t.viewBox)}},{kind:"method",key:"_setPath",value:async function(e,a,t){const i=await e;this.icon===t&&(this._path=i[a]),k[a]=i[a]}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{fill:currentcolor}`}]}}),s.oi)},7285:function(e,a,t){t.d(a,{M:()=>l});var i=t(44249),o=t(72621),s=t(65703),n=t(46289),r=t(57243),d=t(15093);let l=(0,i.Z)([(0,d.Mo)("ha-list-item")],(function(e,a){class t extends a{constructor(...a){super(...a),e(this)}}return{F:t,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,o.Z)(t,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[n.W,r.iv`: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?r.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:r.iv``]}}]}}),s.K)},17170:function(e,a,t){t.a(e,(async function(e,i){try{t.r(a),t.d(a,{HaSpinner:()=>h});var o=t(44249),s=t(72621),n=t(97677),r=t(43580),d=t(57243),l=t(15093),c=e([n]);n=(c.then?(await c)():c)[0];let h=(0,o.Z)([(0,l.Mo)("ha-spinner")],(function(e,a){class t extends a{constructor(...a){super(...a),e(this)}}return{F:t,d:[{kind:"field",decorators:[(0,l.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,s.Z)(t,"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:()=>[r.Z,d.iv`: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)}`]}]}}),n.Z);i()}catch(e){i(e)}}))},56032:function(e,a,t){t.a(e,(async function(e,a){try{var i=t(44249),o=t(80519),s=t(1261),n=t(57243),r=t(15093),d=t(85605),l=e([o]);o=(l.then?(await l)():l)[0],(0,d.jx)("tooltip.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:150,easing:"ease"}}),(0,d.jx)("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:400,easing:"ease"}});(0,i.Z)([(0,r.Mo)("ha-tooltip")],(function(e,a){return{F:class extends a{constructor(...a){super(...a),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[s.Z,n.iv`:host{--sl-tooltip-background-color:var(--secondary-background-color);--sl-tooltip-color:var(--primary-text-color);--sl-tooltip-font-family:Roboto,sans-serif;--sl-tooltip-font-size:12px;--sl-tooltip-font-weight:normal;--sl-tooltip-line-height:1;--sl-tooltip-padding:8px;--sl-tooltip-border-radius:var(--ha-tooltip-border-radius, 4px);--sl-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--sl-z-index-tooltip:var(--ha-tooltip-z-index, 1000)}`]}]}}),o.Z);a()}catch(e){a(e)}}))},80654:function(e,a,t){t.d(a,{g:()=>n});const i=window;"customIconsets"in i||(i.customIconsets={});const o=i.customIconsets,s=window;"customIcons"in s||(s.customIcons={});const n=new Proxy(s.customIcons,{get:(e,a)=>e[a]??(o[a]?{getIcon:o[a]}:void 0)})},48977:function(e,a,t){function i(e){return"strategy"in e}t.d(a,{Oh:()=>s,Q2:()=>o,Tx:()=>i,vj:()=>n});const o=(e,a,t)=>e.sendMessagePromise({type:"lovelace/config",url_path:a,force:t}),s=(e,a,t)=>e.callWS({type:"lovelace/config/save",url_path:a,config:t}),n=(e,a)=>e.callWS({type:"lovelace/config/delete",url_path:a})},10571:function(e,a,t){function i(e){return"strategy"in e}t.d(a,{s:()=>i})},6649:function(e,a,t){t.d(a,{JR:()=>o,Y:()=>s,iM:()=>n,j2:()=>i});const i=e=>e.callWS({type:"lovelace/dashboards/list"}),o=(e,a)=>e.callWS({type:"lovelace/dashboards/create",...a}),s=(e,a,t)=>e.callWS({type:"lovelace/dashboards/update",dashboard_id:a,...t}),n=(e,a)=>e.callWS({type:"lovelace/dashboards/delete",dashboard_id:a})},75375:function(e,a,t){t.a(e,(async function(e,i){try{t.r(a);var o=t(44249),s=t(57243),n=t(15093),r=t(17170),d=(t(54202),t(43344),t(28008)),l=e([r]);r=(l.then?(await l)():l)[0];(0,o.Z)([(0,n.Mo)("hass-loading-screen")],(function(e,a){return{F:class extends a{constructor(...a){super(...a),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"no-toolbar"})],key:"noToolbar",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"rootnav",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)()],key:"message",value:void 0},{kind:"method",key:"render",value:function(){return s.dy` ${this.noToolbar?"":s.dy`<div class="toolbar"> ${this.rootnav||history.state?.root?s.dy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:s.dy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._handleBack}"></ha-icon-button-arrow-prev> `} </div>`} <div class="content"> <ha-spinner></ha-spinner> ${this.message?s.dy`<div id="loading-text">${this.message}</div>`:s.Ld} </div> `}},{kind:"method",key:"_handleBack",value:function(){history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[d.Qx,s.iv`: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}@media (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}`]}}]}}),s.oi);i()}catch(e){i(e)}}))},82636:function(e,a,t){t.d(a,{c:()=>s});var i=t(36522);const o=()=>Promise.all([t.e("91552"),t.e("62288")]).then(t.bind(t,59981)),s=(e,a)=>{(0,i.B)(e,"show-dialog",{dialogTag:"ha-dialog-new-dashboard",dialogImport:o,dialogParams:a})}},93450:function(e,a,t){t.a(e,(async function(e,i){try{t.r(a),t.d(a,{HaConfigLovelaceDashboards:()=>M});var o=t(44249),s=t(72621),n=(t(92745),t(9359),t(56475),t(1331),t(70104),t(52924),t(57243)),r=t(15093),d=t(20552),l=t(27486),c=t(72344),h=t(83523),f=t(1416),u=(t(4935),t(20130),t(65981),t(23334),t(37583),t(56032)),b=t(48977),p=t(6649),m=t(76131),v=t(75375),y=(t(38419),t(28421)),g=t(82636),k=t(21646),w=t(89567),_=t(13144),x=t(68958),$=e([u,v]);[u,v]=$.then?(await $)():$;const P="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",C="M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z",z="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",Z="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",D="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";let M=(0,o.Z)([(0,r.Mo)("ha-config-lovelace-dashboards")],(function(e,a){class t extends a{constructor(...a){super(...a),e(this)}}return{F:t,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_dashboards",value:()=>[]},{kind:"field",decorators:[(0,x.t)({storage:"sessionStorage",key:"lovelace-dashboards-table-search",state:!0,subscribe:!1})],key:"_filter",value:()=>""},{kind:"field",decorators:[(0,x.t)({key:"lovelace-dashboards-table-sort",state:!1,subscribe:!1})],key:"_activeSorting",value:void 0},{kind:"field",decorators:[(0,x.t)({key:"lovelace-dashboards-table-column-order",state:!1,subscribe:!1})],key:"_activeColumnOrder",value:void 0},{kind:"field",decorators:[(0,x.t)({key:"lovelace-dashboards-table-hidden-columns",state:!1,subscribe:!1})],key:"_activeHiddenColumns",value:void 0},{kind:"method",key:"willUpdate",value:function(){this.hasUpdated||this.hass.loadFragmentTranslation("lovelace")}},{kind:"field",key:"_columns",value(){return(0,l.Z)(((e,a,t,i)=>{const o={icon:{title:"",moveable:!1,showNarrow:!0,label:i("ui.panel.config.lovelace.dashboards.picker.headers.icon"),type:"icon",template:e=>e.icon?n.dy` <ha-icon slot="item-icon" .icon="${e.icon}" style="${(0,d.o)(e.iconColor?`color: ${e.iconColor}`:void 0)}"></ha-icon> `:n.Ld},title:{title:i("ui.panel.config.lovelace.dashboards.picker.headers.title"),main:!0,sortable:!0,filterable:!0,flex:2,template:e?void 0:e=>n.dy` ${e.title} ${e.default?n.dy` <ha-tooltip .content="${this.hass.localize("ui.panel.config.lovelace.dashboards.default_dashboard")}" placement="right"> <ha-svg-icon style="padding-left:10px;padding-inline-start:10px;direction:var(--direction)" .path="${C}"></ha-svg-icon> </ha-tooltip> `:n.Ld} `}};return o.mode={title:i("ui.panel.config.lovelace.dashboards.picker.headers.conf_mode"),sortable:!0,filterable:!0,template:e=>n.dy` ${this.hass.localize(`ui.panel.config.lovelace.dashboards.conf_mode.${e.mode}`)||e.mode} `},t.some((e=>e.filename))&&(o.filename={title:i("ui.panel.config.lovelace.dashboards.picker.headers.filename"),sortable:!0,filterable:!0}),o.require_admin={title:i("ui.panel.config.lovelace.dashboards.picker.headers.require_admin"),sortable:!0,type:"icon",hidden:e,template:e=>e.require_admin?n.dy`<ha-svg-icon .path="${P}"></ha-svg-icon>`:n.dy`—`},o.show_in_sidebar={title:i("ui.panel.config.lovelace.dashboards.picker.headers.sidebar"),type:"icon",hidden:e,template:e=>e.show_in_sidebar?n.dy`<ha-svg-icon .path="${P}"></ha-svg-icon>`:n.dy`—`},o.url_path={title:"",label:i("ui.panel.config.lovelace.dashboards.picker.headers.url"),filterable:!0,showNarrow:!0,template:a=>e?n.dy` <ha-icon-button .path="${Z}" .urlPath="${a.url_path}" @click="${this._navigate}" .label="${this.hass.localize("ui.panel.config.lovelace.dashboards.picker.open")}"></ha-icon-button> `:n.dy` <mwc-button .urlPath="${a.url_path}" @click="${this._navigate}">${this.hass.localize("ui.panel.config.lovelace.dashboards.picker.open")}</mwc-button> `},o}))}},{kind:"field",key:"_getItems",value(){return(0,l.Z)((e=>{const a=(this.hass.panels?.lovelace?.config).mode,t=this.hass.defaultPanel,i="lovelace"===t,o=[{icon:"hass:view-dashboard",title:this.hass.localize("panel.states"),default:i,show_in_sidebar:i,require_admin:!1,url_path:"lovelace",mode:a,filename:"yaml"===a?"ui-lovelace.yaml":"",iconColor:"var(--primary-color)"}];return(0,c.p)(this.hass,"energy")&&o.push({icon:"hass:lightning-bolt",title:this.hass.localize("ui.panel.config.dashboard.energy.main"),show_in_sidebar:!0,mode:"storage",url_path:"energy",filename:"",iconColor:"var(--label-badge-yellow)",default:!1,require_admin:!1}),o.push(...e.sort(((e,a)=>(0,f.$K)(e.title,a.title,this.hass.locale.language))).map((e=>({filename:"",...e,default:t===e.url_path})))),o}))}},{kind:"method",key:"render",value:function(){return this.hass&&void 0!==this._dashboards?n.dy` <hass-tabs-subpage-data-table .hass="${this.hass}" .narrow="${this.narrow}" back-path="/config" .route="${this.route}" .tabs="${k.lovelaceTabs}" .columns="${this._columns(this.narrow,this.hass.language,this._dashboards,this.hass.localize)}" .data="${this._getItems(this._dashboards)}" .initialSorting="${this._activeSorting}" .columnOrder="${this._activeColumnOrder}" .hiddenColumns="${this._activeHiddenColumns}" @columns-changed="${this._handleColumnsChanged}" @sorting-changed="${this._handleSortingChanged}" .filter="${this._filter}" @search-changed="${this._handleSearchChange}" @row-click="${this._editDashboard}" id="url_path" has-fab clickable> <ha-button-menu slot="toolbar-icon" activatable> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${z}"></ha-icon-button> <ha-clickable-list-item href="/config/lovelace/resources"> ${this.hass.localize("ui.panel.config.lovelace.resources.caption")} </ha-clickable-list-item> </ha-button-menu> <ha-fab slot="fab" .label="${this.hass.localize("ui.panel.config.lovelace.dashboards.picker.add_dashboard")}" extended @click="${this._addDashboard}"> <ha-svg-icon slot="icon" .path="${D}"></ha-svg-icon> </ha-fab> </hass-tabs-subpage-data-table> `:n.dy` <hass-loading-screen></hass-loading-screen> `}},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(t,"firstUpdated",this,3)([e]),this._getDashboards()}},{kind:"method",key:"_getDashboards",value:async function(){this._dashboards=await(0,p.j2)(this.hass)}},{kind:"method",key:"_navigate",value:function(e){e.stopPropagation(),(0,h.c)(`/${e.target.urlPath}`)}},{kind:"method",key:"_editDashboard",value:function(e){const a=e.detail.id;if("energy"===a)return void(0,h.c)("/config/energy");const t=this._dashboards.find((e=>e.url_path===a));this._openDetailDialog(t,a)}},{kind:"method",key:"_addDashboard",value:async function(){(0,g.c)(this,{selectConfig:async e=>{if(e&&(0,b.Tx)(e)){const a=e.strategy.type;if((await(0,y.lN)("dashboard",a)).configRequired)return void(0,w.o)(this,{config:e,saveConfig:async e=>{this._openDetailDialog(void 0,void 0,e)}})}this._openDetailDialog(void 0,void 0,e)}})}},{kind:"method",key:"_openDetailDialog",value:async function(e,a,t){(0,_.w)(this,{dashboard:e,urlPath:a,createDashboard:async e=>{const a=await(0,p.JR)(this.hass,e);this._dashboards=this._dashboards.concat(a).sort(((e,a)=>(0,f.$K)(e.url_path,a.url_path,this.hass.locale.language))),t&&await(0,b.Oh)(this.hass,a.url_path,t)},updateDashboard:async a=>{const t=await(0,p.Y)(this.hass,e.id,a);this._dashboards=this._dashboards.map((a=>a===e?t:a))},removeDashboard:async()=>{if(!await(0,m.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.lovelace.dashboards.confirm_delete_title",{dashboard_title:e.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,p.iM)(this.hass,e.id),this._dashboards=this._dashboards.filter((a=>a!==e)),!0}catch(e){return!1}}})}},{kind:"method",key:"_handleSortingChanged",value:function(e){this._activeSorting=e.detail}},{kind:"method",key:"_handleSearchChange",value:function(e){this._filter=e.detail.value}},{kind:"method",key:"_handleColumnsChanged",value:function(e){this._activeColumnOrder=e.detail.columnOrder,this._activeHiddenColumns=e.detail.hiddenColumns}}]}}),n.oi);i()}catch(e){i(e)}}))},89567:function(e,a,t){t.d(a,{o:()=>s});var i=t(36522);const o=()=>Promise.all([t.e("83895"),t.e("8795"),t.e("71588"),t.e("63055"),t.e("52358"),t.e("12939")]).then(t.bind(t,94818)),s=(e,a)=>{(0,i.B)(e,"show-dialog",{dialogTag:"dialog-lovelace-dashboard-configure-strategy",dialogImport:o,dialogParams:a})}},13144:function(e,a,t){t.d(a,{w:()=>s});var i=t(36522);const o=()=>Promise.all([t.e("97983"),t.e("63055"),t.e("42937")]).then(t.bind(t,6827)),s=(e,a)=>{(0,i.B)(e,"show-dialog",{dialogTag:"dialog-lovelace-dashboard-detail",dialogImport:o,dialogParams:a})}},28421:function(e,a,t){t.d(a,{ar:()=>h,dl:()=>f,lN:()=>d,mQ:()=>u,to:()=>c});t(9359),t(70104);var i=t(48977),o=t(10571),s=t(32930);const n="custom:",r={dashboard:{"original-states":()=>t.e("18518").then(t.bind(t,87378)),map:()=>t.e("6824").then(t.bind(t,7414)),iframe:()=>t.e("39753").then(t.bind(t,47114)),areas:()=>Promise.all([t.e("32146"),t.e("65005"),t.e("60487"),t.e("16024"),t.e("68722")]).then(t.bind(t,48280))},view:{"original-states":()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("79285"),t.e("72743"),t.e("72544")]).then(t.bind(t,96751)),energy:()=>Promise.all([t.e("3134"),t.e("28612"),t.e("12767"),t.e("81533"),t.e("72743"),t.e("75219")]).then(t.bind(t,58343)),map:()=>t.e("7127").then(t.bind(t,97550)),iframe:()=>t.e("70642").then(t.bind(t,55832)),area:()=>Promise.all([t.e("32146"),t.e("65005"),t.e("60487"),t.e("16024"),t.e("95349")]).then(t.bind(t,80898)),"areas-overview":()=>Promise.all([t.e("32146"),t.e("65005"),t.e("60487"),t.e("16024"),t.e("10777")]).then(t.bind(t,77727))},section:{}},d=async(e,a)=>{if(a in r[e]){await r[e][a]();const t=`${a}-${e}-strategy`;return customElements.get(t)}if(!a.startsWith(n))throw new Error("Unknown strategy");const t=`ll-strategy-${a.slice(7)}`,i=`ll-strategy-${e}-${a.slice(7)}`;if(!0===await Promise.race([customElements.whenDefined(t),customElements.whenDefined(i),new Promise((e=>{setTimeout((()=>e(!0)),5e3)}))]))throw new Error(`Timeout waiting for strategy element ${i} to be registered`);return customElements.get(i)??customElements.get(t)},l=async(e,a,t,i)=>{const o=t.type;if(!o)return a("No strategy type found");try{const a=await d(e,o);if((0,s.sR)(a)){if("dashboard"===e&&"generateDashboard"in a)return await a.generateDashboard({config:{strategy:t,views:[]},hass:i});if("view"===e&&"generateView"in a)return await a.generateView({config:{views:[]},view:{strategy:t},hass:i})}const n=(0,s.n2)(t);return await a.generate(n,i)}catch(e){return"timeout"!==e.message&&console.error(e),a(e)}},c=async(e,a)=>{const{strategy:t,...i}=e;return{...i,...await l("dashboard",(e=>({views:[{title:"Error",cards:[{type:"markdown",content:`Error loading the dashboard strategy:\n> ${e}`}]}]})),t,a)}},h=async(e,a)=>{const{strategy:t,...i}=e;return{...i,...await l("view",(e=>({cards:[{type:"markdown",content:`Error loading the view strategy:\n> ${e}`}]})),t,a)}},f=async(e,a)=>{const{strategy:t,...i}=e;return{...i,...await l("section",(e=>({cards:[{type:"markdown",content:`Error loading the section strategy:\n> ${e}`}]})),t,a)}},u=async(e,a)=>{const t=(0,i.Tx)(e)?await c(e,a):{...e};return t.views=await Promise.all(t.views.map((async e=>{const t=(0,o.s)(e)?await h(e,a):{...e};return t.sections&&(t.sections=await Promise.all(t.sections.map((async e=>(0,o.s)(e)?await f(e,a):{...e})))),t}))),t}},32930:function(e,a,t){t.d(a,{n2:()=>s,sR:()=>i,ug:()=>o});const i=e=>!("generate"in e),o=e=>2===Object.keys(e).length&&"options"in e&&"object"==typeof e.options,s=e=>{if(!o(e))return e;const a={...e,...e.options};return delete a.options,a}},16485:function(e,a,t){t.a(e,(async function(e,a){try{t(92745);var i=t(61449),o=t(40574),s=t(30532),n=t(41674),r=t(49722),d=t(76632),l=t(7884),c=t(35185),h=t(60933),f=t(44180),u=t(49447);const e=async()=>{const e=(0,f.sS)(),a=[];(0,s.shouldPolyfill)()&&await Promise.all([t.e("80210"),t.e("74055")]).then(t.bind(t,98133)),(0,r.shouldPolyfill)()&&await Promise.all([t.e("83895"),t.e("75297"),t.e("80210"),t.e("60251")]).then(t.bind(t,59095)),(0,i.shouldPolyfill)(e)&&a.push(Promise.all([t.e("83895"),t.e("75297"),t.e("68250")]).then(t.bind(t,80561)).then((()=>(0,u.H)()))),(0,h.shouldPolyfill)()&&a.push(Promise.all([t.e("83895"),t.e("75297"),t.e("65578")]).then(t.bind(t,97995))),(0,o.shouldPolyfill)(e)&&a.push(Promise.all([t.e("83895"),t.e("75297"),t.e("59826")]).then(t.bind(t,31514))),(0,n.shouldPolyfill)(e)&&a.push(Promise.all([t.e("83895"),t.e("75297"),t.e("23649")]).then(t.bind(t,93840))),(0,d.shouldPolyfill)(e)&&a.push(Promise.all([t.e("83895"),t.e("75297"),t.e("42831")]).then(t.bind(t,29559))),(0,l.shouldPolyfill)(e)&&a.push(Promise.all([t.e("83895"),t.e("75297"),t.e("57377")]).then(t.bind(t,39030)).then((()=>t.e("61236").then(t.t.bind(t,4121,23))))),(0,c.shouldPolyfill)(e)&&a.push(Promise.all([t.e("83895"),t.e("75297"),t.e("13870")]).then(t.bind(t,74546))),0!==a.length&&await Promise.all(a).then((()=>(0,u.n)(e)))};await e(),a()}catch(e){a(e)}}),1)}};
//# sourceMappingURL=98714.7126b06336370c27.js.map