UNPKG

iobroker.lovelace

Version:

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

18 lines 42.3 kB
export const __rspack_esm_id=30002;export const __rspack_esm_ids=[30002];export const __webpack_modules__={63708(t,e,a){a.d(e,{fW:()=>s});a(18111),a(13579);var o=a(44537),i=a(36312);const s=(t,e)=>(n(e)||r(t,e))&&l(t,e),r=(t,e)=>!e.component||(0,o.e)(e.component).some(e=>(0,i.x)(t.config,e)),l=(t,e)=>!e.not_component||!(0,o.e)(e.not_component).some(e=>(0,i.x)(t.config,e)),n=t=>t.core},86368(t,e,a){a.d(e,{n:()=>s});var o=a(1087);const i=()=>Promise.all([a.e(80131),a.e(70183),a.e(76261)]).then(a.bind(a,43254)),s=(t,e)=>{(0,o.r)(t,"show-dialog",{dialogTag:"dialog-data-table-settings",dialogImport:i,dialogParams:e})}},93444(t,e,a){var o=a(62826),i=a(5124),s=a(22441);class r extends i.WF{render(){return i.qy` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `}static get styles(){return[i.AH`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}}r=(0,o.Cg)([(0,s.EM)("ha-dialog-footer")],r)},76538(t,e,a){var o=a(62826),i=a(5124),s=a(22441);class r extends i.WF{render(){const t=i.qy`<div class="header-title"> <slot name="title"></slot> </div>`,e=i.qy`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`;return i.qy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${"above"===this.subtitlePosition?i.qy`${e}${t}`:i.qy`${t}${e}`} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}static get styles(){return[i.AH`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`]}constructor(...t){super(...t),this.subtitlePosition="below",this.showBorder=!1}}(0,o.Cg)([(0,s.MZ)({type:String,attribute:"subtitle-position"})],r.prototype,"subtitlePosition",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],r.prototype,"showBorder",void 0),r=(0,o.Cg)([(0,s.EM)("ha-dialog-header")],r)},72554(t,e,a){a.a(t,async function(t,e){try{var o=a(62826),i=a(93900),s=a(35211),r=a(5124),l=a(22441),n=a(63672),h=a(1087),d=a(64481),c=a(22792),p=a(59992),g=a(14503),b=a(22348),v=(a(76538),a(26300)),u=t([i,v]);[i,v]=u.then?(await u)():u;const m="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";class f extends((0,p.V)(r.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(t){super.updated(t),t.has("open")&&(this._open=this.open)}render(){return r.qy` <wa-dialog .open="${this._open}" .lightDismiss="${!this.preventScrimClose}" without-header aria-labelledby="${(0,n.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0))}" aria-describedby="${(0,n.J)(this.ariaDescribedBy)}" @keydown="${this._handleKeyDown}" @wa-hide="${this._handleHide}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-after-hide="${this._handleAfterHide}"> ${this.withoutHeader?r.s6:r.qy`<slot name="header"> <ha-dialog-header .subtitlePosition="${this.headerSubtitlePosition}" .showBorder="${this._bodyScrolled}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${this._i18n?.localize?.("ui.common.close")??"Close"}" .path="${m}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?r.qy`<span slot="title" class="title" id="ha-dialog-title"> ${this.headerTitle} </span>`:r.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?r.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:r.qy`<slot name="headerSubtitle" slot="subtitle"></slot>`} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${this._handleBodyScroll}"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(t){this._open?(0,d.J)(()=>{this._setFullscreen(t.detail)}):this._setFullscreen(t.detail)}_setFullscreen(t){this.toggleAttribute("fullscreen",t)}_handleBodyScroll(t){this._bodyScrolled=t.target.scrollTop>0}_handleKeyDown(t){"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)}_handleHide(t){const e=t.detail?.source===t.target.dialog;this.preventScrimClose&&this._escapePressed&&e&&t.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,g.dp,r.AH`wa-dialog{--full-width:var( --ha-dialog-width-full, min(95vw, var(--safe-width)) );--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var( --ha-dialog-surface-background, var(--card-background-color, var(--ha-color-surface-default)) );--wa-panel-border-radius:var( --ha-dialog-border-radius, var(--ha-border-radius-3xl) );max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var( --ha-dialog-header-title-font-size, var(--ha-font-size-2xl) );line-height:var( --ha-dialog-header-title-line-height, var(--ha-line-height-condensed) );font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}constructor(...t){super(...t),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,h.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{if(this._hassConfig?.auth.external&&(0,b.V)(this._hassConfig.auth.external)){const t=this.querySelector("[autofocus]");return void(null!==t&&(t.id||(t.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})))}this.querySelector("[autofocus]")?.focus()}))},this._handleAfterShow=t=>{t.eventPhase===Event.AT_TARGET&&(0,h.r)(this,"after-show")},this._handleAfterHide=t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,h.r)(this,"closed"))}}}(0,o.Cg)([(0,l.MZ)({attribute:"aria-labelledby"})],f.prototype,"ariaLabelledBy",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"aria-describedby"})],f.prototype,"ariaDescribedBy",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0})],f.prototype,"open",void 0),(0,o.Cg)([(0,l.MZ)({reflect:!0})],f.prototype,"type",void 0),(0,o.Cg)([(0,l.MZ)({type:String,reflect:!0,attribute:"width"})],f.prototype,"width",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],f.prototype,"preventScrimClose",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-title"})],f.prototype,"headerTitle",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-subtitle"})],f.prototype,"headerSubtitle",void 0),(0,o.Cg)([(0,l.MZ)({type:String,attribute:"header-subtitle-position"})],f.prototype,"headerSubtitlePosition",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],f.prototype,"flexContent",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,attribute:"without-header"})],f.prototype,"withoutHeader",void 0),(0,o.Cg)([(0,l.wk)()],f.prototype,"_open",void 0),(0,o.Cg)([(0,l.P)(".body")],f.prototype,"bodyContainer",void 0),(0,o.Cg)([(0,l.wk)(),(0,s.Fg)({context:c.D5,subscribe:!0})],f.prototype,"_i18n",void 0),(0,o.Cg)([(0,l.wk)(),(0,s.Fg)({context:c.WF,subscribe:!0})],f.prototype,"_hassConfig",void 0),(0,o.Cg)([(0,l.wk)()],f.prototype,"_bodyScrolled",void 0),(0,o.Cg)([(0,l.Ls)({passive:!0})],f.prototype,"_handleBodyScroll",null),f=(0,o.Cg)([(0,l.EM)("ha-dialog")],f),e()}catch(t){e(t)}})},43831(t,e,a){var o=a(62826),i=a(5124),s=a(22441),r=a(63672);a(54276);class l extends i.WF{render(){return i.qy` <div tabindex="0" role="tab" aria-selected="${this.active}" aria-label="${(0,r.J)(this.name)}" @keydown="${this._handleKeyDown}"> <slot name="icon"></slot> <span class="name">${this.name}</span> <ha-ripple></ha-ripple> </div> `}_handleKeyDown(t){"Enter"===t.key&&t.target.click()}constructor(...t){super(...t),this.active=!1,this.narrow=!1}}l.styles=i.AH`div{padding:0 32px;display:flex;flex-direction:column;text-align:center;box-sizing:border-box;align-items:center;justify-content:center;width:100%;height:var(--header-height);cursor:pointer;position:relative;outline:0}:host(:not([narrow])) div{flex-direction:row;gap:var(--ha-space-2)}.name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}:host([active]){color:var(--primary-color)}:host(:not([narrow])[active]) div{border-bottom:2px solid var(--primary-color)}:host([narrow]){min-width:0;display:flex;justify-content:center;overflow:hidden}:host([narrow]) div{padding:0 4px}::slotted([slot=icon]){margin-bottom:var(--ha-space-1)}:host(:not([narrow])) ::slotted([slot=icon]){margin-bottom:0}div:focus-visible:before{position:absolute;display:block;content:"";inset:0;background-color:var(--secondary-text-color);opacity:.08}`,(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],l.prototype,"active",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],l.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)()],l.prototype,"name",void 0),l=(0,o.Cg)([(0,s.EM)("ha-tab")],l)},72553(t,e,a){a.a(t,async function(t,e){try{a(18111),a(22489),a(20116),a(61701);var o=a(62826),i=(a(68825),a(88696)),s=a(5124),r=a(22441),l=a(6412),n=a(63708),h=a(1087),d=(a(34296),a(48091)),c=a(86368),p=a(18350),g=a(72554),b=(a(93444),a(29823)),v=(a(70947),a(26300)),u=(a(67094),a(36866)),m=a(79172),f=a(40511),w=t([d,p,g,b,v,u,f]);[d,p,g,b,v,u,f]=w.then?(await w)():w;const y="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",x="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",_="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",C="M6,13H18V11H6M3,6V8H21V6M10,18H14V16H10V18Z",$="M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z",k="M3,5H9V11H3V5M5,7V9H7V7H5M11,7H21V9H11V7M11,15H21V17H11V15M5,20L1.5,16.5L2.91,15.09L5,17.17L9.59,12.59L11,14L5,20Z",L="M7,10L12,15L17,10H7Z",M="M3 3H17C18.11 3 19 3.9 19 5V12.08C17.45 11.82 15.92 12.18 14.68 13H11V17H12.08C11.97 17.68 11.97 18.35 12.08 19H3C1.9 19 1 18.11 1 17V5C1 3.9 1.9 3 3 3M3 7V11H9V7H3M11 7V11H17V7H11M3 13V17H9V13H3M22.78 19.32L21.71 18.5C21.73 18.33 21.75 18.17 21.75 18S21.74 17.67 21.71 17.5L22.77 16.68C22.86 16.6 22.89 16.47 22.83 16.36L21.83 14.63C21.77 14.5 21.64 14.5 21.5 14.5L20.28 15C20 14.82 19.74 14.65 19.43 14.53L19.24 13.21C19.23 13.09 19.12 13 19 13H17C16.88 13 16.77 13.09 16.75 13.21L16.56 14.53C16.26 14.66 15.97 14.82 15.71 15L14.47 14.5C14.36 14.5 14.23 14.5 14.16 14.63L13.16 16.36C13.1 16.47 13.12 16.6 13.22 16.68L14.28 17.5C14.26 17.67 14.25 17.83 14.25 18S14.26 18.33 14.28 18.5L13.22 19.32C13.13 19.4 13.1 19.53 13.16 19.64L14.16 21.37C14.22 21.5 14.35 21.5 14.47 21.5L15.71 21C15.97 21.18 16.25 21.35 16.56 21.47L16.75 22.79C16.77 22.91 16.87 23 17 23H19C19.12 23 19.23 22.91 19.25 22.79L19.44 21.47C19.74 21.34 20 21.18 20.28 21L21.5 21.5C21.64 21.5 21.77 21.5 21.84 21.37L22.84 19.64C22.9 19.53 22.87 19.4 22.78 19.32M18 19.5C17.17 19.5 16.5 18.83 16.5 18S17.18 16.5 18 16.5 19.5 17.17 19.5 18 18.84 19.5 18 19.5Z",S="M16.59,5.41L15.17,4L12,7.17L8.83,4L7.41,5.41L12,10M7.41,18.59L8.83,20L12,16.83L15.17,20L16.58,18.59L12,14L7.41,18.59Z",Z="M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z";class F extends((0,m.b)(s.WF)){supportedShortcuts(){return{f:()=>this._searchInput.focus()}}clearSelection(){this._dataTable.clearSelection()}willUpdate(t){(t.has("tabs")||t.has("hass")&&this.hass?.config.components!==t.get("hass")?.config.components)&&(this.showTabs=this.tabs.filter(t=>(0,n.fW)(this.hass,t)).length>1),this.hasUpdated||(this.initialGroupColumn&&this.columns[this.initialGroupColumn]&&this._setGroupColumn(this.initialGroupColumn),this.initialSorting&&this.columns[this.initialSorting.column]&&(this._sortColumn=this.initialSorting.column,this._sortDirection=this.initialSorting.direction))}render(){const t=this.localizeFunc||this.hass.localize,e=this._showPaneController.value??!this.narrow,a=this.hasFilters?s.qy`<div class="relative"> <ha-assist-chip .label="${t("ui.components.subpage-data-table.filters")}" .active="${this.filters}" @click="${this._toggleFilters}"> <ha-svg-icon slot="icon" .path="${C}"></ha-svg-icon> </ha-assist-chip> ${this.filters?s.qy`<div class="badge">${this.filters}</div>`:s.s6} </div>`:s.s6,o=this.selectable&&!this._selectMode?s.qy`<ha-assist-chip class="has-dropdown select-mode-chip" .active="${this._selectMode}" @click="${this._enableSelectMode}" .title="${t("ui.components.subpage-data-table.enter_selection_mode")}"> <ha-svg-icon slot="icon" .path="${k}"></ha-svg-icon> </ha-assist-chip>`:s.s6,i=s.qy`<ha-input-search appearance="outlined" .value="${this.filter}" @input="${this._handleSearchChange}" .placeholder="${this.searchLabel}"> </ha-input-search>`,r=Object.values(this.columns).find(t=>t.sortable)?s.qy` <ha-dropdown @wa-select="${this._handleSortBy}"> <ha-assist-chip slot="trigger" .label="${t("ui.components.subpage-data-table.sort_by",{sortColumn:this._sortColumn&&this.columns[this._sortColumn]?` ${this.columns[this._sortColumn].title||this.columns[this._sortColumn].label}`:""})}"> <ha-svg-icon slot="trailing-icon" .path="${L}"></ha-svg-icon> </ha-assist-chip> ${Object.entries(this.columns).map(([t,e])=>e.sortable?s.qy` <ha-dropdown-item .value="${t}" class="${(0,l.H)({selected:t===this._sortColumn})}"> ${this._sortColumn===t?s.qy` <ha-svg-icon slot="end" .path="${"desc"===this._sortDirection?y:x}"></ha-svg-icon> `:s.s6} ${e.title||e.label} </ha-dropdown-item> `:s.s6)} </ha-dropdown> `:s.s6,n=Object.values(this.columns).find(t=>t.groupable)?s.qy` <ha-dropdown @wa-select="${this._handleGroupBy}"> <ha-assist-chip .label="${t("ui.components.subpage-data-table.group_by",{groupColumn:this._groupColumn&&this.columns[this._groupColumn]?` ${this.columns[this._groupColumn].title||this.columns[this._groupColumn].label}`:""})}" slot="trigger"> <ha-svg-icon slot="trailing-icon" .path="${L}"></ha-svg-icon></ha-assist-chip> ${Object.entries(this.columns).map(([t,e])=>e.groupable?s.qy` <ha-dropdown-item .value="${t}" .selected="${t===this._groupColumn}" class="${(0,l.H)({selected:t===this._groupColumn})}"> ${e.title||e.label} </ha-dropdown-item> `:s.s6)} <ha-dropdown-item value="reset" class="${(0,l.H)({selected:!this._groupColumn})}"> ${t("ui.components.subpage-data-table.dont_group_by")} </ha-dropdown-item> <wa-divider></wa-divider> <ha-dropdown-item value="collapse_all" .disabled="${!this._groupColumn}"> <ha-svg-icon slot="icon" .path="${S}"></ha-svg-icon> ${t("ui.components.subpage-data-table.collapse_all_groups")} </ha-dropdown-item> <ha-dropdown-item value="expand_all" .disabled="${!this._groupColumn}"> <ha-svg-icon slot="icon" .path="${Z}"></ha-svg-icon> ${t("ui.components.subpage-data-table.expand_all_groups")} </ha-dropdown-item> </ha-dropdown> `:s.s6,h=s.qy`<ha-assist-chip class="has-dropdown select-mode-chip" @click="${this._openSettings}" .title="${t("ui.components.subpage-data-table.settings")}"> <ha-svg-icon slot="icon" .path="${M}"></ha-svg-icon> </ha-assist-chip>`;return s.qy` <hass-tabs-subpage .hass="${this.hass}" .localizeFunc="${this.localizeFunc}" .narrow="${this.narrow}" .isWide="${this.isWide}" .backPath="${this.backPath}" .backCallback="${this.backCallback}" .route="${this.route}" .tabs="${this.tabs}" .mainPage="${this.mainPage}" .pane="${e&&this.showFilters}" @sorting-changed="${this._sortingChanged}"> ${this._selectMode?s.qy`<div class="selection-bar" slot="toolbar"> <div class="selection-controls"> <ha-icon-button .path="${_}" @click="${this._disableSelectMode}" .label="${t("ui.components.subpage-data-table.exit_selection_mode")}"></ha-icon-button> <ha-dropdown @wa-select="${this._handleSelect}"> <ha-assist-chip .label="${t("ui.components.subpage-data-table.select")}" slot="trigger"> <ha-svg-icon slot="icon" .path="${k}"></ha-svg-icon> <ha-svg-icon slot="trailing-icon" .path="${L}"></ha-svg-icon></ha-assist-chip> <ha-dropdown-item value="all"> ${t("ui.components.subpage-data-table.select_all")} </ha-dropdown-item> <ha-dropdown-item value="none"> ${t("ui.components.subpage-data-table.select_none")} </ha-dropdown-item> <wa-divider></wa-divider> <ha-dropdown-item value="disable_select_mode"> ${t("ui.components.subpage-data-table.exit_selection_mode")} </ha-dropdown-item> </ha-dropdown> ${void 0!==this.selected?s.qy`<p> ${t("ui.components.subpage-data-table.selected",{selected:this.selected||"0"})} </p>`:s.s6} </div> <div class="center-vertical"> <slot name="selection-bar"></slot> </div> </div>`:s.s6} ${this.showFilters&&e?s.qy`<div class="pane" slot="pane"> <div class="table-header"> <ha-assist-chip .label="${t("ui.components.subpage-data-table.filters")}" active @click="${this._toggleFilters}"> <ha-svg-icon slot="icon" .path="${C}"></ha-svg-icon> </ha-assist-chip> ${this.filters?s.qy`<ha-icon-button .path="${$}" @click="${this._clearFilters}" .label="${t("ui.components.subpage-data-table.clear_filter")}"></ha-icon-button>`:s.s6} </div> <div class="pane-content"> <slot name="filter-pane"></slot> </div> </div>`:s.s6} ${this.empty?s.qy`<div class="center"> <slot name="empty">${this.noDataText}</slot> </div>`:s.qy`<div slot="toolbar-icon"> <slot name="toolbar-icon"></slot> </div> ${this.narrow?s.qy` <div slot="header"> <slot name="header"> <div class="search-toolbar">${i}</div> </slot> </div> `:""} <ha-data-table .narrow="${this.narrow}" .columns="${this.columns}" .data="${this.data}" .noDataText="${this.noDataText}" .filter="${this.filter}" .selectable="${this._selectMode}" .id="${this.id}" .clickable="${this.clickable}" .appendRow="${this.appendRow}" .sortColumn="${this._sortColumn}" .sortDirection="${this._sortDirection}" .groupColumn="${this._groupColumn}" .groupOrder="${this.groupOrder}" .initialCollapsedGroups="${this.initialCollapsedGroups}" .columnOrder="${this.columnOrder}" .hiddenColumns="${this.hiddenColumns}"> ${this.narrow?s.qy` <div slot="header"> <slot name="top-header"></slot> </div> <div slot="header-row" class="narrow-header-row"> ${this.hasFilters&&!this.showFilters?s.qy`${a}`:s.s6} ${o} <div class="flex"></div> ${n}${r}${h} </div> `:s.qy` <div slot="header"> <slot name="top-header"></slot> <slot name="header"> <div class="table-header"> ${this.hasFilters&&!this.showFilters?s.qy`${a}`:s.s6}${o}${i}${n}${r}${h} </div> </slot> </div> `} </ha-data-table>`} <div slot="fab"><slot name="fab"></slot></div> </hass-tabs-subpage> ${this.showFilters&&!e?s.qy`<ha-dialog .open="${!0}" width="full" header-title="${t("ui.components.subpage-data-table.filters")}" @closed="${this._closeFilters}"> <ha-icon-button slot="headerNavigationIcon" .path="${_}" @click="${this._closeFilters}" .label="${t("ui.components.subpage-data-table.close_filter")}"></ha-icon-button> ${this.filters?s.qy`<ha-icon-button slot="headerActionItems" @click="${this._clearFilters}" .path="${$}" .label="${t("ui.components.subpage-data-table.clear_filter")}"></ha-icon-button>`:s.s6} <div class="filter-dialog-content"> <slot name="filter-pane"></slot> </div> <ha-dialog-footer slot="footer"> <ha-button slot="primaryAction" @click="${this._closeFilters}"> ${t("ui.components.subpage-data-table.show_results",{number:this.data.length})} </ha-button> </ha-dialog-footer> </ha-dialog>`:s.s6} `}_clearFilters(){(0,h.r)(this,"clear-filter")}_toggleFilters(){this.showFilters=!this.showFilters}_sortingChanged(t){this._sortDirection=t.detail.direction,this._sortColumn=this._sortDirection?t.detail.column:void 0}_handleSortBy(t){t.preventDefault();const e=t.detail.item.value;this._sortDirection&&this._sortColumn===e&&"asc"===this._sortDirection?this._sortDirection="desc":this._sortDirection="asc",this._sortColumn=e,(0,h.r)(this,"sorting-changed",{column:e,direction:this._sortDirection})}_handleGroupBy(t){const e=t.detail.item.value;"reset"!==e?"collapse_all"!==e?"expand_all"!==e?this._setGroupColumn(e):this._expandAllGroups():this._collapseAllGroups():this._setGroupColumn("")}_setGroupColumn(t){this._groupColumn=t,(0,h.r)(this,"grouping-changed",{value:t})}_openSettings(){(0,c.n)(this,{columns:this.columns,hiddenColumns:this.hiddenColumns,columnOrder:this.columnOrder,onUpdate:(t,e)=>{this.columnOrder=t,this.hiddenColumns=e,(0,h.r)(this,"columns-changed",{columnOrder:t,hiddenColumns:e})},localizeFunc:this.localizeFunc})}_enableSelectMode(){this._selectMode=!0}_handleSelect(t){const e=t.detail.item.value;if(e)switch(e){case"all":this._selectAll();break;case"none":this._selectNone();break;case"disable_select_mode":this._disableSelectMode()}}_handleSearchChange(t){const e=t.target;this.filter!==e.value&&(this.filter=e.value??"",(0,h.r)(this,"search-changed",{value:this.filter}))}constructor(...t){super(...t),this.isWide=!1,this.narrow=!1,this.mainPage=!1,this.initialCollapsedGroups=[],this.columns={},this.data=[],this.selectable=!1,this.clickable=!1,this.hasFab=!1,this.showTabs=!1,this.id="id",this.filter="",this.empty=!1,this.tabs=[],this.hasFilters=!1,this.showFilters=!1,this._sortDirection=null,this._selectMode=!1,this._showPaneController=new i.P(this,{callback:t=>t[0]?.contentRect.width>750}),this._closeFilters=()=>{this.showFilters=!1},this._collapseAllGroups=()=>{this._dataTable.collapseAllGroups()},this._expandAllGroups=()=>{this._dataTable.expandAllGroups()},this._disableSelectMode=()=>{this._selectMode=!1,this._dataTable.clearSelection()},this._selectAll=()=>{this._dataTable.selectAll()},this._selectNone=()=>{this._dataTable.clearSelection()}}}F.styles=s.AH`:host{display:block;height:100%}ha-data-table{width:100%;height:100%;--data-table-border-width:0;--data-table-empty-row-height:var(--safe-area-inset-bottom, 0px)}.pane,:host(:not([narrow])) ha-data-table{height:calc(100vh - 1px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));display:block}:host([has-fab]) ha-data-table{--data-table-empty-row-height:calc( 48px + 16px * 2 + var(--safe-area-inset-bottom, 0px) )}:host([narrow][show-tabs]:not([has-fab])) ha-data-table{--data-table-empty-row-height:0px}:host([narrow][show-tabs][has-fab]) ha-data-table{--data-table-empty-row-height:calc(48px + 28px * 2)}.pane-content{height:calc(100vh - 1px - var(--header-height,0px) - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));display:flex;flex-direction:column}:host([narrow]) hass-tabs-subpage{--main-title-margin:0}:host([narrow]){--expansion-panel-summary-padding:0 16px}.table-header{display:flex;align-items:center;--mdc-shape-small:0;height:56px;width:100%;justify-content:space-between;padding:0 16px;gap:var(--ha-space-4);box-sizing:border-box;background:var(--primary-background-color);border-bottom:1px solid var(--divider-color)}ha-input-search{flex:1}.search-toolbar{display:flex;align-items:center;color:var(--secondary-text-color)}.filters{--mdc-text-field-fill-color:var(--input-fill-color);--mdc-text-field-idle-line-color:var(--input-idle-line-color);--mdc-shape-small:4px;--text-field-overflow:initial;display:flex;justify-content:flex-end;color:var(--primary-text-color)}.active-filters{color:var(--primary-text-color);position:relative;display:flex;align-items:center;padding:2px 2px 2px 8px;margin-left:4px;margin-inline-start:4px;margin-inline-end:initial;font-size:var(--ha-font-size-m);width:max-content;cursor:initial;direction:var(--direction)}.active-filters ha-svg-icon{color:var(--primary-color)}.active-filters::before{background-color:var(--primary-color);opacity:.12;border-radius:var(--ha-border-radius-sm);position:absolute;top:0;right:0;bottom:0;left:0;content:""}.center{display:flex;align-items:center;justify-content:center;text-align:center;box-sizing:border-box;height:100%;width:100%;padding:16px}.badge{position:absolute;top:-4px;right:-4px;inset-inline-end:-4px;inset-inline-start:initial;min-width:16px;box-sizing:border-box;border-radius:var(--ha-border-radius-circle);font-size:var(--ha-font-size-xs);font-weight:var(--ha-font-weight-normal);background-color:var(--primary-color);line-height:var(--ha-line-height-normal);text-align:center;padding:0px 2px;color:var(--text-primary-color)}.narrow-header-row{display:flex;align-items:center;min-width:100%;gap:var(--ha-space-4);padding:0 16px;box-sizing:border-box;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none}.narrow-header-row .flex{flex:1;margin-left:-16px}.selection-bar{background:rgba(var(--rgb-primary-color),.1);width:100%;height:100%;display:flex;align-items:center;justify-content:space-between;padding:8px 12px;box-sizing:border-box;font-size:var(--ha-font-size-m);--ha-assist-chip-container-color:var(--card-background-color)}.selection-controls{display:flex;align-items:center;gap:var(--ha-space-2)}.selection-controls p{margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}.center-vertical{display:flex;align-items:center;gap:var(--ha-space-2)}.relative{position:relative}ha-assist-chip{--ha-assist-chip-container-shape:10px;--ha-assist-chip-container-color:var(--card-background-color)}.select-mode-chip{--md-assist-chip-icon-label-space:0;--md-assist-chip-trailing-space:8px}ha-dialog{--dialog-content-padding:0}.filter-dialog-content{height:calc(100vh - 70px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));display:flex;flex-direction:column}ha-dropdown ha-assist-chip{--md-assist-chip-trailing-space:8px}ha-dropdown-item.selected{border:1px solid var(--primary-color);font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"localizeFunc",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"is-wide",type:Boolean})],F.prototype,"isWide",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],F.prototype,"narrow",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"main-page"})],F.prototype,"mainPage",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"initialCollapsedGroups",void 0),(0,o.Cg)([(0,r.MZ)({type:Object})],F.prototype,"columns",void 0),(0,o.Cg)([(0,r.MZ)({type:Array})],F.prototype,"data",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],F.prototype,"selectable",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],F.prototype,"clickable",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"has-fab",type:Boolean,reflect:!0})],F.prototype,"hasFab",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"show-tabs",type:Boolean,reflect:!0})],F.prototype,"showTabs",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"appendRow",void 0),(0,o.Cg)([(0,r.MZ)({type:String})],F.prototype,"id",void 0),(0,o.Cg)([(0,r.MZ)({type:String})],F.prototype,"filter",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"searchLabel",void 0),(0,o.Cg)([(0,r.MZ)({type:Number})],F.prototype,"filters",void 0),(0,o.Cg)([(0,r.MZ)({type:Number})],F.prototype,"selected",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"back-path"})],F.prototype,"backPath",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"backCallback",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"noDataText",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],F.prototype,"empty",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"route",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"tabs",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"has-filters",type:Boolean})],F.prototype,"hasFilters",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"show-filters",type:Boolean})],F.prototype,"showFilters",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"initialSorting",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"initialGroupColumn",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"groupOrder",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"columnOrder",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],F.prototype,"hiddenColumns",void 0),(0,o.Cg)([(0,r.wk)()],F.prototype,"_sortColumn",void 0),(0,o.Cg)([(0,r.wk)()],F.prototype,"_sortDirection",void 0),(0,o.Cg)([(0,r.wk)()],F.prototype,"_groupColumn",void 0),(0,o.Cg)([(0,r.wk)()],F.prototype,"_selectMode",void 0),(0,o.Cg)([(0,r.P)("ha-data-table",!0)],F.prototype,"_dataTable",void 0),(0,o.Cg)([(0,r.P)("ha-input-search")],F.prototype,"_searchInput",void 0),F=(0,o.Cg)([(0,r.EM)("hass-tabs-subpage-data-table")],F),e()}catch(t){e(t)}})},40511(t,e,a){a.a(t,async function(t,e){try{a(18111),a(22489),a(20116),a(61701),a(14603),a(47566),a(98721);var o=a(62826),i=a(5124),s=a(22441),r=a(6412),l=a(22786),n=a(63708),h=a(26218),d=a(76830),c=a(91926),p=a(90248),g=a(2054),b=(a(67094),a(43831),a(14503)),v=t([p,g]);[p,g]=v.then?(await v)():v;const u=t=>t.endsWith("/")&&t.length>1?t.slice(0,-1):t;class m extends i.WF{willUpdate(t){if(t.has("route")){const t=`${this.route.prefix}${this.route.path}`;this._activeTab=this.tabs.find(e=>this._isActiveTabPath(e.path,t))}super.willUpdate(t)}render(){const t=this._getTabs(this.tabs,this._activeTab,this.hass.config.components,this.hass.language,this.hass.userData,this.narrow,this.localizeFunc||this.hass.localize);return i.qy` <div class="toolbar ${(0,r.H)({narrow:this.narrow})}"> <slot name="toolbar"> <div class="toolbar-content"> ${this.mainPage||!this.backPath&&history.state?.root?i.qy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:this.backPath?i.qy` <ha-icon-button-arrow-prev .href="${this.backPath}" .hass="${this.hass}"></ha-icon-button-arrow-prev> `:i.qy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._backTapped}"></ha-icon-button-arrow-prev> `} ${this.narrow||!this.showTabs?i.qy`<div class="main-title"> <slot name="header">${this.showTabs?"":t[0]}</slot> </div>`:""} ${this.showTabs&&!this.narrow?i.qy`<div id="tabbar">${t}</div>`:""} <div id="toolbar-icon"> <slot name="toolbar-icon"></slot> </div> </div> </slot> ${this.showTabs&&this.narrow?i.qy`<div id="tabbar" class="bottom-bar">${t}</div>`:""} </div> <div class="container"> ${this.pane?i.qy`<div class="pane"> <div class="shadow-container"></div> <div class="ha-scrollbar"> <slot name="pane"></slot> </div> </div>`:i.s6} <div class="content ha-scrollbar" @scroll="${this._saveScrollPos}"> <slot></slot> ${this.hasFab?i.qy`<div class="fab-bottom-space"></div>`:i.s6} </div> </div> <div id="fab"> <slot name="fab"></slot> </div> `}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}focusContentScroller(){this._content&&(this._content.style.outline="none",this._content.focus({preventScroll:!0}))}_backTapped(){this.backCallback?this.backCallback():(0,c.OE)()}_isActiveTabPath(t,e){try{const a=new URL(t,window.location.origin),o=new URL(e,window.location.origin),i=u(a.pathname),s=u(o.pathname);return!(s!==i&&!s.startsWith(`${i}/`))}catch(a){return e===t||e.startsWith(`${t}/`)}}async _tabClicked(t){const e=(0,d.d)(t);e&&await(0,c.oo)(e,{replace:!0})}static get styles(){return[b.dp,i.AH`:host{display:block;height:100%;background-color:var(--primary-background-color)}:host([narrow]){width:100%;position:fixed}.container{display:flex;height:calc(100% - var(--header-height,0px) - var(--safe-area-inset-top,0px))}ha-menu-button{margin-right:24px;margin-inline-end:24px;margin-inline-start:initial}.toolbar{font-size:var(--ha-font-size-xl);height:calc(var(--header-height,0px) + var(--safe-area-inset-top,0px));padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right);background-color:var(--sidebar-background-color);font-weight:var(--ha-font-weight-normal);border-bottom:1px solid var(--divider-color);box-sizing:border-box}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{padding:8px 12px;display:flex;align-items:center;height:100%;box-sizing:border-box}:host([narrow]) .toolbar-content{padding:4px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}.bottom-bar a{width:25%}#tabbar{display:flex;font-size:var(--ha-font-size-m);overflow:hidden}#tabbar>a{overflow:hidden;max-width:45%}#tabbar.bottom-bar{position:absolute;bottom:0;left:0;padding:0 16px;box-sizing:border-box;background-color:var(--sidebar-background-color);border-top:1px solid var(--divider-color);justify-content:space-around;z-index:2;font-size:var(--ha-font-size-s);width:100%;padding-bottom:var(--safe-area-inset-bottom)}#tabbar:not(.bottom-bar){flex:1;justify-content:center}:host(:not([narrow])) #toolbar-icon{min-width:40px}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;flex-shrink:0;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{min-width:0;flex:1;max-height:var(--header-height);line-height:var(--ha-line-height-normal);color:var(--sidebar-text-color);margin-inline-start:var(--main-title-margin,var(--ha-space-6))}.narrow .main-title{margin-inline-start:var(--main-title-margin,var(--ha-space-2))}.content{position:relative;width:100%;margin-right:var(--safe-area-inset-right);margin-inline-end:var(--safe-area-inset-right);overflow:auto;-webkit-overflow-scrolling:touch}:host([narrow]) .content{margin-left:var(--safe-area-inset-left);margin-inline-start:var(--safe-area-inset-left)}:host([narrow][show-tabs]) .content{margin-bottom:calc(var(--header-height,0px) + var(--safe-area-inset-bottom,0px))}.content .fab-bottom-space{height:calc(64px + var(--safe-area-inset-bottom,0px))}:host([narrow][show-tabs]) .content .fab-bottom-space{height:calc(80px + var(--safe-area-inset-bottom,0px))}#fab{position:fixed;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow][show-tabs]) #fab{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:24px;right:24px;inset-inline-end:24px;inset-inline-start:initial}.pane{border-right:1px solid var(--divider-color);border-inline-end:1px solid var(--divider-color);border-inline-start:initial;box-sizing:border-box;display:flex;flex:0 0 var(--sidepane-width,250px);width:var(--sidepane-width,250px);flex-direction:column;position:relative}.pane .ha-scrollbar{flex:1}`]}constructor(...t){super(...t),this.mainPage=!1,this.narrow=!1,this.isWide=!1,this.pane=!1,this.hasFab=!1,this.showTabs=!1,this._getTabs=(0,l.A)((t,e,a,o,s,r,l)=>{const h=t.filter(t=>(0,n.fW)(this.hass,t));if(h.length<2){if(this.showTabs=!1,1===h.length){const t=h[0];return[t.translationKey?l(t.translationKey):t.name]}return[""]}return this.showTabs=!0,h.map(t=>i.qy` <a href="${t.path}" @click="${this._tabClicked}"> <ha-tab .active="${t.path===e?.path}" .narrow="${this.narrow}" .name="${t.translationKey?l(t.translationKey):t.name}"> ${t.iconPath?i.qy`<ha-svg-icon slot="icon" .path="${t.iconPath}"></ha-svg-icon>`:""} </ha-tab> </a> `)})}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"localizeFunc",void 0),(0,o.Cg)([(0,s.MZ)({type:String,attribute:"back-path"})],m.prototype,"backPath",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"backCallback",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"main-page"})],m.prototype,"mainPage",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"route",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"tabs",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],m.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"is-wide"})],m.prototype,"isWide",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],m.prototype,"pane",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"has-fab"})],m.prototype,"hasFab",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"show-tabs",reflect:!0})],m.prototype,"showTabs",void 0),(0,o.Cg)([(0,s.wk)()],m.prototype,"_activeTab",void 0),(0,o.Cg)([(0,s.P)(".content")],m.prototype,"_content",void 0),(0,o.Cg)([(0,h.a)(".content")],m.prototype,"_savedScrollPos",void 0),(0,o.Cg)([(0,s.Ls)({passive:!0})],m.prototype,"_saveScrollPos",null),m=(0,o.Cg)([(0,s.EM)("hass-tabs-subpage")],m),e()}catch(t){e(t)}})},79172(t,e,a){a.d(e,{b:()=>i});var o=a(68348);const i=t=>class extends t{connectedCallback(){super.connectedCallback(),this.addKeyboardShortcuts()}disconnectedCallback(){this.removeKeyboardShortcuts(),super.disconnectedCallback()}addKeyboardShortcuts(){this._listenersAdded||(this._listenersAdded=!0,window.addEventListener("keydown",this._keydownEvent))}removeKeyboardShortcuts(){this._listenersAdded=!1,window.removeEventListener("keydown",this._keydownEvent)}supportedShortcuts(){return{}}supportedSingleKeyShortcuts(){return{}}constructor(...t){super(...t),this._keydownEvent=t=>{const e=this.supportedShortcuts(),a=t.shiftKey?t.key.toUpperCase():t.key;if((t.ctrlKey||t.metaKey)&&!t.altKey&&a in e){if(!(0,o.u)(t.composedPath()))return;if(window.getSelection()?.toString())return;return t.preventDefault(),void e[a]()}const i=this.supportedSingleKeyShortcuts();a in i&&(t.preventDefault(),i[a]())},this._listenersAdded=!1}}}};