iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 26.6 kB
JavaScript
export const __rspack_esm_id=84208;export const __rspack_esm_ids=[84208];export const __webpack_modules__={41113(e,t,a){a.a(e,async function(e,t){try{a(74423),a(18111),a(20116),a(61701);var i=a(62826),s=a(5124),o=a(22441),n=a(1087),r=a(57237),l=a(76570),d=a(65063),h=a(54706),c=a(90986),p=a(14503),g=a(29823),u=(a(70947),a(11382),a(47680),a(8630),a(28732),e([g]));g=(u.then?(await u)():u)[0];const v="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",y="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",m="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",x="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",b="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",f="M5.5,7A1.5,1.5 0 0,1 4,5.5A1.5,1.5 0 0,1 5.5,4A1.5,1.5 0 0,1 7,5.5A1.5,1.5 0 0,1 5.5,7M21.41,11.58L12.41,2.58C12.05,2.22 11.55,2 11,2H4C2.89,2 2,2.89 2,4V11C2,11.55 2.22,12.05 2.59,12.41L11.58,21.41C11.95,21.77 12.45,22 13,22C13.55,22 14.05,21.77 14.41,21.41L21.41,14.41C21.78,14.05 22,13.55 22,13C22,12.44 21.77,11.94 21.41,11.58Z";class _ extends((0,h.E)(s.WF)){hassSubscribe(){return[(0,l.Ar)(this.hass.connection,this.scope,e=>{this._categories=e})]}render(){return s.qy` <ha-expansion-panel left-chevron .expanded="${this.expanded}" @expanded-will-change="${this._expandedWillChange}" @expanded-changed="${this._expandedChanged}"> <div slot="header" class="header"> ${this.hass.localize("ui.panel.config.category.caption")} ${this.value?.length?s.qy`<div class="badge">${this.value?.length}</div> <ha-icon-button .path="${m}" @click="${this._clearFilter}"></ha-icon-button>`:s.s6} </div> ${this._shouldRender?s.qy` <ha-list @selected="${this._categorySelected}" class="ha-scrollbar" activatable> ${this._categories.length>0?s.qy`<ha-list-item .selected="${!this.value?.length}" .activated="${!this.value?.length}">${this.hass.localize("ui.panel.config.category.filter.show_all")}</ha-list-item>`:s.s6} ${this._categories.map(e=>s.qy`<ha-list-item .value="${e.category_id}" .selected="${this.value?.includes(e.category_id)}" .activated="${this.value?.includes(e.category_id)}" graphic="icon" hasMeta> ${e.icon?s.qy`<ha-icon slot="graphic" .icon="${e.icon}"></ha-icon>`:s.qy`<ha-svg-icon .path="${f}" slot="graphic"></ha-svg-icon>`} ${e.name} <ha-dropdown @click="${r.d}" @wa-select="${this._handleAction}" slot="meta" .categoryId="${e.category_id}"> <ha-icon-button .path="${y}" slot="trigger" .label="${this.hass.localize("ui.common.menu")}"></ha-icon-button> <ha-dropdown-item value="edit"> <ha-svg-icon slot="icon" .path="${x}"></ha-svg-icon> ${this.hass.localize("ui.panel.config.category.editor.edit")} </ha-dropdown-item> <ha-dropdown-item value="delete" variant="danger"> <ha-svg-icon slot="icon" .path="${v}"></ha-svg-icon> ${this.hass.localize("ui.panel.config.category.editor.delete")} </ha-dropdown-item> </ha-dropdown> </ha-list-item>`)} </ha-list> `:s.s6} </ha-expansion-panel> ${this.expanded?s.qy`<ha-list-item graphic="icon" @click="${this._addCategory}" class="add"> <ha-svg-icon slot="graphic" .path="${b}"></ha-svg-icon> ${this.hass.localize("ui.panel.config.category.editor.add")} </ha-list-item>`:s.s6} `}updated(e){e.has("expanded")&&this.expanded&&setTimeout(()=>{this.expanded&&(this._list.style.height=this.clientHeight-97+"px")},300)}_handleAction(e){const t=e.currentTarget.categoryId;switch(e.detail.item.value){case"edit":this._editCategory(t);break;case"delete":this._deleteCategory(t)}}_editCategory(e){(0,c.S)(this,{scope:this.scope,entry:this._categories.find(t=>t.category_id===e),updateEntry:t=>(0,l.pW)(this.hass,this.scope,e,t)})}async _deleteCategory(e){if(await(0,d.dk)(this,{title:this.hass.localize("ui.panel.config.category.editor.confirm_delete"),text:this.hass.localize("ui.panel.config.category.editor.confirm_delete_text"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0}))try{await(0,l.JJ)(this.hass,this.scope,e),(0,n.r)(this,"data-table-filter-changed",{value:[],items:void 0})}catch(e){alert(`Failed to delete: ${e.message}`)}}_addCategory(){this.scope&&(0,c.S)(this,{scope:this.scope,createEntry:e=>(0,l.s_)(this.hass,this.scope,e)})}_expandedWillChange(e){this._shouldRender=e.detail.expanded}_expandedChanged(e){this.expanded=e.detail.expanded}async _categorySelected(e){if(!e.detail.index)return(0,n.r)(this,"data-table-filter-changed",{value:[],items:void 0}),void(this.value=[]);const t=e.detail.index-1,a=this._categories[t]?.category_id;a&&(this.value=[a],(0,n.r)(this,"data-table-filter-changed",{value:this.value,items:void 0}))}_clearFilter(e){e.preventDefault(),this.value=void 0,(0,n.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[p.dp,s.AH`:host{border-bottom:1px solid var(--divider-color);position:relative}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;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)}ha-list{--mdc-list-item-meta-size:auto;--mdc-list-side-padding-right:var(--ha-space-1);--mdc-list-side-padding-left:var(--ha-space-4);--ha-icon-button-size:36px}ha-list-item{--mdc-list-item-graphic-margin:var(--ha-space-4)}ha-dropdown-item{font-size:var(--ha-font-size-m)}.warning{color:var(--error-color)}.add{position:absolute;bottom:0;right:0;left:0}`]}constructor(...e){super(...e),this.narrow=!1,this.expanded=!1,this._categories=[],this._shouldRender=!1,this.hassSubscribeRequiredHostProps=["scope"]}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],_.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)()],_.prototype,"scope",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],_.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],_.prototype,"expanded",void 0),(0,i.Cg)([(0,o.wk)()],_.prototype,"_categories",void 0),(0,i.Cg)([(0,o.wk)()],_.prototype,"_shouldRender",void 0),(0,i.Cg)([(0,o.P)("ha-list")],_.prototype,"_list",void 0),_=(0,i.Cg)([(0,o.EM)("ha-filter-categories")],_),t()}catch(e){t(e)}})},66702(e,t,a){a.a(e,async function(e,t){try{a(74423),a(44114),a(18111),a(22489),a(7588),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(62826),s=a(5124),o=a(22441),n=a(22786),r=a(1087),l=a(69093),d=a(28978),h=a(52220),c=a(19459),p=a(71606),g=a(14503),u=a(85614),v=(a(30716),a(11382),a(8630),a(93367)),y=a(36866),m=e([v,y]);[v,y]=m.then?(await m)():m;const x="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";class b extends s.WF{willUpdate(e){super.willUpdate(e),this.hasUpdated||(0,u.i)(),e.has("value")&&!(0,c.b)(this.value,e.get("value"))&&this._findRelated()}render(){return s.qy` <ha-expansion-panel left-chevron .expanded="${this.expanded}" @expanded-will-change="${this._expandedWillChange}" @expanded-changed="${this._expandedChanged}"> <div slot="header" class="header"> ${this.hass.localize("ui.panel.config.entities.caption")} ${this.value?.length?s.qy`<div class="badge">${this.value?.length}</div> <ha-icon-button .path="${x}" @click="${this._clearFilter}"></ha-icon-button>`:s.s6} </div> ${this._shouldRender?s.qy` <ha-input-search appearance="outlined" .value="${this._filter}" @input="${this._handleSearchChange}"> </ha-input-search> <ha-list class="ha-scrollbar" multi> <lit-virtualizer .items="${this._entities(this.hass.states,this.type,this._filter||"",this.value)}" .keyFunction="${this._keyFunction}" .renderItem="${this._renderItem}" @click="${this._handleItemClick}" @keydown="${this._handleItemKeydown}"> </lit-virtualizer> </ha-list> `:s.s6} </ha-expansion-panel> `}updated(e){e.has("expanded")&&this.expanded&&setTimeout(()=>{this.expanded&&(this._list.style.height=this.clientHeight-49-4-32+"px")},300)}_handleItemKeydown(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._handleItemClick(e))}_handleItemClick(e){const t=e.target.closest("ha-check-list-item"),a=t?.value;a&&(this.value?.includes(a)?this.value=this.value?.filter(e=>e!==a):this.value=[...this.value||[],a],t.selected=this.value?.includes(a))}_expandedWillChange(e){this._shouldRender=e.detail.expanded}_expandedChanged(e){this.expanded=e.detail.expanded}_handleSearchChange(e){const t=e.target;this._filter=(t.value??"").toLowerCase()}async _findRelated(){const e=[];if(!this.value?.length)return this.value=[],void(0,r.r)(this,"data-table-filter-changed",{value:[],items:void 0});for(const t of this.value)this.type&&e.push((0,p.f)(this.hass,"entity",t));const t=await Promise.all(e),a=new Set;for(const e of t)e[this.type]&&e[this.type].forEach(e=>a.add(e));(0,r.r)(this,"data-table-filter-changed",{value:this.value,items:this.type?a:void 0})}_clearFilter(e){e.preventDefault(),this.value=void 0,(0,r.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[g.dp,s.AH`:host{border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;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)}ha-check-list-item{--mdc-list-item-graphic-margin:16px;width:100%}ha-input-search{display:block;padding:var(--ha-space-1) var(--ha-space-2) 0}`]}constructor(...e){super(...e),this.narrow=!1,this.expanded=!1,this._shouldRender=!1,this._keyFunction=e=>e?.entity_id,this._renderItem=e=>e?s.qy`<ha-check-list-item tabindex="0" .value="${e.entity_id}" .selected="${this.value?.includes(e.entity_id)??!1}" graphic="icon"> <ha-state-icon slot="graphic" .stateObj="${e}"></ha-state-icon> ${(0,d.u)(e)} </ha-check-list-item>`:s.s6,this._entities=(0,n.A)((e,t,a,i)=>Object.values(e).filter(e=>(!t||(0,l.t)(e)!==t)&&(!a||e.entity_id.toLowerCase().includes(a)||e.attributes.friendly_name?.toLowerCase().includes(a))).sort((e,t)=>(0,h.xL)((0,d.u)(e),(0,d.u)(t),this.hass.locale.language)))}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],b.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)()],b.prototype,"type",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],b.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],b.prototype,"expanded",void 0),(0,i.Cg)([(0,o.wk)()],b.prototype,"_shouldRender",void 0),(0,i.Cg)([(0,o.wk)()],b.prototype,"_filter",void 0),(0,i.Cg)([(0,o.P)("ha-list")],b.prototype,"_list",void 0),b=(0,i.Cg)([(0,o.EM)("ha-filter-entities")],b),t()}catch(e){t(e)}})},2617(e,t,a){a.a(e,async function(e,t){try{a(74423),a(44114);var i=a(62826),s=a(5124),o=a(22441),n=a(75751),r=a(1087),l=a(14503),d=(a(30716),a(11382),a(47680),a(26300)),h=a(23430),c=(a(8630),a(28732),a(61037),a(14782)),p=a(75197),g=e([d,h,p]);[d,h,p]=g.then?(await g)():g;const u="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";class v extends s.WF{render(){return s.qy` <ha-expansion-panel left-chevron .expanded="${this.expanded}" @expanded-will-change="${this._expandedWillChange}" @expanded-changed="${this._expandedChanged}"> <div slot="header" class="header"> ${this.hass.localize("ui.panel.config.dashboard.voice_assistants.main")} ${this.value?.length?s.qy`<div class="badge">${this.value?.length}</div> <ha-icon-button .path="${u}" @click="${this._clearFilter}"></ha-icon-button>`:s.s6} </div> ${this._shouldRender?s.qy`<ha-list @selected="${this._assistantsSelected}" class="ha-scrollbar" multi> ${(0,n.u)(this._voiceAssistantOptions,e=>e,e=>s.qy`<ha-check-list-item .value="${e}" .selected="${(this.value||[]).includes(e)}" hasMeta graphic="icon"> <voice-assistant-brand-icon slot="graphic" .voiceAssistantId="${e}" .hass="${this.hass}"> </voice-assistant-brand-icon> ${c.aK[e].name} </ha-check-list-item>`)} </ha-list> `:s.s6} </ha-expansion-panel> `}firstUpdated(e){super.firstUpdated(e),this._voiceAssistantOptions=Object.keys(c.aK)}updated(e){e.has("expanded")&&this.expanded&&setTimeout(()=>{this.expanded&&(this._list.style.height=this.clientHeight-49+"px")},300)}_expandedWillChange(e){this._shouldRender=e.detail.expanded}_expandedChanged(e){this.expanded=e.detail.expanded}async _assistantsSelected(e){if(!e.detail.index)return(0,r.r)(this,"data-table-filter-changed",{value:[],items:void 0}),void(this.value=[]);const t=[];for(const a of e.detail.index)t.push(this._voiceAssistantOptions[a]);this.value=t,(0,r.r)(this,"data-table-filter-changed",{value:this.value,items:void 0})}_clearFilter(e){e.preventDefault(),this.value=[],(0,r.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[l.dp,s.AH`:host{position:relative;border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}ha-check-list-item{--mdc-list-item-graphic-margin:var(--ha-space-4)}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end: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)}.add{position:absolute;bottom:0;right:0;left:0}`]}constructor(...e){super(...e),this.value=[],this.narrow=!1,this.expanded=!1,this._voiceAssistantOptions=[],this._shouldRender=!1}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],v.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],v.prototype,"expanded",void 0),(0,i.Cg)([(0,o.wk)()],v.prototype,"_voiceAssistantOptions",void 0),(0,i.Cg)([(0,o.wk)()],v.prototype,"_shouldRender",void 0),(0,i.Cg)([(0,o.P)("ha-list")],v.prototype,"_list",void 0),v=(0,i.Cg)([(0,o.EM)("ha-filter-voice-assistants")],v),t()}catch(e){t(e)}})},61037(e,t,a){var i=a(62826),s=a(22441),o=a(5124),n=a(14503),r=a(14782),l=a(44144);class d extends o.WF{render(){return o.qy` <img class="logo" alt="${r.aK[this.voiceAssistantId].name}" src="${(0,l.MR)({domain:r.aK[this.voiceAssistantId].domain,type:"icon",darkOptimized:this.hass.themes?.darkMode},this.hass.auth.data.hassUrl)}" crossorigin="anonymous" referrerpolicy="no-referrer"> `}static get styles(){return[n.RF,o.AH`:host{display:inline}.logo{position:relative;vertical-align:middle;height:24px}`]}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],d.prototype,"voiceAssistantId",void 0),d=(0,i.Cg)([(0,s.EM)("voice-assistant-brand-icon")],d)},82e3(e,t,a){a.d(t,{D5:()=>i,Fy:()=>n,Gk:()=>d,Hg:()=>s,Y_:()=>h,ds:()=>l,e0:()=>o,ec:()=>r});a(74423),a(18111),a(61701),a(33110);const i=14881==a.j?`${location.protocol}//${location.host}`:null,s=e=>e.map(e=>{if("string"!==e.type)return e;switch(e.name){case"username":return{...e,autocomplete:"username",autofocus:!0};case"password":return{...e,autocomplete:"current-password"};case"code":return{...e,autocomplete:"one-time-code",autofocus:!0};default:return e}}),o=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),n=async(e,t,a,i)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:a,password:i}),r=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:a}),l=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:a}),d=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:a}),h=(e,t,a)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:a})},76570(e,t,a){a.d(t,{AH:()=>n,Ar:()=>r,JJ:()=>h,pW:()=>d,s_:()=>l});var i=a(35518),s=a(52220),o=a(9899);const n=(e,t)=>e.sendMessagePromise({type:"config/category_registry/list",scope:t}).then(e=>e.sort((e,t)=>(0,s.xL)(e.name,t.name))),r=(e,t,a)=>(0,i.N)(`_categoryRegistry_${t}`,e=>n(e,t),(e,a)=>e.subscribeEvents((0,o.s)(()=>n(e,t).then(e=>a.setState(e,!0)),500,!0),"category_registry_updated"),e,a),l=(e,t,a)=>e.callWS({type:"config/category_registry/create",scope:t,...a}),d=(e,t,a,i)=>e.callWS({type:"config/category_registry/update",scope:t,category_id:a,...i}),h=(e,t,a)=>e.callWS({type:"config/category_registry/delete",scope:t,category_id:a})},14782(e,t,a){a.d(t,{Gw:()=>n,Ow:()=>l,YH:()=>o,aK:()=>s,hB:()=>d,ij:()=>r});a(18111),a(22489);var i=a(59241);const s={conversation:{domain:"assist_pipeline",name:"Assist"},"cloud.alexa":{domain:"alexa",name:"Amazon Alexa"},"cloud.google_assistant":{domain:"google_assistant",name:"Google Assistant"}},o=(e,t,a)=>e.callWS({type:"homeassistant/expose_new_entities/set",assistant:t,expose_new:a}),n=(e,t)=>e.callWS({type:"homeassistant/expose_new_entities/get",assistant:t}),r=(e,t,a,i)=>e.callWS({type:"homeassistant/expose_entity",assistants:t,entity_ids:a,should_expose:i}),l=e=>e.callWS({type:"homeassistant/expose_entity/list"}),d=(e,t)=>{const a=(0,i.Ox)(e)[t];return Object.keys(s).filter(e=>a?.options?.[e]?.should_expose)}},81310(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),s=a(5124),o=a(22441),n=a(6412),r=a(26218),l=a(91926),d=a(90248),h=a(2054),c=a(14503),p=e([d,h]);[d,h]=p.then?(await p)():p;class g extends s.WF{render(){return s.qy` <div class="toolbar ${(0,n.H)({narrow:this.narrow})}"> <div class="toolbar-content"> ${this.mainPage||history.state?.root?s.qy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:this.backPath?s.qy` <ha-icon-button-arrow-prev href="${this.backPath}" .hass="${this.hass}"></ha-icon-button-arrow-prev> `:s.qy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._backTapped}"></ha-icon-button-arrow-prev> `} <div class="main-title"> <slot name="header">${this.header}</slot> </div> <slot name="toolbar-icon"></slot> </div> </div> <div class="${(0,n.H)({content:!0,"ha-scrollbar":this.scrollable,"not-scrollable":!this.scrollable})}" @scroll="${this._saveScrollPos}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `}_saveScrollPos(e){this._savedScrollPos=e.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,l.OE)()}static get styles(){return[c.dp,s.AH`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{background-color:var(--app-header-background-color);padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right)}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;padding:8px 12px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;align-items:center;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-normal);min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.narrow .main-title{margin-inline-start:var(--ha-space-2)}.content{position:relative;width:calc(100% - var(--safe-area-inset-right,0px));height:calc(100% - 1px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));padding-bottom:var(--safe-area-inset-bottom,0px);margin-right:var(--safe-area-inset-right);overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}.content.not-scrollable{overflow:hidden;display:flex;flex-direction:column}:host([narrow]) .content{width:calc(100% - var(--safe-area-inset-left,0px) - var(--safe-area-inset-right,0px));margin-left:var(--safe-area-inset-left)}#fab{position:absolute;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right,0px));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]) #fab.tabs{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:calc(24px + var(--safe-area-inset-bottom,0px));right:calc(24px + var(--safe-area-inset-right,0px));inset-inline-end:calc(24px + var(--safe-area-inset-right,0px));inset-inline-start:initial}`]}constructor(...e){super(...e),this.mainPage=!1,this.narrow=!1,this.scrollable=!0}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)()],g.prototype,"header",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,attribute:"main-page"})],g.prototype,"mainPage",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"back-path"})],g.prototype,"backPath",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"backCallback",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],g.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],g.prototype,"scrollable",void 0),(0,i.Cg)([(0,r.a)(".content")],g.prototype,"_savedScrollPos",void 0),(0,i.Cg)([(0,o.Ls)({passive:!0})],g.prototype,"_saveScrollPos",null),g=(0,i.Cg)([(0,o.EM)("hass-subpage")],g),t()}catch(e){t(e)}})},55270(e,t,a){a.d(t,{j:()=>o});var i=a(1087);const s=()=>a.e(98983).then(a.bind(a,35930)),o=(e,t)=>{(0,i.r)(e,"show-dialog",{dialogTag:"dialog-assign-category",dialogImport:s,dialogParams:t})}},90986(e,t,a){a.d(t,{S:()=>o});var i=a(1087);const s=()=>a.e(25291).then(a.bind(a,81574)),o=(e,t)=>{(0,i.r)(e,"show-dialog",{dialogTag:"dialog-category-registry-detail",dialogImport:s,dialogParams:t})}},94017(e,t,a){a.a(e,async function(e,i){try{a.d(t,{HX:()=>d,MD:()=>r});a(74423),a(18111),a(61701),a(13579);var s=a(5124),o=a(75197),n=e([o]);function r(e,t,a,i,o,n){return{title:e("ui.panel.config.generic.headers.assistants"),type:"flex",defaultHidden:!n,sortable:!0,showNarrow:!0,minWidth:"112px",maxWidth:"112px",valueColumn:"assistants_sortable_key",template:e=>s.qy`${0!==e.assistants.length?s.qy`<div style="display:flex;gap:var(--ha-space-1)"> ${a.map(a=>{const s=!o?.[a]||o[a].includes(e.entity_id),n=e.manAssistants?.includes(a);return l(e.entity_id,e.assistants.includes(a),a,t,i,n,!s)})} </div>`:s.s6}`}}o=(n.then?(await n)():n)[0];const l=(e,t,a,i,o,n,r)=>{const l=o?.some(e=>e.assistants.includes(a));return t?s.qy`<voice-assistants-expose-assistant-icon .id="${e}" .assistant="${a}" .hass="${i}" .manual="${n??!1}" .unsupported="${r??!1}"></voice-assistants-expose-assistant-icon>`:l?s.qy`<div style="width:24px"></div>`:s.s6},d=e=>{let t=0;if(!e.length)return;return["conversation","cloud.alexa","cloud.google_assistant"].forEach((a,i)=>{e.includes(a)&&(t+=2**i)}),3===t?t=4:4===t&&(t=3),`${t}`};i()}catch(h){i(h)}})},19661(e,t,a){a.d(t,{V:()=>o});a(44114);var i=a(22786),s=a(36312);const o=(0,i.A)((e,t)=>{const a=[];return(0,s.x)(t.config,"conversation")&&a.push("conversation"),e?.logged_in&&(e.prefs.alexa_enabled&&a.push("cloud.alexa"),e.prefs.google_enabled&&a.push("cloud.google_assistant")),a})},75197(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),s=a(5124),o=a(22441),n=a(89784),r=a(80880),l=a(14782),d=(a(67094),a(34127)),h=(a(61037),e([d]));d=(h.then?(await h)():h)[0];const c="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";class p extends s.WF{render(){if(!this.assistant||!l.aK[this.assistant])return s.s6;const e=(0,r.Y)(this.id)+"-"+this.assistant;return s.qy` <div class="container" id="${e}"> <voice-assistant-brand-icon style="${(0,n.W)({filter:this.manual?"grayscale(100%)":void 0})}" .voiceAssistantId="${this.assistant}" .hass="${this.hass}"> </voice-assistant-brand-icon> ${this.unsupported?s.qy` <ha-svg-icon .path="${c}" class="unsupported"></ha-svg-icon> `:s.s6} </div> <ha-tooltip for="${e}" placement="left" .disabled="${!this.unsupported&&!this.manual}"> ${this.unsupported?this.hass.localize("ui.panel.config.voice_assistants.expose.not_supported"):""} ${this.unsupported&&this.manual?s.qy`<br>`:s.s6} ${this.manual?this.hass.localize("ui.panel.config.voice_assistants.expose.manually_configured"):s.s6} </ha-tooltip> `}constructor(...e){super(...e),this.unsupported=!1,this.manual=!1}}p.styles=s.AH`.container{position:relative}.unsupported{color:var(--error-color);position:absolute;--mdc-icon-size:16px;right:10px;top:-7px;inset-inline-end:10px;inset-inline-start:initial}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],p.prototype,"unsupported",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],p.prototype,"manual",void 0),(0,i.Cg)([(0,o.MZ)()],p.prototype,"assistant",void 0),p=(0,i.Cg)([(0,o.EM)("voice-assistants-expose-assistant-icon")],p),t()}catch(e){t(e)}})}};