iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 32.3 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["98714"],{4935:function(e,t,a){var i=a(61701),o=a(72621),s=(a(71695),a(47021),a(57243)),n=a(50778),r=a(7285);let d,l,c,h,f=e=>e;(0,i.Z)([(0,n.Mo)("ha-clickable-list-item")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,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(){return!1}},{kind:"field",decorators:[(0,n.Cb)({attribute:"open-new-tab",type:Boolean,reflect:!0})],key:"openNewTab",value(){return!1}},{kind:"field",decorators:[(0,n.IO)("a")],key:"_anchor",value:void 0},{kind:"method",key:"render",value:function(){const e=(0,o.Z)(a,"render",this,3)([]),t=this.href||"";return(0,s.dy)(d||(d=f`${0}`),this.disableHref?(0,s.dy)(l||(l=f`<a href="#" class="disabled">${0}</a>`),e):(0,s.dy)(c||(c=f`<a target="${0}" href="${0}">${0}</a>`),this.openNewTab?"_blank":"",t,e))}},{kind:"method",key:"firstUpdated",value:function(){(0,o.Z)(a,"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)(a,"styles",this),(0,s.iv)(h||(h=f`a{width:100%;height:100%;display:flex;align-items:center;overflow:hidden}.disabled{pointer-events:none}`))]}}]}}),r.M)},20130:function(e,t,a){var i=a(61701),o=a(72621),s=(a(71695),a(47021),a(39785)),n=a(52876),r=a(50778),d=a(57243),l=a(5111);let c,h,f,u=e=>e;(0,i.Z)([(0,r.Mo)("ha-fab")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)(a,"firstUpdated",this,3)([e]),this.style.setProperty("--mdc-theme-secondary","var(--primary-color)")}},{kind:"field",static:!0,key:"styles",value(){return[n.W,(0,d.iv)(c||(c=u`: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?(0,d.iv)(h||(h=u`:host .mdc-fab--extended .mdc-fab__icon{direction:rtl}`)):(0,d.iv)(f||(f=u``))]}}]}}),s._)},65981:function(e,t,a){a.r(t),a.d(t,{HaIcon:()=>P});var i=a(61701),o=a(72621),s=(a(19083),a(71695),a(40251),a(61006),a(47021),a(57243)),n=a(50778),r=a(36522),d=a(22381),l=a(80654),c=(a(92745),a(9359),a(31526),a(27608)),h=a(27486),f=a(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 t=await(0,c.U2)("_version",e);t?t!==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 v=[];a(37583);let m,g,y,k=e=>e;const w={},_={},x=(0,d.D)((()=>(async e=>{const t=Object.keys(e),a=await Promise.all(Object.values(e));(await b())("readwrite",(i=>{a.forEach(((a,o)=>{Object.entries(a).forEach((([e,t])=>{i.put(t,e)})),delete e[t[o]]}))}))})(_)),2e3),$={};let P=(0,i.Z)([(0,n.Mo)("ha-icon")],(function(e,t){class i extends t{constructor(...t){super(...t),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(){return!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?(0,s.dy)(m||(m=k` <iron-icon .icon="${0}"></iron-icon>`),this.icon):(0,s.dy)(g||(g=k`<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 e=this.icon,[t,i]=this.icon.split(":",2);let o,s=i;if(!t||!s)return;if(!p.includes(t)){const a=l.g[t];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(s),e)):void(this._legacy=!0)}if(this._legacy=!1,s in w){const e=w[s];let a;e.newName?(a=`Icon ${t}:${s} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,s=e.newName):a=`Icon ${t}:${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(a),(0,r.B)(this,"write_log",{level:"warning",message:a})}if(s in $)return void(this._path=$[s]);if("home-assistant"===s){const t=(await a.e("48348").then(a.bind(a,30511))).mdiHomeAssistant;return this.icon===e&&(this._path=t),void($[s]=t)}try{o=await(e=>new Promise(((t,a)=>{if(v.push([e,t,a]),v.length>1)return;const i=b();(0,f.n)(1e3,(async()=>{(await i)("readonly",(e=>{for(const[t,a,i]of v)(0,c.RV)(e.get(t)).then((e=>a(e))).catch((e=>i(e)));v=[]}))})()).catch((e=>{for(const[,,t]of v)t(e);v=[]}))})))(s)}catch(h){o=void 0}if(o)return this.icon===e&&(this._path=o),void($[s]=o);const n=(e=>{let t;for(const a of u.parts){if(void 0!==a.start&&e<a.start)break;t=a}return t.file})(s);if(n in _)return void this._setPath(_[n],s,e);const d=fetch(`/static/mdi/${n}.json`).then((e=>e.json()));_[n]=d,this._setPath(d,s,e),x()}},{kind:"method",key:"_setCustomPath",value:async function(e,t){const a=await e;this.icon===t&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}},{kind:"method",key:"_setPath",value:async function(e,t,a){const i=await e;this.icon===a&&(this._path=i[t]),$[t]=i[t]}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(y||(y=k`:host{fill:currentcolor}`))}}]}}),s.oi)},7285:function(e,t,a){a.d(t,{M:()=>u});var i=a(61701),o=a(72621),s=(a(71695),a(47021),a(65703)),n=a(46289),r=a(57243),d=a(50778);let l,c,h,f=e=>e,u=(0,i.Z)([(0,d.Mo)("ha-list-item")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,o.Z)(a,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[n.W,(0,r.iv)(l||(l=f`: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,r.iv)(c||(c=f`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,r.iv)(h||(h=f``))]}}]}}),s.K)},17170:function(e,t,a){a.a(e,(async function(e,i){try{a.r(t),a.d(t,{HaSpinner:()=>u});var o=a(61701),s=a(72621),n=(a(71695),a(47021),a(97677)),r=a(43580),d=a(57243),l=a(50778),c=e([n]);n=(c.then?(await c)():c)[0];let h,f=e=>e,u=(0,o.Z)([(0,l.Mo)("ha-spinner")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,l.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,s.Z)(a,"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,d.iv)(h||(h=f`: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(h){i(h)}}))},56032:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(61701),o=(a(71695),a(47021),a(80519)),s=a(1261),n=a(57243),r=a(50778),d=a(85605),l=e([o]);o=(l.then?(await l)():l)[0];let c,h=e=>e;(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,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[s.Z,(0,n.iv)(c||(c=h`: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);t()}catch(c){t(c)}}))},80654:function(e,t,a){a.d(t,{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,t)=>{var a;return null!==(a=e[t])&&void 0!==a?a:o[t]?{getIcon:o[t]}:void 0}})},48977:function(e,t,a){function i(e){return"strategy"in e}a.d(t,{Oh:()=>s,Q2:()=>o,Tx:()=>i,vj:()=>n});const o=(e,t,a)=>e.sendMessagePromise({type:"lovelace/config",url_path:t,force:a}),s=(e,t,a)=>e.callWS({type:"lovelace/config/save",url_path:t,config:a}),n=(e,t)=>e.callWS({type:"lovelace/config/delete",url_path:t})},10571:function(e,t,a){function i(e){return"strategy"in e}a.d(t,{s:()=>i})},6649:function(e,t,a){a.d(t,{JR:()=>o,Y:()=>s,iM:()=>n,j2:()=>i});a(19423);const i=e=>e.callWS({type:"lovelace/dashboards/list"}),o=(e,t)=>e.callWS(Object.assign({type:"lovelace/dashboards/create"},t)),s=(e,t,a)=>e.callWS(Object.assign({type:"lovelace/dashboards/update",dashboard_id:t},a)),n=(e,t)=>e.callWS({type:"lovelace/dashboards/delete",dashboard_id:t})},75375:function(e,t,a){a.a(e,(async function(e,i){try{a.r(t);var o=a(61701),s=(a(71695),a(47021),a(57243)),n=a(50778),r=a(17170),d=(a(54202),a(43344),a(28008)),l=e([r]);r=(l.then?(await l)():l)[0];let c,h,f,u,b,p,v=e=>e;(0,o.Z)([(0,n.Mo)("hass-loading-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,attribute:"no-toolbar"})],key:"noToolbar",value(){return!1}},{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:"message",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,s.dy)(c||(c=v` ${0} <div class="content"> <ha-spinner></ha-spinner> ${0} </div> `),this.noToolbar?"":(0,s.dy)(h||(h=v`<div class="toolbar"> ${0} </div>`),this.rootnav||null!==(e=history.state)&&void 0!==e&&e.root?(0,s.dy)(f||(f=v` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):(0,s.dy)(u||(u=v` <ha-icon-button-arrow-prev .hass="${0}" ="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)),this.message?(0,s.dy)(b||(b=v`<div id="loading-text">${0}</div>`),this.message):s.Ld)}},{kind:"method",key:"_handleBack",value:function(){history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[d.Qx,(0,s.iv)(p||(p=v`: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}`))]}}]}}),s.oi);i()}catch(c){i(c)}}))},82636:function(e,t,a){a.d(t,{c:()=>s});a(71695),a(40251),a(47021);var i=a(36522);const o=()=>Promise.all([a.e("91552"),a.e("62288")]).then(a.bind(a,59981)),s=(e,t)=>{(0,i.B)(e,"show-dialog",{dialogTag:"ha-dialog-new-dashboard",dialogImport:o,dialogParams:t})}},93450:function(e,t,a){a.a(e,(async function(e,i){try{a.r(t),a.d(t,{HaConfigLovelaceDashboards:()=>W});var o=a(61701),s=a(72621),n=(a(71695),a(92745),a(61893),a(9359),a(56475),a(1331),a(70104),a(52924),a(19423),a(40251),a(47021),a(57243)),r=a(50778),d=a(20552),l=a(27486),c=a(72344),h=a(83523),f=a(1416),u=(a(4935),a(20130),a(65981),a(23334),a(37583),a(56032)),b=a(48977),p=a(6649),v=a(76131),m=a(75375),g=a(38419),y=a(28421),k=a(82636),w=a(21646),_=a(89567),x=a(13144),$=a(68958),P=e([u,m,g]);[u,m,g]=P.then?(await P)():P;let C,Z,z,j,O,D,M,S,B,H,I,L,V=e=>e;const E="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",T="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",A="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",U="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",N="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";let W=(0,o.Z)([(0,r.Mo)("ha-config-lovelace-dashboards")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,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(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_dashboards",value(){return[]}},{kind:"field",decorators:[(0,$.t)({storage:"sessionStorage",key:"lovelace-dashboards-table-search",state:!0,subscribe:!1})],key:"_filter",value(){return""}},{kind:"field",decorators:[(0,$.t)({key:"lovelace-dashboards-table-sort",state:!1,subscribe:!1})],key:"_activeSorting",value:void 0},{kind:"field",decorators:[(0,$.t)({key:"lovelace-dashboards-table-column-order",state:!1,subscribe:!1})],key:"_activeColumnOrder",value:void 0},{kind:"field",decorators:[(0,$.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,t,a,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?(0,n.dy)(C||(C=V` <ha-icon slot="item-icon" .icon="${0}" style="${0}"></ha-icon> `),e.icon,(0,d.o)(e.iconColor?`color: ${e.iconColor}`:void 0)):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=>(0,n.dy)(Z||(Z=V` ${0} ${0} `),e.title,e.default?(0,n.dy)(z||(z=V` <ha-tooltip .content="${0}" placement="right"> <ha-svg-icon style="padding-left:10px;padding-inline-start:10px;direction:var(--direction)" .path="${0}"></ha-svg-icon> </ha-tooltip> `),this.hass.localize("ui.panel.config.lovelace.dashboards.default_dashboard"),T):n.Ld)}};return o.mode={title:i("ui.panel.config.lovelace.dashboards.picker.headers.conf_mode"),sortable:!0,filterable:!0,template:e=>(0,n.dy)(j||(j=V` ${0} `),this.hass.localize(`ui.panel.config.lovelace.dashboards.conf_mode.${e.mode}`)||e.mode)},a.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?(0,n.dy)(O||(O=V`<ha-svg-icon .path="${0}"></ha-svg-icon>`),E):(0,n.dy)(D||(D=V`—`))},o.show_in_sidebar={title:i("ui.panel.config.lovelace.dashboards.picker.headers.sidebar"),type:"icon",hidden:e,template:e=>e.show_in_sidebar?(0,n.dy)(M||(M=V`<ha-svg-icon .path="${0}"></ha-svg-icon>`),E):(0,n.dy)(S||(S=V`—`))},o.url_path={title:"",label:i("ui.panel.config.lovelace.dashboards.picker.headers.url"),filterable:!0,showNarrow:!0,template:t=>e?(0,n.dy)(B||(B=V` <ha-icon-button .path="${0}" .urlPath="${0}" ="${0}" .label="${0}"></ha-icon-button> `),U,t.url_path,this._navigate,this.hass.localize("ui.panel.config.lovelace.dashboards.picker.open")):(0,n.dy)(H||(H=V` <mwc-button .urlPath="${0}" ="${0}">${0}</mwc-button> `),t.url_path,this._navigate,this.hass.localize("ui.panel.config.lovelace.dashboards.picker.open"))},o}))}},{kind:"field",key:"_getItems",value(){return(0,l.Z)((e=>{var t;const a=(null===(t=this.hass.panels)||void 0===t||null===(t=t.lovelace)||void 0===t?void 0:t.config).mode,i=this.hass.defaultPanel,o="lovelace"===i,s=[{icon:"hass:view-dashboard",title:this.hass.localize("panel.states"),default:o,show_in_sidebar:o,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")&&s.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}),s.push(...e.sort(((e,t)=>(0,f.$K)(e.title,t.title,this.hass.locale.language))).map((e=>Object.assign(Object.assign({filename:""},e),{},{default:i===e.url_path})))),s}))}},{kind:"method",key:"render",value:function(){return this.hass&&void 0!==this._dashboards?(0,n.dy)(L||(L=V` <hass-tabs-subpage-data-table .hass="${0}" .narrow="${0}" back-path="/config" .route="${0}" .tabs="${0}" .columns="${0}" .data="${0}" .initialSorting="${0}" .columnOrder="${0}" .hiddenColumns="${0}" -changed="${0}" -changed="${0}" .filter="${0}" -changed="${0}" -click="${0}" id="url_path" has-fab clickable> <ha-button-menu slot="toolbar-icon" activatable> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <ha-clickable-list-item href="/config/lovelace/resources"> ${0} </ha-clickable-list-item> </ha-button-menu> <ha-fab slot="fab" .label="${0}" extended ="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-fab> </hass-tabs-subpage-data-table> `),this.hass,this.narrow,this.route,w.lovelaceTabs,this._columns(this.narrow,this.hass.language,this._dashboards,this.hass.localize),this._getItems(this._dashboards),this._activeSorting,this._activeColumnOrder,this._activeHiddenColumns,this._handleColumnsChanged,this._handleSortingChanged,this._filter,this._handleSearchChange,this._editDashboard,this.hass.localize("ui.common.menu"),A,this.hass.localize("ui.panel.config.lovelace.resources.caption"),this.hass.localize("ui.panel.config.lovelace.dashboards.picker.add_dashboard"),this._addDashboard,N):(0,n.dy)(I||(I=V` <hass-loading-screen></hass-loading-screen> `))}},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(a,"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 t=e.detail.id;if("energy"===t)return void(0,h.c)("/config/energy");const a=this._dashboards.find((e=>e.url_path===t));this._openDetailDialog(a,t)}},{kind:"method",key:"_addDashboard",value:async function(){(0,k.c)(this,{selectConfig:async e=>{if(e&&(0,b.Tx)(e)){const t=e.strategy.type;if((await(0,y.lN)("dashboard",t)).configRequired)return void(0,_.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,t,a){(0,x.w)(this,{dashboard:e,urlPath:t,createDashboard:async e=>{const t=await(0,p.JR)(this.hass,e);this._dashboards=this._dashboards.concat(t).sort(((e,t)=>(0,f.$K)(e.url_path,t.url_path,this.hass.locale.language))),a&&await(0,b.Oh)(this.hass,t.url_path,a)},updateDashboard:async t=>{const a=await(0,p.Y)(this.hass,e.id,t);this._dashboards=this._dashboards.map((t=>t===e?a:t))},removeDashboard:async()=>{if(!(await(0,v.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((t=>t!==e)),!0}catch(t){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(C){i(C)}}))},89567:function(e,t,a){a.d(t,{o:()=>s});a(71695),a(40251),a(47021);var i=a(36522);const o=()=>Promise.all([a.e("2142"),a.e("8795"),a.e("71588"),a.e("63055"),a.e("70147"),a.e("59985"),a.e("84209")]).then(a.bind(a,94818)),s=(e,t)=>{(0,i.B)(e,"show-dialog",{dialogTag:"dialog-lovelace-dashboard-configure-strategy",dialogImport:o,dialogParams:t})}},13144:function(e,t,a){a.d(t,{w:()=>s});a(71695),a(40251),a(47021);var i=a(36522);const o=()=>Promise.all([a.e("97983"),a.e("63055"),a.e("90987")]).then(a.bind(a,6827)),s=(e,t)=>{(0,i.B)(e,"show-dialog",{dialogTag:"dialog-lovelace-dashboard-detail",dialogImport:o,dialogParams:t})}},28421:function(e,t,a){a.d(t,{ar:()=>p,dl:()=>v,lN:()=>f,mQ:()=>m,to:()=>b});var i=a(58814),o=(a(52247),a(71695),a(9359),a(70104),a(19423),a(40251),a(88044),a(47021),a(48977)),s=a(10571),n=a(32930);const r=["strategy"],d=["strategy"],l=["strategy"],c="custom:",h={dashboard:{"original-states":()=>a.e("18518").then(a.bind(a,87378)),map:()=>a.e("6824").then(a.bind(a,7414)),iframe:()=>a.e("39753").then(a.bind(a,47114)),areas:()=>Promise.all([a.e("32146"),a.e("65005"),a.e("60487"),a.e("55723"),a.e("68722")]).then(a.bind(a,48280))},view:{"original-states":()=>Promise.all([a.e("3134"),a.e("28612"),a.e("12767"),a.e("79285"),a.e("72743"),a.e("72544")]).then(a.bind(a,96751)),energy:()=>Promise.all([a.e("3134"),a.e("28612"),a.e("12767"),a.e("81533"),a.e("72743"),a.e("75219")]).then(a.bind(a,58343)),map:()=>a.e("7127").then(a.bind(a,97550)),iframe:()=>a.e("70642").then(a.bind(a,55832)),area:()=>Promise.all([a.e("32146"),a.e("65005"),a.e("60487"),a.e("55723"),a.e("95349")]).then(a.bind(a,80898)),"areas-overview":()=>Promise.all([a.e("32146"),a.e("65005"),a.e("60487"),a.e("55723"),a.e("10777")]).then(a.bind(a,77727))},section:{}},f=async(e,t)=>{var a;if(t in h[e]){await h[e][t]();const a=`${t}-${e}-strategy`;return customElements.get(a)}if(!t.startsWith(c))throw new Error("Unknown strategy");const i=`ll-strategy-${t.slice(7)}`,o=`ll-strategy-${e}-${t.slice(7)}`;if(!0===await Promise.race([customElements.whenDefined(i),customElements.whenDefined(o),new Promise((e=>{setTimeout((()=>e(!0)),5e3)}))]))throw new Error(`Timeout waiting for strategy element ${o} to be registered`);return null!==(a=customElements.get(o))&&void 0!==a?a:customElements.get(i)},u=async(e,t,a,i)=>{const o=a.type;if(!o)return t("No strategy type found");try{const t=await f(e,o);if((0,n.sR)(t)){if("dashboard"===e&&"generateDashboard"in t)return await t.generateDashboard({config:{strategy:a,views:[]},hass:i});if("view"===e&&"generateView"in t)return await t.generateView({config:{views:[]},view:{strategy:a},hass:i})}const s=(0,n.n2)(a);return await t.generate(s,i)}catch(s){return"timeout"!==s.message&&console.error(s),t(s)}},b=async(e,t)=>{const{strategy:a}=e,o=(0,i.Z)(e,r),s=await u("dashboard",(e=>({views:[{title:"Error",cards:[{type:"markdown",content:`Error loading the dashboard strategy:\n> ${e}`}]}]})),a,t);return Object.assign(Object.assign({},o),s)},p=async(e,t)=>{const{strategy:a}=e,o=(0,i.Z)(e,d),s=await u("view",(e=>({cards:[{type:"markdown",content:`Error loading the view strategy:\n> ${e}`}]})),a,t);return Object.assign(Object.assign({},o),s)},v=async(e,t)=>{const{strategy:a}=e,o=(0,i.Z)(e,l),s=await u("section",(e=>({cards:[{type:"markdown",content:`Error loading the section strategy:\n> ${e}`}]})),a,t);return Object.assign(Object.assign({},o),s)},m=async(e,t)=>{const a=(0,o.Tx)(e)?await b(e,t):Object.assign({},e);return a.views=await Promise.all(a.views.map((async e=>{const a=(0,s.s)(e)?await p(e,t):Object.assign({},e);return a.sections&&(a.sections=await Promise.all(a.sections.map((async e=>(0,s.s)(e)?await v(e,t):Object.assign({},e))))),a}))),a}},32930:function(e,t,a){a.d(t,{n2:()=>s,sR:()=>i,ug:()=>o});a(19423);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 t=Object.assign(Object.assign({},e),e.options);return delete t.options,t}},16485:function(e,t,a){a.a(e,(async function(e,t){try{a(71695),a(92745),a(40251),a(47021);var i=a(61449),o=a(40574),s=a(30532),n=a(41674),r=a(49722),d=a(76632),l=a(7884),c=a(35185),h=a(65401),f=a(44180),u=a(49447);const e=async()=>{const e=(0,f.sS)(),t=[];(0,s.shouldPolyfill)()&&await Promise.all([a.e("80210"),a.e("74055")]).then(a.bind(a,98133)),(0,r.shouldPolyfill)()&&await Promise.all([a.e("2142"),a.e("75297"),a.e("80210"),a.e("60251")]).then(a.bind(a,59095)),(0,i.shouldPolyfill)(e)&&t.push(Promise.all([a.e("2142"),a.e("75297"),a.e("68250")]).then(a.bind(a,80561)).then((()=>(0,u.H)()))),(0,h.shouldPolyfill)()&&t.push(Promise.all([a.e("2142"),a.e("75297"),a.e("65578")]).then(a.bind(a,97995))),(0,o.shouldPolyfill)(e)&&t.push(Promise.all([a.e("2142"),a.e("75297"),a.e("59826")]).then(a.bind(a,31514))),(0,n.shouldPolyfill)(e)&&t.push(Promise.all([a.e("2142"),a.e("75297"),a.e("23649")]).then(a.bind(a,93840))),(0,d.shouldPolyfill)(e)&&t.push(Promise.all([a.e("2142"),a.e("75297"),a.e("42831")]).then(a.bind(a,29559))),(0,l.shouldPolyfill)(e)&&t.push(Promise.all([a.e("2142"),a.e("75297"),a.e("57377")]).then(a.bind(a,39030)).then((()=>a.e("61236").then(a.t.bind(a,4121,23))))),(0,c.shouldPolyfill)(e)&&t.push(Promise.all([a.e("2142"),a.e("75297"),a.e("13870")]).then(a.bind(a,74546))),0!==t.length&&await Promise.all(t).then((()=>(0,u.n)(e)))};await e(),t()}catch(b){t(b)}}),1)}}]);
//# sourceMappingURL=98714.eaaabee16405a37d.js.map