UNPKG

iobroker.lovelace

Version:

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

1 lines 35.5 kB
export const __rspack_esm_id=33337;export const __rspack_esm_ids=[33337];export const __webpack_modules__={69093(t,e,i){i.d(e,{t:()=>a});var s=i(71727);const a=t=>(0,s.m)(t.entity_id)},82286(t,e,i){i.d(e,{$:()=>s});const s=(t,e)=>a(t.attributes,e),a=(t,e)=>0!==(t.supported_features&e)},3109(t,e,i){var s=i(62826),a=i(86137),n=i(22441);class r extends a.A{constructor(){super(),this.play=!0,this.iterations=1,this.fill="both",this.name="fadeIn"}}(0,s.Cg)([(0,n.MZ)({type:Boolean})],r.prototype,"play",void 0),r=(0,s.Cg)([(0,n.EM)("ha-fade-in")],r)},14240(t,e,i){i.a(t,async function(t,s){try{i.r(e),i.d(e,{computePanels:()=>O});i(74423),i(44114),i(18111),i(22489),i(7588),i(61701),i(69112);var a=i(62826),n=i(5124),r=i(22441),o=i(6412),l=i(22786),d=i(1087),h=i(17451),c=i(52220),u=i(15638),p=i(77796),m=i(48250),v=i(99774),_=i(44249),b=i(55782),f=i(24247),g=i(68302),y=i(59992),x=i(54706),C=i(19037),w=i(14503),I=i(84187),L=(i(3109),i(47680),i(26300)),$=i(65829),E=(i(67094),i(34127)),H=(i(1671),i(47819),i(78673),t([L,$,E,f]));[L,$,E,f]=H.then?(await H)():H;const A="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",k="M9.82,12.5C9.84,12.33 9.86,12.17 9.86,12C9.86,11.83 9.84,11.67 9.82,11.5L10.9,10.69C11,10.62 11,10.5 10.96,10.37L9.93,8.64C9.87,8.53 9.73,8.5 9.62,8.53L8.34,9.03C8.07,8.83 7.78,8.67 7.47,8.54L7.27,7.21C7.27,7.09 7.16,7 7.03,7H5C4.85,7 4.74,7.09 4.72,7.21L4.5,8.53C4.21,8.65 3.92,8.83 3.65,9L2.37,8.5C2.25,8.47 2.12,8.5 2.06,8.63L1.03,10.36C0.97,10.5 1,10.61 1.1,10.69L2.18,11.5C2.16,11.67 2.15,11.84 2.15,12C2.15,12.17 2.17,12.33 2.19,12.5L1.1,13.32C1,13.39 1,13.53 1.04,13.64L2.07,15.37C2.13,15.5 2.27,15.5 2.38,15.5L3.66,15C3.93,15.18 4.22,15.34 4.53,15.47L4.73,16.79C4.74,16.91 4.85,17 5,17H7.04C7.17,17 7.28,16.91 7.29,16.79L7.5,15.47C7.8,15.35 8.09,15.17 8.36,15L9.64,15.5C9.76,15.53 9.89,15.5 9.95,15.37L11,13.64C11.04,13.53 11,13.4 10.92,13.32L9.82,12.5M6,13.75C5,13.75 4.2,12.97 4.2,12C4.2,11.03 5,10.25 6,10.25C7,10.25 7.8,11.03 7.8,12C7.8,12.97 7,13.75 6,13.75M17,1H7A2,2 0 0,0 5,3V6H7V4H17V20H7V18H5V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3A2,2 0 0,0 17,1Z",P="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",S="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z",M="M21,15.61L19.59,17L14.58,12L19.59,7L21,8.39L17.44,12L21,15.61M3,6H16V8H3V6M3,13V11H13V13H3M3,18V16H16V18H3Z",F={energy:1,map:2,logbook:3,history:4},T=(t,e,i,s,a)=>{const n=t.indexOf(i.url_path),r=t.indexOf(s.url_path);return n!==r?n<r?1:-1:V(e,i,s,a)},V=(t,e,i,s)=>{const a="lovelace"===e.component_name,n="lovelace"===i.component_name;if(e.url_path===t)return-1;if(i.url_path===t)return 1;if(a&&n)return(0,c.xL)(e.title,i.title,s);if(a&&!n)return-1;if(n)return 1;const r=e.url_path in F,o=i.url_path in F;return r&&o?F[e.url_path]-F[i.url_path]:r?-1:o?1:(0,c.xL)(e.title,i.title,s)},O=(0,l.A)((t,e,i,s,a)=>{if(!t)return[[],[]];const n=[];Object.values(t).filter(t=>!v.pk.includes(t.url_path)).forEach(t=>{(t.url_path===e||t.title&&!1!==t.show_in_sidebar&&!s.includes(t.url_path)&&(!1!==t.default_visible||i.includes(t.url_path)))&&n.push(t)});const r=[...i].reverse();return n.sort((t,i)=>T(r,e,t,i,a.language)),[n,[]]});class q extends((0,x.E)((0,y.V)(n.WF))){get scrollableElement(){return this._scrollableList}hassSubscribe(){return[(0,m.oT)(this.hass.connection,"sidebar",({value:t})=>{if(this._panelOrder=t?.panelOrder,this._hiddenPanels=t?.hiddenPanels,!this._panelOrder){const t=localStorage.getItem("sidebarPanelOrder");this._panelOrder=t?JSON.parse(t):[]}if(!this._hiddenPanels){const t=localStorage.getItem("sidebarHiddenPanels");this._hiddenPanels=t?JSON.parse(t):[]}}),...this.hass.user?.is_admin?[(0,b.TP)(this.hass.connection,t=>{this._issuesCount=t.issues.filter(t=>!t.ignored).length})]:[]]}disconnectedCallback(){super.disconnectedCallback()}render(){if(!this.hass)return n.s6;const t=this.hass.panelUrl;return n.qy` ${this._renderHeader()} ${this._renderAllPanels(t)}`}shouldUpdate(t){if(t.has("expanded")||t.has("narrow")||t.has("alwaysExpand")||t.has("_updatesCount")||t.has("_issuesCount")||t.has("_notifications")||t.has("_hiddenPanels")||t.has("_panelOrder")||t.has("_contentScrolled")||t.has("_contentScrollable"))return!0;if(!this.hass||!t.has("hass"))return!1;const e=t.get("hass");if(!e)return!0;const i=this.hass;return i.panels!==e.panels||i.panelUrl!==e.panelUrl||i.user!==e.user||i.localize!==e.localize||i.locale!==e.locale||i.states!==e.states||i.userData!==e.userData||i.systemData!==e.systemData||i.connected!==e.connected}firstUpdated(t){super.firstUpdated(t),this._subscribePersistentNotifications()}_subscribePersistentNotifications(){this._unsubPersistentNotifications&&this._unsubPersistentNotifications(),this._unsubPersistentNotifications=(0,_.V)(this.hass.connection,t=>{this._notifications=t})}updated(t){if(super.updated(t),t.has("alwaysExpand")&&(0,h.j)(this,"expanded",this.alwaysExpand),!t.has("hass"))return;const e=t.get("hass");this.hass&&!1===e?.connected&&!0===this.hass.connected&&this._subscribePersistentNotifications(),this._calculateCounts()}_renderHeader(){return n.qy`<div class="menu" @action="${this._handleAction}" .actionHandler="${(0,C.T)({hasHold:!0})}"> ${this.narrow?"":n.qy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${"docked"===this.hass.dockedSidebar?M:S}" @action="${this._toggleSidebar}"></ha-icon-button> `} <div class="title">ioBroker</div> </div>`}_renderAllPanels(t){const e=(t,e,i)=>n.qy`<ha-list-nav class="${(0,o.H)({"ha-scrollbar":i,[e]:!0})}">${t}</ha-list-nav>`;if(!this._panelOrder||!this._hiddenPanels)return n.qy` <ha-fade-in .delay="${500}"> <ha-spinner size="small"></ha-spinner> </ha-fade-in> ${e(n.qy`${this._renderFixedPanels(t)}`,"after-spacer",!1)} `;const i=(0,v.EN)(this.hass),[s,a]=O(this.hass.panels,i,this._panelOrder,this._hiddenPanels,this.hass.locale);return n.qy`<div class="panels-list"> <div class="wrapper"> ${e(this._renderPanels(s,t),"before-spacer",!0)} ${this.renderScrollableFades()} </div> ${this._renderSpacer()} ${e(n.qy` ${this._renderPanels(a,t)} ${this._renderFixedPanels(t)} `,"after-spacer",!1)} </div>`}_renderFixedPanels(t){return n.qy` ${this.hass.user?.is_admin?this._renderConfiguration(t):this._renderExternalConfiguration()} ${this._renderNotifications()} ${this._renderUserItem(t)} `}_renderPanels(t,e){return t.map(t=>this._renderPanel(t,t.url_path===e))}_renderPanel(t,e){const i=(0,v.hL)(this.hass,t),s=t.url_path,a=(0,v.Q)(t),r=(0,v.FW)(t);return n.qy` <ha-list-item-button .href="${`/${s}`}" id="sidebar-panel-${s}" class="${(0,o.H)({selected:e})}"> ${r?n.qy`<ha-svg-icon slot="start" .path="${r}"></ha-svg-icon>`:n.qy`<ha-icon slot="start" .icon="${a}"></ha-icon>`} <span class="item-text" slot="headline">${i}</span> </ha-list-item-button> ${!this.alwaysExpand&&i?this._renderToolTip(`sidebar-panel-${s}`,i):n.s6} `}_renderSpacer(){return n.qy`<div class="spacer" disabled="disabled"></div>`}_renderConfiguration(t){if(!this.hass.user?.is_admin)return n.s6;const e="config"===t;return n.qy` <ha-list-item-button class="configuration ${(0,o.H)({selected:e})}" href="/config" id="sidebar-config"> <ha-svg-icon slot="start" .path="${P}"></ha-svg-icon> ${this._updatesCount>0||this._issuesCount>0?n.qy` <span class="badge" slot="start"> ${this._updatesCount+this._issuesCount} </span> `:n.s6} <span class="item-text" slot="headline">${this.hass.localize("panel.config")}</span> ${this._updatesCount>0||this._issuesCount>0?n.qy` <span class="badge" slot="end">${this._updatesCount+this._issuesCount}</span> `:n.s6} </ha-list-item-button> ${this.alwaysExpand?n.s6:this._renderToolTip("sidebar-config",this.hass.localize("panel.config"))} `}_renderNotifications(){const t=this._notifications?this._notifications.length:0;return n.qy` <ha-list-item-button class="notifications" @click="${this._handleShowNotificationDrawer}" id="sidebar-notifications"> <ha-svg-icon slot="start" .path="${A}"></ha-svg-icon> ${t>0?n.qy` <span class="badge" slot="start"> ${t} </span> `:n.s6} <span class="item-text" slot="headline">${this.hass.localize("ui.notification_drawer.title")}</span> ${t>0?n.qy`<span class="badge" slot="end">${t}</span>`:n.s6} </ha-list-item-button> ${this.alwaysExpand?n.s6:this._renderToolTip("sidebar-notifications",this.hass.localize("ui.notification_drawer.title"))} `}_renderUserItem(t){const e=(0,u.qC)(this.hass.language,this.hass.translationMetadata.translations),i="profile"===t;return n.qy` <ha-list-item-button href="/profile" id="sidebar-profile" class="${(0,o.H)({user:!0,selected:i,rtl:e})}"> <ha-user-badge slot="start" .user="${this.hass.user}" .hass="${this.hass}"></ha-user-badge> <span class="item-text" slot="headline">${this.hass.user?this.hass.user.name:""}</span> </ha-list-item-button> ${!this.alwaysExpand&&this.hass.user?this._renderToolTip("sidebar-profile",this.hass.user.name):n.s6} `}_renderExternalConfiguration(){return this.hass.auth.external?.config.hasSettingsScreen?n.qy` <ha-list-item-button @click="${this._handleExternalAppConfiguration}" id="sidebar-external-config"> <ha-svg-icon slot="start" .path="${k}"></ha-svg-icon> <span class="item-text" slot="headline"> ${this.hass.localize("ui.sidebar.external_app_configuration")} </span> </ha-list-item-button> ${this.alwaysExpand?n.s6:this._renderToolTip("sidebar-external-config",this.hass.localize("ui.sidebar.external_app_configuration"))} `:n.s6}_renderToolTip(t,e){return I.M?n.s6:n.qy`<ha-tooltip for="${t}" show-delay="0" hide-delay="0" placement="right"> ${e} </ha-tooltip>`}_handleExternalAppConfiguration(t){t.preventDefault(),this.hass.auth.external.fireMessage({type:"config_screen/show"})}_handleAction(t){"hold"===t.detail.action&&(0,g.w)(this)}_handleShowNotificationDrawer(){(0,d.r)(this,"hass-show-notifications")}_toggleSidebar(t){"tap"===t.detail.action&&(0,d.r)(this,"hass-toggle-menu")}static get styles(){return[...super.styles,w.dp,n.AH`:host{overflow:visible;height:100%;display:flex;flex-direction:column;overflow:hidden;-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none;background-color:var(--sidebar-background-color);width:100%;box-sizing:border-box;padding-bottom:var(--safe-area-inset-bottom,0px)}.menu{height:calc(var(--header-height) + var(--safe-area-inset-top,0px));box-sizing:border-box;display:flex;padding:0 var(--ha-space-1);border-bottom:1px solid transparent;white-space:nowrap;font-weight:var(--ha-font-weight-normal);color:var(--sidebar-menu-button-text-color,var(--primary-text-color));border-bottom:1px solid var(--divider-color);background-color:var(--sidebar-menu-button-background-color,inherit);font-size:var(--ha-font-size-xl);align-items:center;overflow:hidden;width:calc(56px + var(--safe-area-inset-left,0px));padding-left:calc(var(--ha-space-1) + var(--safe-area-inset-left,0px));padding-inline-start:calc(var(--ha-space-1) + var(--safe-area-inset-left,0px));padding-inline-end:initial;padding-top:var(--safe-area-inset-top,0px);transition:width var(--ha-animation-duration-normal) ease}:host([expanded]) .menu{width:calc(256px + var(--safe-area-inset-left,0px))}:host([narrow][expanded]) .menu{width:100%}.menu ha-icon-button{color:var(--sidebar-icon-color)}.title{margin-left:3px;margin-inline-start:3px;margin-inline-end:initial;flex:1;min-width:0;max-width:0;opacity:0;transition:max-width var(--ha-animation-duration-normal) ease,opacity var(--ha-animation-duration-normal) ease}:host([narrow]) .title{margin:0;padding:0 var(--ha-space-4)}:host([expanded]) .title{max-width:100%;opacity:1;transition-delay:0s,80ms}.panels-list{display:flex;flex-direction:column;min-height:0;flex:1}ha-fade-in{padding:var(--ha-space-1) 0;box-sizing:border-box;display:flex;justify-content:center;align-items:center;min-height:0;flex:1}ha-list-nav{overflow-x:hidden;margin-left:var(--safe-area-inset-left,0px);margin-block:var(--ha-space-2)}.wrapper{position:relative;display:flex;flex-direction:column;min-height:0;flex:1}ha-list-nav.before-spacer{padding-bottom:0}ha-list-nav.after-spacer{padding-top:0;min-height:fit-content}ha-list-item-button{flex-shrink:0;margin:0 var(--ha-space-1) var(--ha-space-1);border-radius:var(--ha-border-radius-sm);--ha-row-item-min-height:var(--ha-space-10);--ha-row-item-padding-block:0;--ha-row-item-padding-inline:var(--ha-space-3);width:var(--ha-space-12);position:relative;transition:width var(--ha-animation-duration-normal) ease}ha-list-item-button::part(headline){color:var(--sidebar-text-color)}:host([expanded]) ha-list-item-button{width:248px}:host([narrow][expanded]) ha-list-item-button{width:calc(240px - var(--safe-area-inset-left,0px))}ha-list-item-button.selected::part(headline){color:var(--sidebar-selected-icon-color)}ha-list-item-button.selected::before{border-radius:var(--ha-border-radius-sm);position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;content:"";transition:opacity 15ms linear;will-change:opacity;background-color:var(--sidebar-selected-icon-color);opacity:var(--dark-divider-opacity)}ha-icon[slot=start],ha-svg-icon[slot=start]{width:var(--ha-space-6);flex-shrink:0;color:var(--sidebar-icon-color)}ha-list-item-button.selected ha-icon[slot=start],ha-list-item-button.selected ha-svg-icon[slot=start]{color:var(--sidebar-selected-icon-color)}ha-list-item-button .item-text{display:block;max-width:0;opacity:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-medium);transition:max-width var(--ha-animation-duration-normal) ease,opacity var(--ha-animation-duration-normal) ease}:host([expanded]) ha-list-item-button .item-text{max-width:100%;opacity:1;transition-delay:0s,80ms;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.badge{display:flex;justify-content:center;align-items:center;min-width:var(--ha-space-2);border-radius:var(--ha-border-radius-xl);font-weight:var(--ha-font-weight-normal);line-height:normal;background-color:var(--accent-color);padding:2px 6px;color:var(--text-accent-color,var(--text-primary-color));transition:opacity var(--ha-animation-duration-normal) ease,transform var(--ha-animation-duration-normal) ease}ha-svg-icon+.badge{position:absolute;top:var(--ha-space-1);left:26px;border-radius:var(--ha-border-radius-md);font-size:.65em;line-height:var(--ha-line-height-expanded);padding:0 var(--ha-space-1)}:host(:not([expanded])) .badge[slot=end],:host([expanded]) .badge[slot=start]{opacity:0;transform:scale(.8);pointer-events:none}ha-user-badge{width:40px;height:40px}ha-list-item-button.user{--ha-row-item-padding-inline:var(--ha-space-1) 0}.spacer{margin-top:auto;pointer-events:none}.menu ha-icon-button{-webkit-transform:scaleX(var(--scale-direction));transform:scaleX(var(--scale-direction))}@media (prefers-reduced-motion:reduce){.menu,.title,ha-list-item-button,ha-list-item-button .item-text{transition:1ms}}`]}constructor(...t){super(...t),this.narrow=!1,this.alwaysExpand=!1,this._updatesCount=0,this._issuesCount=0,this._calculateCounts=(0,p.n)(()=>{let t=0;for(const e of Object.keys(this.hass.states))e.startsWith("update.")&&!this.hass.entities[e]?.hidden&&(0,f.VK)(this.hass.states[e])&&t++;this._updatesCount=t},5e3)}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],q.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],q.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],q.prototype,"route",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"always-expand",type:Boolean})],q.prototype,"alwaysExpand",void 0),(0,a.Cg)([(0,r.wk)()],q.prototype,"_notifications",void 0),(0,a.Cg)([(0,r.wk)()],q.prototype,"_updatesCount",void 0),(0,a.Cg)([(0,r.wk)()],q.prototype,"_issuesCount",void 0),(0,a.Cg)([(0,r.wk)()],q.prototype,"_panelOrder",void 0),(0,a.Cg)([(0,r.wk)()],q.prototype,"_hiddenPanels",void 0),(0,a.Cg)([(0,r.P)(".before-spacer")],q.prototype,"_scrollableList",void 0),q=(0,a.Cg)([(0,r.EM)("ha-sidebar")],q),s()}catch(t){s(t)}})},28170(t,e,i){i.d(e,{o:()=>l});var s=i(62826),a=i(5124),n=i(22441),r=i(1087),o=i(83892);class l extends o.x{connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role",this.defaultRole),(0,r.r)(this,"ha-list-item-register",{item:this})}disconnectedCallback(){super.disconnectedCallback(),(0,r.r)(this,"ha-list-item-unregister",{item:this})}activate(){this.click()}constructor(...t){super(...t),this.interactive=!1,this.defaultRole="listitem"}}l.styles=[o.x.styles,a.AH`:host{--ha-list-item-focus-radius:var(--ha-border-radius-sm);--ha-list-item-focus-width:2px;--ha-list-item-focus-width-start:var(--ha-space-2);--ha-list-item-focus-offset:-2px;--ha-list-item-focus-background:var(--ha-color-fill-neutral-quiet-hover)}:host(:focus){outline:0}.base{border-radius:var(--ha-list-item-focus-radius);outline:var(--ha-list-item-focus-width) solid transparent;outline-offset:var(--ha-list-item-focus-offset);transition:outline-color var(--ha-animation-duration-fast) ease-out,background-color var(--ha-animation-duration-fast) ease-out}@keyframes ha-list-item-focus-in{from{outline-width:var(--ha-list-item-focus-width-start);outline-offset:calc(-1 * var(--ha-list-item-focus-width-start))}to{outline-width:var(--ha-list-item-focus-width);outline-offset:var(--ha-list-item-focus-offset)}}:host(:focus-visible) .base{outline-color:var(--ha-color-focus);background-color:var(--ha-list-item-focus-background);animation:ha-list-item-focus-in var(--ha-animation-duration-normal) ease-in}`],(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],l.prototype,"interactive",void 0),l=(0,s.Cg)([(0,n.EM)("ha-list-item-base")],l)},1671(t,e,i){var s=i(62826),a=i(5124),n=i(22441),r=i(63672),o=(i(54276),i(28170));class l extends o.o{activate(){this._item?.click()}_renderBase(t){return void 0!==this.href?a.qy`<a part="base" class="base interactive" id="item" href="${(0,r.J)(this.disabled?void 0:this.href)}" target="${(0,r.J)(this.target)}" rel="${(0,r.J)(this.rel)}" download="${(0,r.J)(this.download)}" tabindex="-1" aria-disabled="${this.disabled?"true":"false"}"> ${this._renderRipple()}${t} </a>`:a.qy`<button part="base" class="base interactive" id="item" type="button" ?disabled="${this.disabled}" tabindex="-1"> ${this._renderRipple()}${t} </button>`}_renderRipple(){return a.qy`<ha-ripple part="ripple" for="item" ?disabled="${this.disabled}"></ha-ripple>`}constructor(...t){super(...t),this.interactive=!0}}l.styles=[o.o.styles,a.AH`:host{cursor:pointer;--ha-ripple-color:var(--primary-text-color)}:host([disabled]){cursor:default}.base.interactive{width:100%;border:none;background:0 0;color:inherit;font:inherit;text-align:inherit;text-decoration:none;appearance:none;cursor:inherit}:host([disabled]) .base.interactive{color:var(--disabled-text-color)}`],(0,s.Cg)([(0,n.MZ)({type:String})],l.prototype,"href",void 0),(0,s.Cg)([(0,n.MZ)({type:String})],l.prototype,"target",void 0),(0,s.Cg)([(0,n.MZ)({type:String})],l.prototype,"rel",void 0),(0,s.Cg)([(0,n.MZ)({type:String})],l.prototype,"download",void 0),(0,s.Cg)([(0,n.P)("#item")],l.prototype,"_item",void 0),l=(0,s.Cg)([(0,n.EM)("ha-list-item-button")],l)},50723(t,e,i){i.d(e,{N:()=>h});i(74423),i(18111),i(22489),i(7588);var s=i(62826),a=i(5124),n=i(22441),r=i(91335);i(44114);const o=t=>{const e=[];let i=t;for(;i;){e.push(i);const t=i.parentNode;if(t instanceof ShadowRoot)i=t.host;else if(t)i=t;else{const t=i.getRootNode();i=t instanceof ShadowRoot?t.host:null}}return e.reverse()},l=(t,e)=>{if(t===e)return 0;const i=o(t),s=o(e);let a=0;for(;a<i.length&&a<s.length&&i[a]===s[a];)a++;return 0===a?0:a===i.length?-1:a===s.length?1:i[a].compareDocumentPosition(s[a])&Node.DOCUMENT_POSITION_FOLLOWING?-1:1};var d=i(1087);class h extends a.WF{connectedCallback(){super.connectedCallback(),this.hasAttribute("ha-list")||this.setAttribute("ha-list",""),!this.hasAttribute("role")&&this.hostRole&&this.setAttribute("role",this.hostRole),this._unbindKeys=(0,r.Tc)(this,{ArrowDown:this._onForward,ArrowUp:this._onBack,Home:this._onHome,End:this._onEnd,Enter:this._onActivate,Space:this._onActivate}),this.addEventListener("focusin",this._onFocusIn),this.addEventListener("ha-list-item-register",this._onItemRegister),this.addEventListener("ha-list-item-unregister",this._onItemUnregister)}disconnectedCallback(){super.disconnectedCallback(),this._unbindKeys?.(),this._unbindKeys=void 0,this.removeEventListener("focusin",this._onFocusIn),this.removeEventListener("ha-list-item-register",this._onItemRegister),this.removeEventListener("ha-list-item-unregister",this._onItemUnregister)}focus(t){this.items.length?this.focusItemAtIndex(this._activeItemIndex>=0?this._activeItemIndex:0):super.focus(t)}focusItemAtIndex(t){t<0||this.setActiveItemIndex(t,!0)}getActiveItemIndex(){return this._activeItemIndex}setActiveItemIndex(t,e=!1){this._hasFocusableItem?(this._activeItemIndex=Math.max(0,Math.min(this.items.length-1,t)),this._isFocusable(this._activeItemIndex)||(this._activeItemIndex=this._firstFocusableIndex),this._applyActive(e)):this._activeItemIndex=-1}updateListItems(){this._recomputeFocusableIndexes(),(this._activeItemIndex>=this.items.length||!this._hasFocusableItem||this._activeItemIndex<0)&&(this._activeItemIndex=this._firstFocusableIndex),this._applyActive(!1)}_recomputeFocusableIndexes(){let t=-1,e=-1;for(let i=0;i<this.items.length;i++)this._isFocusable(i)&&(-1===t&&(t=i),e=i);this._firstFocusableIndex=t,this._lastFocusableIndex=e,this._hasFocusableItem=-1!==t}render(){return a.qy`<div part="base" class="base"> <slot></slot> </div>`}_isFocusable(t){const e=this.items[t];return!!e&&e.interactive&&!e.disabled}_applyActive(t){this.items.forEach((t,e)=>{t.interactive&&!t.disabled?t.tabIndex=e===this._activeItemIndex?0:-1:t.removeAttribute("tabindex")}),t&&this._activeItemIndex>=0&&this.items[this._activeItemIndex]?.focus()}_moveFocus(t,e){!this._hasFocusableItem||e<0||e===this._activeItemIndex||(t.preventDefault(),this._activeItemIndex=e,this._applyActive(!0))}_stepIndex(t,e){const i=this.items.length;if(!i||!this._hasFocusableItem)return t;let s=t;for(let a=0;a<i;a++){if(s+=e,s<0||s>=i){if(!this.wrapFocus)return t;s=(s+i)%i}if(this._isFocusable(s))return s}return t}constructor(...t){super(...t),this.wrapFocus=!1,this.ariaLabel=null,this.items=[],this.hostRole="list",this._activeItemIndex=-1,this._firstFocusableIndex=-1,this._lastFocusableIndex=-1,this._hasFocusableItem=!1,this._onItemRegister=t=>{t.stopPropagation();const e=t.detail.item;if(this.items.includes(e))return;const i=[...this.items,e];i.sort(l),this.items=i,this.updateListItems()},this._onItemUnregister=t=>{t.stopPropagation();const e=t.detail.item;this.items.includes(e)&&(this.items=this.items.filter(t=>t!==e),this.updateListItems())},this._onFocusIn=t=>{const e=t.composedPath();for(let t=0;t<this.items.length;t++)if(e.includes(this.items[t]))return void(t!==this._activeItemIndex&&(this._activeItemIndex=t,this._applyActive(!1)))},this._onForward=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,1))},this._onBack=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,-1))},this._onHome=t=>{this._moveFocus(t,this._firstFocusableIndex)},this._onEnd=t=>{this._moveFocus(t,this._lastFocusableIndex)},this._onActivate=t=>{if(!this._isFocusable(this._activeItemIndex))return;t.preventDefault();const e=this.items[this._activeItemIndex];e.activate(),(0,d.r)(this,"ha-list-activated",{index:this._activeItemIndex,item:e})}}}h.styles=a.AH`:host{display:block}.base{display:flex;flex-direction:column;gap:var(--ha-list-gap,0);padding:var(--ha-list-padding,0);margin:0;list-style:none}`,(0,s.Cg)([(0,n.MZ)({type:Boolean,attribute:"wrap-focus"})],h.prototype,"wrapFocus",void 0),(0,s.Cg)([(0,n.MZ)({type:String,attribute:"aria-label",reflect:!0})],h.prototype,"ariaLabel",void 0),h=(0,s.Cg)([(0,n.EM)("ha-list-base")],h)},47819(t,e,i){var s=i(62826),a=i(5124),n=i(22441),r=i(63672),o=i(50723);class l extends o.N{render(){return a.qy`<nav part="nav" aria-label="${(0,r.J)(this.ariaLabel??void 0)}"> <div part="base" class="base" role="list"> <slot></slot> </div> </nav>`}constructor(...t){super(...t),this.hostRole="",this.ariaLabel=null}}(0,s.Cg)([(0,n.MZ)({type:String,attribute:"aria-label",reflect:!1})],l.prototype,"ariaLabel",void 0),l=(0,s.Cg)([(0,n.EM)("ha-list-nav")],l)},78673(t,e,i){var s=i(62826),a=i(5124),n=i(22441),r=i(6412),o=i(89784),l=i(69093),d=i(28669);class h extends a.WF{willUpdate(t){if(super.willUpdate(t),t.has("user"))return void this._getPersonPicture();const e=t.get("hass");if(this._personEntityId&&e&&this.hass.states[this._personEntityId]!==e.states[this._personEntityId]){const t=this.hass.states[this._personEntityId];t?this._personPicture=t.attributes.entity_picture:this._getPersonPicture()}else!this._personEntityId&&e&&this._getPersonPicture()}render(){if(!this.hass||!this.user)return a.s6;const t=this._personPicture;if(t)return a.qy`<div style="${(0,o.W)({backgroundImage:`url(${this.hass.hassUrl(t)})`})}" class="picture"></div>`;const e=(0,d._2)(this.user.name);return a.qy`<div class="initials ${(0,r.H)({long:e.length>2})}"> ${e} </div>`}_getPersonPicture(){if(this._personEntityId=void 0,this._personPicture=void 0,this.hass&&this.user)for(const t of Object.values(this.hass.states))if(t.attributes.user_id===this.user.id&&"person"===(0,l.t)(t)){this._personEntityId=t.entity_id,this._personPicture=t.attributes.entity_picture;break}}}h.styles=a.AH`:host{display:block;width:40px;height:40px}.picture{width:100%;height:100%;background-size:cover;border-radius:var(--ha-border-radius-circle)}.initials{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;width:100%;height:100%;border-radius:var(--ha-border-radius-circle);background-color:var(--light-primary-color);text-decoration:none;color:var(--text-light-primary-color,var(--primary-text-color));overflow:hidden}.initials.long{font-size:var(--ha-font-size-s)}`,(0,s.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"user",void 0),(0,s.Cg)([(0,n.wk)()],h.prototype,"_personPicture",void 0),h=(0,s.Cg)([(0,n.EM)("ha-user-badge")],h)},55782(t,e,i){i.d(e,{AU:()=>o,Ik:()=>l,Qk:()=>n,TP:()=>m,UL:()=>u,ZF:()=>h,do:()=>c,vR:()=>d});var s=i(35518),a=i(9899);const n={critical:1,error:2,warning:3},r=t=>t.sendMessagePromise({type:"repairs/list_issues"}),o=(t,e,i)=>t.sendMessagePromise({type:"repairs/get_issue_data",domain:e,issue_id:i}),l=async(t,e,i)=>t.callWS({type:"repairs/ignore_issue",issue_id:e.issue_id,domain:e.domain,ignore:i}),d=(t,e,i)=>t.callApi("POST","repairs/issues/fix",{handler:e,issue_id:i}),h=(t,e)=>t.callApi("GET",`repairs/issues/fix/${e}`),c=(t,e,i)=>t.callApi("POST",`repairs/issues/fix/${e}`,i),u=(t,e)=>t.callApi("DELETE",`repairs/issues/fix/${e}`),p=(t,e)=>t.subscribeEvents((0,a.s)(()=>r(t).then(t=>e.setState(t,!0)),500,!0),"repairs_issue_registry_updated"),m=(t,e)=>(0,s.N)("_repairsIssueRegistry",r,p,t,e)},24247(t,e,i){i.a(t,async function(t,s){try{i.d(e,{A_:()=>E,IC:()=>b,Jy:()=>g,RJ:()=>p,TY:()=>u,VK:()=>v,ZS:()=>I,ev:()=>y,id:()=>L,mj:()=>H,nD:()=>$,od:()=>f});i(18111),i(22489),i(61701),i(46190);var a=i(71727),n=i(69093),r=i(82286),o=i(20058),l=i(52220),d=i(65063),h=i(81619),c=t([o]);o=(c.then?(await c)():c)[0];var u=function(t){return t[t.INSTALL=1]="INSTALL",t[t.SPECIFIC_VERSION=2]="SPECIFIC_VERSION",t[t.PROGRESS=4]="PROGRESS",t[t.BACKUP=8]="BACKUP",t[t.RELEASE_NOTES=16]="RELEASE_NOTES",t}({});const p=t=>(0,r.$)(t,4)&&null!==t.attributes.update_percentage,m=(t,e=!1)=>"on"===t.state||e&&Boolean(t.attributes.skipped_version),v=(t,e=!1)=>m(t,e)&&(0,r.$)(t,1),_=(t,e=!1)=>m(t,e)&&!(0,r.$)(t,1),b=t=>!(!t.attributes.latest_version||t.attributes.skipped_version!==t.attributes.latest_version),f=t=>"off"===t.state&&!b(t),g=t=>!!t.attributes.in_progress,y=(t,e)=>t.callWS({type:"update/release_notes",entity_id:e}),x="ioBroker Core",C="ioBroker Supervisor",w="ioBroker Operating System",I=(t,e)=>Object.values(t).filter(t=>"update"===(0,n.t)(t)).sort((t,i)=>t.attributes.title===x?-3:i.attributes.title===x?3:t.attributes.title===w?-2:i.attributes.title===w?2:t.attributes.title===C?-1:i.attributes.title===C?1:(0,l.SH)(t.attributes.title||t.attributes.friendly_name||"",i.attributes.title||i.attributes.friendly_name||"",e)),L=(t,e=!1,i=!1)=>I(t).filter(t=>i?_(t,e):v(t,e)),$=async(t,e)=>{const i=I(e.states,e.locale.language).map(t=>t.entity_id);if(!i.length)return void(0,d.showAlertDialog)(t,{title:e.localize("ui.panel.config.updates.no_update_entities.title"),text:e.localize("ui.panel.config.updates.no_update_entities.description"),warning:!0});(0,h.P)(t,{message:e.localize("ui.panel.config.updates.checking_updates")});let s=0;const n=await e.connection.subscribeEvents(i=>{"update"===(0,a.m)(i.data.entity_id)&&(s++,(0,h.P)(t,{message:e.localize("ui.panel.config.updates.updates_refreshed",{count:s})}))},"state_changed");await e.callService("homeassistant","update_entity",{entity_id:i}),await new Promise(t=>{setTimeout(t,15e3)}),n(),0===s&&(0,h.P)(t,{message:e.localize("ui.panel.config.updates.no_new_updates")})},E=(t,e)=>{const i=t.state,s=t.attributes;if("off"===i){return s.latest_version&&s.skipped_version===s.latest_version?s.latest_version:e.formatEntityState(t)}if("on"===i&&g(t)){return(0,r.$)(t,4)&&null!==s.update_percentage?e.localize("ui.card.update.installing_with_progress",{progress:(0,o.ZV)(s.update_percentage,e.locale,{maximumFractionDigits:s.display_precision,minimumFractionDigits:s.display_precision})}):e.localize("ui.card.update.installing")}return e.formatEntityState(t)},H=(t,e)=>{const i=t.entity_id,s=e[i]?.domain;if("hassio"!==s)return"generic";const a=t.attributes.title||"";return a===x?"home_assistant":a===w?"home_assistant_os":a!==C?"addon":"generic"};s()}catch(t){s(t)}})},28669(t,e,i){i.d(e,{TK:()=>o,_2:()=>d,eR:()=>a,hG:()=>l,hU:()=>n,kg:()=>r,wj:()=>s,xg:()=>h});i(44114),i(18111),i(61701);const s="system-admin",a="system-users",n=async t=>t.callWS({type:"config/auth/list"}),r=async(t,e,i,s)=>t.callWS({type:"config/auth/create",name:e,group_ids:i,local_only:s}),o=async(t,e,i)=>t.callWS({...i,type:"config/auth/update",user_id:e}),l=async(t,e)=>t.callWS({type:"config/auth/delete",user_id:e}),d=t=>t?t.trim().split(" ").slice(0,3).map(t=>t.substring(0,1)).join(""):"?",h=(t,e,i)=>{const s=[],a=e=>t.localize(`ui.panel.config.users.${e}`);return e.is_owner&&s.push(["M12 2C6.47 2 2 6.5 2 12C2 17.5 6.5 22 12 22S22 17.5 22 12 17.5 2 12 2M12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4S20 7.58 20 12C20 16.42 16.42 20 12 20M8 14L7 8L10 10L12 7L14 10L17 8L16 14H8M8.56 16C8.22 16 8 15.78 8 15.44V15H16V15.44C16 15.78 15.78 16 15.44 16H8.56Z",a("is_owner")]),i&&e.system_generated&&s.push(["M11,7H15V9H11V11H13A2,2 0 0,1 15,13V15A2,2 0 0,1 13,17H9V15H13V13H11A2,2 0 0,1 9,11V9A2,2 0 0,1 11,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z",a("is_system")]),e.local_only&&s.push(["M12 20C7.6 20 4 16.4 4 12S7.6 4 12 4 20 7.6 20 12 16.4 20 12 20M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M11 14H13V17H16V12H18L12 7L6 12H8V17H11V14",a("is_local")]),e.is_active||s.push(["M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",a("is_not_active")]),s}},19037(t,e,i){i.d(e,{T:()=>u});i(74423);var s=i(62826),a=i(5124),n=i(22441),r=i(42017),o=i(1087),l=i(19459),d=i(88438);class h extends HTMLElement{connectedCallback(){Object.assign(this.style,{position:"fixed",width:d.C?"100px":"50px",height:d.C?"100px":"50px",transform:"translate(-50%, -50%) scale(0)",pointerEvents:"none",zIndex:"999",background:"var(--primary-color)",display:null,opacity:"0.2",borderRadius:"50%",transition:"transform 180ms ease-in-out"}),["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach(t=>{document.addEventListener(t,()=>{this.cancelled=!0,this.timer&&(this._stopAnimation(),clearTimeout(this.timer),this.timer=void 0)},{passive:!0})})}bind(t,e={}){t.actionHandler&&(0,l.b)(e,t.actionHandler.options)||(t.actionHandler?(t.removeEventListener("touchstart",t.actionHandler.start),t.removeEventListener("touchend",t.actionHandler.end),t.removeEventListener("touchcancel",t.actionHandler.end),t.removeEventListener("mousedown",t.actionHandler.start),t.removeEventListener("click",t.actionHandler.end),t.removeEventListener("keydown",t.actionHandler.handleKeyDown)):t.addEventListener("contextmenu",t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1}),t.actionHandler={options:e},e.disabled||(t.actionHandler.start=t=>{let i,s;this.cancelled=!1,t.touches?(i=t.touches[0].clientX,s=t.touches[0].clientY):(i=t.clientX,s=t.clientY),e.hasHold&&(this.held=!1,this.timer=window.setTimeout(()=>{this._startAnimation(i,s),this.held=!0},this.holdTime))},t.actionHandler.end=t=>{if("touchcancel"===t.type||"touchend"===t.type&&this.cancelled)return;const i=t.target;t.cancelable&&t.preventDefault(),e.hasHold&&(clearTimeout(this.timer),this._stopAnimation(),this.timer=void 0),e.hasHold&&this.held?(0,o.r)(i,"action",{action:"hold"}):e.hasDoubleClick?"click"===t.type&&t.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout(()=>{this.dblClickTimeout=void 0,!1!==e.hasTap&&(0,o.r)(i,"action",{action:"tap"})},250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,(0,o.r)(i,"action",{action:"double_tap"})):!1!==e.hasTap&&(0,o.r)(i,"action",{action:"tap"})},t.actionHandler.handleKeyDown=t=>{["Enter"," "].includes(t.key)&&t.currentTarget.actionHandler.end(t)},t.addEventListener("touchstart",t.actionHandler.start,{passive:!0}),t.addEventListener("touchend",t.actionHandler.end),t.addEventListener("touchcancel",t.actionHandler.end),t.addEventListener("mousedown",t.actionHandler.start,{passive:!0}),t.addEventListener("click",t.actionHandler.end),t.addEventListener("keydown",t.actionHandler.handleKeyDown)))}_startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,transform:"translate(-50%, -50%) scale(1)"})}_stopAnimation(){Object.assign(this.style,{left:null,top:null,transform:"translate(-50%, -50%) scale(0)"})}constructor(...t){super(...t),this.holdTime=500,this.held=!1,this.cancelled=!1}}h=(0,s.Cg)([(0,n.EM)("action-handler")],h);const c=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("action-handler"))return t.querySelector("action-handler");const e=document.createElement("action-handler");return t.appendChild(e),e})();i&&i.bind(t,e)},u=(0,r.u$)(class extends r.WL{update(t,[e]){return c(t.element,e),a.c0}render(t){}})}};