export const __rspack_esm_id=52996;export const __rspack_esm_ids=[52996];export const __webpack_modules__={35535(e,t,s){s.a(e,async function(e,a){try{s.r(t);var r=s(15697),i=s(57527),o=s(79224),n=s(148),l=s(61615),d=s(88457),h=(s(75041),s(57406)),c=s(24396),p=s(28308),_=s(76730),u=e([l,d,h]);[l,d,h]=u.then?(await u)():u;class y extends i.WF{render(){return this.cardLess?this._renderContent():i.qy` <ha-card outlined .header=${this.localize(`ui.panel.${this.translationKeyPanel}.subtitle`)}> ${this._renderContent()} </ha-card> `}_renderContent(){return i.qy` <div class="card-content"> <p> ${this.localize(`ui.panel.${this.translationKeyPanel}.instructions`)} </p> ${this._error?i.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:i.s6} <ha-input autofocus id="email" label=${this.localize(`ui.panel.${this.translationKeyPanel}.email`)} .value=${this.email??""} type="email" required .disabled=${this._inProgress} @keydown=${this._keyDown} .validationMessage=${this.localize(`ui.panel.${this.translationKeyPanel}.email_error_msg`)}></ha-input> </div> <div class="card-actions"> <ha-progress-button @click=${this._handleEmailPasswordReset} .progress=${this._inProgress}> ${this.localize(`ui.panel.${this.translationKeyPanel}.send_reset_email`)} </ha-progress-button> </div> `}_keyDown(e){"Enter"===e.key&&this._handleEmailPasswordReset()}async _handleEmailPasswordReset(){const e=this.emailField,t=e.value??"";e.reportValidity()?(this._inProgress=!0,this._resetPassword(t)):e.focus()}static get styles(){return[_.RF,i.AH`ha-card{max-width:600px;margin:24px auto 0}h1{margin:0}ha-input{width:100%}.card-actions{justify-content:flex-end;align-items:center;display:flex}`]}constructor(...e){super(...e),this.translationKeyPanel="config.cloud.forgot_password",this.cardLess=!1,this._inProgress=!1,this._resetPassword=async e=>{this._inProgress=!0;try{this.hass?await(0,c.Ut)(this.hass,e):await(0,p.zN)(e),(0,n.r)(this,"cloud-email-changed",{value:e}),this._inProgress=!1,(0,n.r)(this,"cloud-done",{flashMessage:this.localize(`ui.panel.${this.translationKeyPanel}.check_your_email`)})}catch(t){this._inProgress=!1;"usernotfound"===(t&&t.body&&t.body.code)&&e!==e.toLowerCase()?await this._resetPassword(e.toLowerCase()):this._error=t&&t.body&&t.body.message?t.body.message:"Unknown error"}}}}(0,r.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"localize",void 0),(0,r.Cg)([(0,o.MZ)({attribute:"translation-key-panel"})],y.prototype,"translationKeyPanel",void 0),(0,r.Cg)([(0,o.MZ)()],y.prototype,"email",void 0),(0,r.Cg)([(0,o.MZ)({type:Boolean,attribute:"card-less"})],y.prototype,"cardLess",void 0),(0,r.Cg)([(0,o.wk)()],y.prototype,"_inProgress",void 0),(0,r.Cg)([(0,o.wk)()],y.prototype,"_error",void 0),(0,r.Cg)([(0,o.P)("#email",!0)],y.prototype,"emailField",void 0),y=(0,r.Cg)([(0,o.EM)("cloud-forgot-password-card")],y),s.d(t,{CloudForgotPasswordCard:()=>y}),a()}catch(e){a(e)}})}};
//# sourceMappingURL=52996.0035e5610032cecc.js.map