export const __rspack_esm_id="24922";export const __rspack_esm_ids=["24922"];export const __webpack_modules__={51937(i,t,s){s.a(i,async function(i,e){try{s.r(t);var o=s(62826),a=s(96196),n=s(97735),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;class g extends a.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?a.qy` <ha-dialog .hass="${this.hass}" .open="${this._open}" header-title="${this.hass.localize("ui.dialogs.config_entry_system_options.title",{integration:this.hass.localize(`component.${this._params.entry.domain}.title`)||this._params.entry.domain})}" prevent-scrim-close @closed="${this._dialogClosed}"> ${this._error?a.qy` <div class="error">${this._error}</div> `:""} <ha-formfield .label="${a.qy`<p> ${this.hass.localize("ui.dialogs.config_entry_system_options.enable_new_entities_label")} </p> <p class="secondary"> ${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})} </p>`}"> <ha-switch autofocus .checked="${!this._disableNewEntities}" @change="${this._disableNewEntitiesChanged}" .disabled="${this._submitting}"></ha-switch> </ha-formfield> <ha-formfield .label="${a.qy`<p> ${this.hass.localize("ui.dialogs.config_entry_system_options.enable_polling_label")} </p> <p class="secondary"> ${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})} </p>`}"> <ha-switch .checked="${!this._disablePolling}" @change="${this._disablePollingChanged}" .disabled="${this._submitting}"></ha-switch> </ha-formfield> <ha-dialog-footer slot="footer"> <ha-button appearance="plain" slot="secondaryAction" @click="${this.closeDialog}" .disabled="${this._submitting}"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button slot="primaryAction" @click="${this._updateEntry}" .disabled="${this._submitting}"> ${this.hass.localize("ui.dialogs.config_entry_system_options.update")} </ha-button> </ha-dialog-footer> </ha-dialog> `:a.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(i){this._error=i.message||"Unknown error"}finally{this._submitting=!1}}static get styles(){return[d.nA,a.AH`.error{color:var(--error-color)}`]}constructor(...i){super(...i),this._submitting=!1,this._open=!1}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_disableNewEntities",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_disablePolling",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_error",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_params",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_submitting",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_open",void 0),g=(0,o.Cg)([(0,n.EM)("dialog-config-entry-system-options")],g),e()}catch(i){e(i)}})}};
//# sourceMappingURL=24922.5cf2f8d9184e9075.js.map