"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["24922"],{51937:function(i,t,s){s.a(i,async function(i,e){try{s.r(t);s(3362),s(62953);var a=s(40445),o=s(96196),n=s(77845),l=s(1087),r=s(72554),h=(s(93444),s(6),s(59646),s(18350)),_=s(77423),d=s(14503),c=s(65063),p=i([r,h]);[r,h]=p.then?(await p)():p;let g,y,m,b,u,f=i=>i;class w extends o.WF{async showDialog(i){this._params=i,this._error=void 0,this._disableNewEntities=i.entry.pref_disable_new_entities,this._disablePolling=i.entry.pref_disable_polling,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._error="",this._params=void 0,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}render(){return this._params?(0,o.qy)(g||(g=f` <ha-dialog .hass="${0}" .open="${0}" header-title="${0}" prevent-scrim-close @closed="${0}"> ${0} <ha-formfield .label="${0}"> <ha-switch autofocus .checked="${0}" @change="${0}" .disabled="${0}"></ha-switch> </ha-formfield> <ha-formfield .label="${0}"> <ha-switch .checked="${0}" @change="${0}" .disabled="${0}"></ha-switch> </ha-formfield> <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.dialogs.config_entry_system_options.title",{integration:this.hass.localize(`component.${this._params.entry.domain}.title`)||this._params.entry.domain}),this._dialogClosed,this._error?(0,o.qy)(y||(y=f` <div class="error">${0}</div> `),this._error):"",(0,o.qy)(m||(m=f`<p> ${0} </p> <p class="secondary"> ${0} </p>`),this.hass.localize("ui.dialogs.config_entry_system_options.enable_new_entities_label"),this.hass.localize("ui.dialogs.config_entry_system_options.enable_new_entities_description",{integration:this.hass.localize(`component.${this._params.entry.domain}.title`)||this._params.entry.domain})),!this._disableNewEntities,this._disableNewEntitiesChanged,this._submitting,(0,o.qy)(b||(b=f`<p> ${0} </p> <p class="secondary"> ${0} </p>`),this.hass.localize("ui.dialogs.config_entry_system_options.enable_polling_label"),this.hass.localize("ui.dialogs.config_entry_system_options.enable_polling_description",{integration:this.hass.localize(`component.${this._params.entry.domain}.title`)||this._params.entry.domain})),!this._disablePolling,this._disablePollingChanged,this._submitting,this.closeDialog,this._submitting,this.hass.localize("ui.common.cancel"),this._updateEntry,this._submitting,this.hass.localize("ui.dialogs.config_entry_system_options.update")):o.s6}_disableNewEntitiesChanged(i){this._error=void 0,this._disableNewEntities=!i.target.checked}_disablePollingChanged(i){this._error=void 0,this._disablePolling=!i.target.checked}async _updateEntry(){this._submitting=!0;const i={pref_disable_new_entities:this._disableNewEntities};i.pref_disable_polling=this._disablePolling;try{(await(0,_.iH)(this.hass,this._params.entry.entry_id,i)).require_restart&&await(0,c.showAlertDialog)(this,{text:this.hass.localize("ui.dialogs.config_entry_system_options.restart_home_assistant")}),this.closeDialog()}catch(t){this._error=t.message||"Unknown error"}finally{this._submitting=!1}}static get styles(){return[d.nA,(0,o.AH)(u||(u=f`.error{color:var(--error-color)}`))]}constructor(...i){super(...i),this._submitting=!1,this._open=!1}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_disableNewEntities",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_disablePolling",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_error",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_params",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_submitting",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_open",void 0),w=(0,a.Cg)([(0,n.EM)("dialog-config-entry-system-options")],w),e()}catch(g){e(g)}})}}]);
//# sourceMappingURL=24922.6f95c9a9acfc1389.js.map