"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["95309"],{284:function(i,t,a){a.a(i,async function(i,e){try{a.r(t),a.d(t,{DialogEditHome:function(){return v}});a(3362),a(62953);var s=a(40445),o=a(96196),h=a(77845),l=a(1087),n=a(77122),r=a(38962),c=a(18350),d=(a(93444),a(72554)),p=a(14503),g=i([n,r,c,d]);[n,r,c,d]=g.then?(await g)():g;let _,u,f,m=i=>i;class v extends o.WF{showDialog(i){this._params=i,this._config=Object.assign({},i.config),this._open=!0}closeDialog(){return this._open=!1,!0}_dialogClosed(){this._params=void 0,this._config=void 0,this._submitting=!1,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}render(){var i;return this._params?(0,o.qy)(_||(_=m` <ha-dialog .hass="${0}" .open="${0}" .headerTitle="${0}" @closed="${0}"> <p class="description"> ${0} </p> <ha-entities-picker autofocus .hass="${0}" .value="${0}" .label="${0}" .placeholder="${0}" .helper="${0}" reorder @value-changed="${0}"></ha-entities-picker> <ha-alert alert-type="info"> ${0} </ha-alert> <ha-dialog-footer slot="footer"> <ha-button appearance="plain" slot="secondaryAction" @click="${0}" .disabled="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" @click="${0}" .disabled="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this.hass,this._open,this.hass.localize("ui.panel.home.editor.title"),this._dialogClosed,this.hass.localize("ui.panel.home.editor.description"),this.hass,(null===(i=this._config)||void 0===i?void 0:i.favorite_entities)||[],this.hass.localize("ui.panel.lovelace.editor.strategy.home.favorite_entities"),this.hass.localize("ui.panel.lovelace.editor.strategy.home.add_favorite_entity"),this.hass.localize("ui.panel.home.editor.favorite_entities_helper"),this._favoriteEntitiesChanged,this.hass.localize("ui.panel.home.editor.areas_hint",{areas_page:(0,o.qy)(u||(u=m`<a href="/config/areas?historyBack=1" @click="${0}">${0}</a>`),this.closeDialog,this.hass.localize("ui.panel.home.editor.areas_page"))}),this.closeDialog,this._submitting,this.hass.localize("ui.common.cancel"),this._save,this._submitting,this.hass.localize("ui.common.save")):o.s6}_favoriteEntitiesChanged(i){const t=i.detail.value;this._config=Object.assign(Object.assign({},this._config),{},{favorite_entities:t.length>0?t:void 0})}async _save(){if(this._params&&this._config){this._submitting=!0;try{await this._params.saveConfig(this._config),this.closeDialog()}catch(i){console.error("Failed to save home configuration:",i)}finally{this._submitting=!1}}}constructor(...i){super(...i),this._open=!1,this._submitting=!1}}v.styles=[p.nA,(0,o.AH)(f||(f=m`ha-dialog{--dialog-content-padding:var(--ha-space-6)}.description{margin:0 0 var(--ha-space-4) 0;color:var(--secondary-text-color)}ha-entities-picker{display:block}ha-alert{display:block;margin-top:var(--ha-space-4)}`))],(0,s.Cg)([(0,h.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,s.Cg)([(0,h.wk)()],v.prototype,"_params",void 0),(0,s.Cg)([(0,h.wk)()],v.prototype,"_config",void 0),(0,s.Cg)([(0,h.wk)()],v.prototype,"_open",void 0),(0,s.Cg)([(0,h.wk)()],v.prototype,"_submitting",void 0),v=(0,s.Cg)([(0,h.EM)("dialog-edit-home")],v),e()}catch(_){e(_)}})}}]);
//# sourceMappingURL=95309.3e935931ffe541fc.js.map