UNPKG

iobroker.lovelace

Version:

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

1 lines 4.29 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[11844],{7466:function(t,s,e){e.a(t,async function(t,a){try{e.r(s),e.d(s,{CloudForgotPasswordCard:function(){return P}});e(3362),e(62953);var r=e(40445),o=e(5124),i=e(67576),n=e(1087),l=e(89300),d=e(38962),h=(e(76776),e(91485)),c=e(71117),u=e(79007),p=e(14503),g=t([l,d,h]);[l,d,h]=g.then?(await g)():g;let y,_,w,m,v=t=>t;class P extends o.WF{render(){return this.cardLess?this._renderContent():(0,o.qy)(y||(y=v` <ha-card outlined .header="${0}"> ${0} </ha-card> `),this.localize(`ui.panel.${this.translationKeyPanel}.subtitle`),this._renderContent())}_renderContent(){var t;return(0,o.qy)(_||(_=v` <div class="card-content"> <p> ${0} </p> ${0} <ha-input autofocus id="email" label="${0}" .value="${0}" type="email" required .disabled="${0}" @keydown="${0}" .validationMessage="${0}"></ha-input> </div> <div class="card-actions"> <ha-progress-button @click="${0}" .progress="${0}"> ${0} </ha-progress-button> </div> `),this.localize(`ui.panel.${this.translationKeyPanel}.instructions`),this._error?(0,o.qy)(w||(w=v`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):o.s6,this.localize(`ui.panel.${this.translationKeyPanel}.email`),null!==(t=this.email)&&void 0!==t?t:"",this._inProgress,this._keyDown,this.localize(`ui.panel.${this.translationKeyPanel}.email_error_msg`),this._handleEmailPasswordReset,this._inProgress,this.localize(`ui.panel.${this.translationKeyPanel}.send_reset_email`))}_keyDown(t){"Enter"===t.key&&this._handleEmailPasswordReset()}async _handleEmailPasswordReset(){var t;const s=this.emailField,e=null!==(t=s.value)&&void 0!==t?t:"";s.reportValidity()?(this._inProgress=!0,this._resetPassword(e)):s.focus()}static get styles(){return[p.RF,(0,o.AH)(m||(m=v`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,u.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})],P.prototype,"hass",void 0),(0,r.Cg)([(0,i.MZ)({attribute:!1})],P.prototype,"localize",void 0),(0,r.Cg)([(0,i.MZ)({attribute:"translation-key-panel"})],P.prototype,"translationKeyPanel",void 0),(0,r.Cg)([(0,i.MZ)()],P.prototype,"email",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean,attribute:"card-less"})],P.prototype,"cardLess",void 0),(0,r.Cg)([(0,i.wk)()],P.prototype,"_inProgress",void 0),(0,r.Cg)([(0,i.wk)()],P.prototype,"_error",void 0),(0,r.Cg)([(0,i.P)("#email",!0)],P.prototype,"emailField",void 0),P=(0,r.Cg)([(0,i.EM)("cloud-forgot-password-card")],P),a()}catch(y){a(y)}})},92949:function(t,s,e){e.a(t,async function(t,a){try{e.r(s),e.d(s,{CloudForgotPassword:function(){return g}});e(62953);var r=e(40445),o=e(5124),i=e(67576),n=e(7466),l=e(81310),d=e(14503),h=t([n,l]);[n,l]=h.then?(await h)():h;let c,u,p=t=>t;class g extends o.WF{render(){return(0,o.qy)(c||(c=p` <hass-subpage .hass="${0}" .narrow="${0}" .header="${0}"> <div class="content"> <cloud-forgot-password-card .hass="${0}" .localize="${0}" .email="${0}"></cloud-forgot-password-card> </div> </hass-subpage> `),this.hass,this.narrow,this.hass.localize("ui.panel.config.cloud.forgot_password.title"),this.hass,this.hass.localize,this.email)}static get styles(){return[d.RF,(0,o.AH)(u||(u=p`.content{padding-bottom:24px}`))]}constructor(...t){super(...t),this.narrow=!1,this._requestInProgress=!1}}(0,r.Cg)([(0,i.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean})],g.prototype,"narrow",void 0),(0,r.Cg)([(0,i.MZ)()],g.prototype,"email",void 0),(0,r.Cg)([(0,i.wk)()],g.prototype,"_requestInProgress",void 0),g=(0,r.Cg)([(0,i.EM)("cloud-forgot-password")],g),a()}catch(c){a(c)}})}}]);