UNPKG

iobroker.lovelace

Version:

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

1 lines 7.85 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[87448],{45100:function(t,e,i){i.a(t,async function(t,o){try{i.r(e),i.d(e,{HaIconButtonPrev:function(){return _}});i(62953);var n=i(40445),a=i(5124),s=i(67576),c=i(63091),r=i(26300),p=t([r]);r=(p.then?(await p)():p)[0];let l,h=t=>t;const d="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",y="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z";class _ extends a.WF{render(){var t;return(0,a.qy)(l||(l=h` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===c.G.document.dir?y:d}}(0,n.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,n.Cg)([(0,s.MZ)({type:Boolean})],_.prototype,"disabled",void 0),(0,n.Cg)([(0,s.MZ)()],_.prototype,"label",void 0),(0,n.Cg)([(0,s.MZ)()],_.prototype,"href",void 0),(0,n.Cg)([(0,s.MZ)()],_.prototype,"target",void 0),(0,n.Cg)([(0,s.MZ)()],_.prototype,"rel",void 0),(0,n.Cg)([(0,s.MZ)()],_.prototype,"download",void 0),(0,n.Cg)([(0,s.wk)()],_.prototype,"_icon",void 0),_=(0,n.Cg)([(0,s.EM)("ha-icon-button-prev")],_),o()}catch(l){o(l)}})},6891:function(t,e,i){i.a(t,async function(t,o){try{i.r(e);i(3362),i(62953);var n=i(40445),a=i(5124),s=i(67576),c=i(1087),r=i(63130),p=i(18350),l=i(72554),h=(i(93444),i(26300)),d=i(45100),y=(i(83892),i(31420)),_=i(14503),u=i(81619),g=t([p,l,h,d,y]);[p,l,h,d,y]=g.then?(await g)():g;let v,b,m,k,w,f,$,C,L,x,K=t=>t;const z="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",M="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",H="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",Z=["current","new","done"];class E extends a.WF{showDialog(t){this._params=t,this._step=Z[0],this._open=!0,this._newEncryptionKey=(0,y.cq)()}closeDialog(){return this._params.cancel&&this._params.cancel(),this._open&&(0,c.r)(this,"dialog-closed",{dialog:this.localName}),this._open=!1,this._step=void 0,this._params=void 0,this._newEncryptionKey=void 0,!0}_done(){var t;null===(t=this._params)||void 0===t||t.submit(!0),this.closeDialog()}_previousStep(){const t=Z.indexOf(this._step);0!==t&&(this._step=Z[t-1])}_nextStep(){const t=Z.indexOf(this._step);t!==Z.length-1&&(this._step=Z[t+1])}render(){const t="current"===this._step||"new"===this._step?this.hass.localize(`ui.panel.config.backup.dialogs.change_encryption_key.${this._step}.title`):"";return(0,a.qy)(v||(v=K` <ha-dialog .open="${0}" header-title="${0}" prevent-scrim-close @closed="${0}"> ${0} ${0} <ha-dialog-footer slot="footer"> ${0} </ha-dialog-footer> </ha-dialog> `),this._open,t,this.closeDialog,"new"===this._step?(0,a.qy)(b||(b=K` <ha-icon-button-prev slot="headerNavigationIcon" @click="${0}"></ha-icon-button-prev> `),this._previousStep):(0,a.qy)(m||(m=K` <ha-icon-button slot="headerNavigationIcon" data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> `),this.hass.localize("ui.common.close"),z),this._renderStepContent(),"current"===this._step?(0,a.qy)(k||(k=K` <ha-button slot="primaryAction" @click="${0}"> ${0} </ha-button> `),this._nextStep,this.hass.localize("ui.common.next")):"new"===this._step?(0,a.qy)(w||(w=K` <ha-button slot="primaryAction" @click="${0}" .disabled="${0}" variant="danger"> ${0} </ha-button> `),this._submit,!this._newEncryptionKey,this.hass.localize("ui.panel.config.backup.dialogs.change_encryption_key.actions.change")):(0,a.qy)(f||(f=K` <ha-button slot="primaryAction" @click="${0}"> ${0} </ha-button> `),this._done,this.hass.localize("ui.panel.config.backup.dialogs.change_encryption_key.actions.done")))}_renderStepContent(){var t;switch(this._step){case"current":return(0,a.qy)($||($=K` <p> ${0} </p> <div class="encryption-key"> <p>${0}</p> <ha-icon-button .path="${0}" @click="${0}"></ha-icon-button> </div> <ha-row-item> <span slot="headline"> ${0} </span> <span slot="supporting-text"> ${0} </span> <ha-button slot="end" appearance="filled" @click="${0}"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> ${0} </ha-button> </ha-row-item> `),this.hass.localize("ui.panel.config.backup.dialogs.change_encryption_key.current.description"),null===(t=this._params)||void 0===t?void 0:t.currentKey,M,this._copyOldKeyToClipboard,this.hass.localize("ui.panel.config.backup.encryption_key.download_old_emergency_kit"),this.hass.localize("ui.panel.config.backup.encryption_key.download_old_emergency_kit_description"),this._downloadOld,H,this.hass.localize("ui.panel.config.backup.encryption_key.download_old_emergency_kit_action"));case"new":return(0,a.qy)(C||(C=K` <p> ${0} </p> <div class="encryption-key"> <p>${0}</p> <ha-icon-button .path="${0}" @click="${0}"></ha-icon-button> </div> <ha-row-item> <span slot="headline"> ${0} </span> <span slot="supporting-text"> ${0} </span> <ha-button slot="end" appearance="filled" @click="${0}"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> ${0} </ha-button> </ha-row-item> `),this.hass.localize("ui.panel.config.backup.dialogs.change_encryption_key.new.description"),this._newEncryptionKey,M,this._copyKeyToClipboard,this.hass.localize("ui.panel.config.backup.encryption_key.download_emergency_kit"),this.hass.localize("ui.panel.config.backup.encryption_key.download_emergency_kit_description"),this._downloadNew,H,this.hass.localize("ui.panel.config.backup.encryption_key.download_emergency_kit_action"));case"done":return(0,a.qy)(L||(L=K` <div class="done"> <img src="/static/images/voice-assistant/hi.png" alt="Casita ioBroker logo"> <h1> ${0} </h1> </div> `),this.hass.localize("ui.panel.config.backup.dialogs.change_encryption_key.done.title"))}return a.s6}async _copyKeyToClipboard(){await(0,r.l)(this._newEncryptionKey,this._copyContainer),(0,u.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")})}async _copyOldKeyToClipboard(){var t;null!==(t=this._params)&&void 0!==t&&t.currentKey&&(await(0,r.l)(this._params.currentKey,this._copyContainer),(0,u.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")}))}_downloadOld(){var t;null!==(t=this._params)&&void 0!==t&&t.currentKey&&(0,y.Sx)(this.hass,this._params.currentKey,"old")}_downloadNew(){this._newEncryptionKey&&(0,y.Sx)(this.hass,this._newEncryptionKey)}async _submit(){this._newEncryptionKey&&(this._params.saveKey(this._newEncryptionKey),this._nextStep())}static get styles(){return[_.RF,_.nA,(0,a.AH)(x||(x=K`ha-dialog{--dialog-content-padding:var(--ha-space-2) var(--ha-space-6)}ha-row-item{--ha-row-item-padding-inline:0}.encryption-key{border:1px solid var(--divider-color);background-color:var(--primary-background-color);border-radius:var(--ha-border-radius-md);padding:16px;display:flex;flex-direction:row;align-items:center;gap:var(--ha-space-6)}.encryption-key p{margin:0;flex:1;font-size:var(--ha-font-size-xl);font-family:var(--ha-font-family-code);font-style:normal;font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);text-align:center}.encryption-key ha-icon-button{flex:none;margin:-16px}p{margin-top:0}.done{text-align:center}`))]}constructor(...t){super(...t),this._open=!1}}(0,n.Cg)([(0,s.MZ)({attribute:!1})],E.prototype,"hass",void 0),(0,n.Cg)([(0,s.wk)()],E.prototype,"_open",void 0),(0,n.Cg)([(0,s.wk)()],E.prototype,"_step",void 0),(0,n.Cg)([(0,s.wk)()],E.prototype,"_params",void 0),(0,n.Cg)([(0,s.wk)()],E.prototype,"_newEncryptionKey",void 0),(0,n.Cg)([(0,s.P)("div")],E.prototype,"_copyContainer",void 0),E=(0,n.Cg)([(0,s.EM)("ha-dialog-change-backup-encryption-key")],E),o()}catch(v){o(v)}})}}]);