UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

1 lines 3.99 kB
export const __rspack_esm_id=11844;export const __rspack_esm_ids=[11844];export const __webpack_modules__={7466(t,s,e){e.a(t,async function(t,a){try{e.r(s),e.d(s,{CloudForgotPasswordCard:()=>y});var r=e(62826),o=e(5124),i=e(22441),n=e(1087),l=e(89300),d=e(38962),h=(e(76776),e(91485)),c=e(71117),p=e(79007),u=e(14503),g=t([l,d,h]);[l,d,h]=g.then?(await g)():g;class y extends o.WF{render(){return this.cardLess?this._renderContent():o.qy` <ha-card outlined .header="${this.localize(`ui.panel.${this.translationKeyPanel}.subtitle`)}"> ${this._renderContent()} </ha-card> `}_renderContent(){return o.qy` <div class="card-content"> <p> ${this.localize(`ui.panel.${this.translationKeyPanel}.instructions`)} </p> ${this._error?o.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:o.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(t){"Enter"===t.key&&this._handleEmailPasswordReset()}async _handleEmailPasswordReset(){const t=this.emailField,s=t.value??"";t.reportValidity()?(this._inProgress=!0,this._resetPassword(s)):t.focus()}static get styles(){return[u.RF,o.AH`ha-card{max-width:600px;margin:0 auto;margin-top:24px}h1{margin:0}ha-input{width:100%}.card-actions{display:flex;justify-content:flex-end;align-items:center}`]}constructor(...t){super(...t),this.translationKeyPanel="config.cloud.forgot_password",this.cardLess=!1,this._inProgress=!1,this._resetPassword=async t=>{this._inProgress=!0;try{this.hass?await(0,c.Ut)(this.hass,t):await(0,p.zN)(t),(0,n.r)(this,"cloud-email-changed",{value:t}),this._inProgress=!1,(0,n.r)(this,"cloud-done",{flashMessage:this.localize(`ui.panel.${this.translationKeyPanel}.check_your_email`)})}catch(s){this._inProgress=!1;"usernotfound"===(s&&s.body&&s.body.code)&&t!==t.toLowerCase()?await this._resetPassword(t.toLowerCase()):this._error=s&&s.body&&s.body.message?s.body.message:"Unknown error"}}}}(0,r.Cg)([(0,i.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,r.Cg)([(0,i.MZ)({attribute:!1})],y.prototype,"localize",void 0),(0,r.Cg)([(0,i.MZ)({attribute:"translation-key-panel"})],y.prototype,"translationKeyPanel",void 0),(0,r.Cg)([(0,i.MZ)()],y.prototype,"email",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean,attribute:"card-less"})],y.prototype,"cardLess",void 0),(0,r.Cg)([(0,i.wk)()],y.prototype,"_inProgress",void 0),(0,r.Cg)([(0,i.wk)()],y.prototype,"_error",void 0),(0,r.Cg)([(0,i.P)("#email",!0)],y.prototype,"emailField",void 0),y=(0,r.Cg)([(0,i.EM)("cloud-forgot-password-card")],y),a()}catch(t){a(t)}})},92949(t,s,e){e.a(t,async function(t,a){try{e.r(s),e.d(s,{CloudForgotPassword:()=>c});var r=e(62826),o=e(5124),i=e(22441),n=e(7466),l=e(81310),d=e(14503),h=t([n,l]);[n,l]=h.then?(await h)():h;class c extends o.WF{render(){return o.qy` <hass-subpage .hass="${this.hass}" .narrow="${this.narrow}" .header="${this.hass.localize("ui.panel.config.cloud.forgot_password.title")}"> <div class="content"> <cloud-forgot-password-card .hass="${this.hass}" .localize="${this.hass.localize}" .email="${this.email}"></cloud-forgot-password-card> </div> </hass-subpage> `}static get styles(){return[d.RF,o.AH`.content{padding-bottom:24px}`]}constructor(...t){super(...t),this.narrow=!1,this._requestInProgress=!1}}(0,r.Cg)([(0,i.MZ)({attribute:!1})],c.prototype,"hass",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean})],c.prototype,"narrow",void 0),(0,r.Cg)([(0,i.MZ)()],c.prototype,"email",void 0),(0,r.Cg)([(0,i.wk)()],c.prototype,"_requestInProgress",void 0),c=(0,r.Cg)([(0,i.EM)("cloud-forgot-password")],c),a()}catch(t){a(t)}})}};