UNPKG

iobroker.lovelace

Version:

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

16 lines 33.2 kB
(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[54418],{69093:function(e,t,a){"use strict";a.d(t,{t:function(){return i}});var o=a(71727);const i=e=>(0,o.m)(e.entity_id)},82286:function(e,t,a){"use strict";a.d(t,{$:function(){return o}});const o=(e,t)=>i(e.attributes,t),i=(e,t)=>0!==(e.supported_features&t)},93444:function(e,t,a){"use strict";var o=a(40445),i=a(5124),r=a(67576);let s,l,n=e=>e;class d extends i.WF{render(){return(0,i.qy)(s||(s=n` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `))}static get styles(){return[(0,i.AH)(l||(l=n`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}}d=(0,o.Cg)([(0,r.EM)("ha-dialog-footer")],d)},76538:function(e,t,a){"use strict";a(62953);var o=a(40445),i=a(5124),r=a(67576);let s,l,n,d,h,c,p=e=>e;class u extends i.WF{render(){const e=(0,i.qy)(s||(s=p`<div class="header-title"> <slot name="title"></slot> </div>`)),t=(0,i.qy)(l||(l=p`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`));return(0,i.qy)(n||(n=p` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${0} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `),"above"===this.subtitlePosition?(0,i.qy)(d||(d=p`${0}${0}`),t,e):(0,i.qy)(h||(h=p`${0}${0}`),e,t))}static get styles(){return[(0,i.AH)(c||(c=p`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`))]}constructor(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,o.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],u.prototype,"subtitlePosition",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],u.prototype,"showBorder",void 0),u=(0,o.Cg)([(0,r.EM)("ha-dialog-header")],u)},72554:function(e,t,a){"use strict";a.a(e,async function(e,t){try{a(3362),a(62953),a(49255);var o=a(40445),i=a(93900),r=a(35211),s=a(5124),l=a(67576),n=a(63672),d=a(1087),h=a(64481),c=a(22792),p=a(59992),u=a(14503),g=a(22348),v=(a(76538),a(26300)),m=e([i,v,p]);[i,v,p]=m.then?(await m)():m;let b,f,w,_,y,k,x,C=e=>e;const S="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";class $ extends((0,p.V)(s.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(e){super.updated(e),e.has("open")&&(this._open=this.open)}render(){var e,t,a;return(0,s.qy)(b||(b=C` <wa-dialog .open="${0}" .lightDismiss="${0}" without-header aria-labelledby="${0}" aria-describedby="${0}" @keydown="${0}" @wa-hide="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-after-hide="${0}"> ${0} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${0}"> <slot></slot> </div> ${0} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `),this._open,!this.preventScrimClose,(0,n.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)),(0,n.J)(this.ariaDescribedBy),this._handleKeyDown,this._handleHide,this._handleShow,this._handleAfterShow,this._handleAfterHide,this.withoutHeader?s.s6:(0,s.qy)(f||(f=C`<slot name="header"> <ha-dialog-header .subtitlePosition="${0}" .showBorder="${0}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> </slot> ${0} ${0} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`),this.headerSubtitlePosition,this._bodyScrolled,null!==(e=null===(t=this._i18n)||void 0===t||null===(a=t.localize)||void 0===a?void 0:a.call(t,"ui.common.close"))&&void 0!==e?e:"Close",S,void 0!==this.headerTitle?(0,s.qy)(w||(w=C`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,s.qy)(_||(_=C`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,s.qy)(y||(y=C`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,s.qy)(k||(k=C`<slot name="headerSubtitle" slot="subtitle"></slot>`))),this._handleBodyScroll,this.renderScrollableFades())}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,h.J)(()=>{this._setFullscreen(e.detail)}):this._setFullscreen(e.detail)}_setFullscreen(e){this.toggleAttribute("fullscreen",e)}_handleBodyScroll(e){this._bodyScrolled=e.target.scrollTop>0}_handleKeyDown(e){"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)}_handleHide(e){var t;const a=(null===(t=e.detail)||void 0===t?void 0:t.source)===e.target.dialog;this.preventScrimClose&&this._escapePressed&&a&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,u.dp,(0,s.AH)(x||(x=C`wa-dialog{--full-width:var( --ha-dialog-width-full, min(95vw, var(--safe-width)) );--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var( --ha-dialog-surface-background, var(--card-background-color, var(--ha-color-surface-default)) );--wa-panel-border-radius:var( --ha-dialog-border-radius, var(--ha-border-radius-3xl) );max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var( --ha-dialog-header-title-font-size, var(--ha-font-size-2xl) );line-height:var( --ha-dialog-header-title-line-height, var(--ha-line-height-condensed) );font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}constructor(...e){super(...e),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var e,t;if(null!==(e=this._hassConfig)&&void 0!==e&&e.auth.external&&(0,g.V)(this._hassConfig.auth.external)){const e=this.querySelector("[autofocus]");return void(null!==e&&(e.id||(e.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})))}null===(t=this.querySelector("[autofocus]"))||void 0===t||t.focus()}))},this._handleAfterShow=e=>{e.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,o.Cg)([(0,l.MZ)({attribute:"aria-labelledby"})],$.prototype,"ariaLabelledBy",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"aria-describedby"})],$.prototype,"ariaDescribedBy",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0})],$.prototype,"open",void 0),(0,o.Cg)([(0,l.MZ)({reflect:!0})],$.prototype,"type",void 0),(0,o.Cg)([(0,l.MZ)({type:String,reflect:!0,attribute:"width"})],$.prototype,"width",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],$.prototype,"preventScrimClose",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-title"})],$.prototype,"headerTitle",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-subtitle"})],$.prototype,"headerSubtitle",void 0),(0,o.Cg)([(0,l.MZ)({type:String,attribute:"header-subtitle-position"})],$.prototype,"headerSubtitlePosition",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],$.prototype,"flexContent",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,attribute:"without-header"})],$.prototype,"withoutHeader",void 0),(0,o.Cg)([(0,l.wk)()],$.prototype,"_open",void 0),(0,o.Cg)([(0,l.P)(".body")],$.prototype,"bodyContainer",void 0),(0,o.Cg)([(0,l.wk)(),(0,r.Fg)({context:c.D5,subscribe:!0})],$.prototype,"_i18n",void 0),(0,o.Cg)([(0,l.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],$.prototype,"_hassConfig",void 0),(0,o.Cg)([(0,l.wk)()],$.prototype,"_bodyScrolled",void 0),(0,o.Cg)([(0,l.Ls)({passive:!0})],$.prototype,"_handleBodyScroll",null),$=(0,o.Cg)([(0,l.EM)("ha-dialog")],$),t()}catch(b){t(b)}})},38377:function(e,t,a){"use strict";var o=a(59787),i=(a(74423),a(72712),a(18111),a(22489),a(61701),a(18237),a(3362),a(27495),a(62953),a(40445)),r=a(5124),s=a(67576),l=a(20889),n=a(30015),d=a.n(n),h=a(1087),c=(a(3296),a(27208),a(48408),a(14603),a(47566),a(98721),a(2209));let p;var u=a(996);let g,v=e=>e;const m=e=>(0,r.qy)(g||(g=v`${0}`),e),b=new u.G(1e3),f={reType:(0,o.A)(/((\[!(caution|important|note|tip|warning)\])(?:\s|\\n)?)/i,{input:1,type:3}),typeToHaAlert:{caution:"error",important:"info",note:"info",tip:"success",warning:"warning"}};class w extends r.mN{disconnectedCallback(){if(super.disconnectedCallback(),this.cache){const e=this._computeCacheKey();b.set(e,this.innerHTML)}}createRenderRoot(){return this}update(e){super.update(e),void 0!==this.content&&(this._renderPromise=this._render())}async getUpdateComplete(){return await super.getUpdateComplete(),await this._renderPromise,!0}willUpdate(e){if(!this.innerHTML&&this.cache){const e=this._computeCacheKey();b.has(e)&&((0,r.XX)(m((0,l._)(b.get(e))),this.renderRoot),this._resize())}}_computeCacheKey(){return d()({content:this.content,allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl,breaks:this.breaks})}async _render(){const e=await(async(e,t,o)=>(p||(p=(0,c.LV)(new Worker(new URL(a.p+a.u(55640),a.b)))),p.renderMarkdown(e,t,o)))(String(this.content),{breaks:this.breaks,gfm:!0},{allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl});(0,r.XX)(m((0,l._)(e.join(""))),this.renderRoot),this._resize();const t=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT,null);for(;t.nextNode();){const e=t.currentNode;if(e instanceof HTMLAnchorElement&&e.host!==document.location.host)e.target="_blank",e.rel="noreferrer noopener";else if(e instanceof HTMLImageElement)this.lazyImages&&(e.loading="lazy"),e.addEventListener("load",this._resize);else if(e instanceof HTMLQuoteElement){var o;const a=(null===(o=e.firstElementChild)||void 0===o||null===(o=o.firstChild)||void 0===o?void 0:o.textContent)&&f.reType.exec(e.firstElementChild.firstChild.textContent);if(a){const{type:o}=a.groups,i=document.createElement("ha-alert");i.alertType=f.typeToHaAlert[o.toLowerCase()],i.append(...Array.from(e.childNodes).map(e=>{const t=Array.from(e.childNodes);if(!this.breaks&&t.length){var o;const e=t[0];e.nodeType===Node.TEXT_NODE&&e.textContent===a.input&&null!==(o=e.textContent)&&void 0!==o&&o.includes("\n")&&(e.textContent=e.textContent.split("\n").slice(1).join("\n"))}return t}).reduce((e,t)=>e.concat(t),[]).filter(e=>e.textContent&&e.textContent!==a.input)),t.parentNode().replaceChild(i,e)}}else e instanceof HTMLElement&&["ha-alert","ha-qr-code","ha-icon","ha-svg-icon"].includes(e.localName)&&a(62003)(`./${e.localName}`)}}constructor(...e){super(...e),this.allowSvg=!1,this.allowDataUrl=!1,this.breaks=!1,this.lazyImages=!1,this.cache=!1,this._renderPromise=Promise.resolve(),this._resize=()=>(0,h.r)(this,"content-resize")}}(0,i.Cg)([(0,s.MZ)()],w.prototype,"content",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"allow-svg",type:Boolean})],w.prototype,"allowSvg",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"allow-data-url",type:Boolean})],w.prototype,"allowDataUrl",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"breaks",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"lazy-images"})],w.prototype,"lazyImages",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"cache",void 0),w=(0,i.Cg)([(0,s.EM)("ha-markdown-element")],w)},3587:function(e,t,a){"use strict";a(3362),a(62953);var o=a(40445),i=a(5124),r=a(67576);a(38377);let s,l,n=e=>e;class d extends i.WF{async getUpdateComplete(){var e;const t=await super.getUpdateComplete();return await(null===(e=this._markdownElement)||void 0===e?void 0:e.updateComplete),t}render(){return this.content?(0,i.qy)(s||(s=n`<ha-markdown-element .content="${0}" .allowSvg="${0}" .allowDataUrl="${0}" .breaks="${0}" .lazyImages="${0}" .cache="${0}"></ha-markdown-element>`),this.content,this.allowSvg,this.allowDataUrl,this.breaks,this.lazyImages,this.cache):i.s6}constructor(...e){super(...e),this.allowSvg=!1,this.allowDataUrl=!1,this.breaks=!1,this.lazyImages=!1,this.cache=!1}}d.styles=(0,i.AH)(l||(l=n`:host{display:block}ha-markdown-element{-ms-user-select:text;-webkit-user-select:text;-moz-user-select:text}ha-markdown-element>:first-child{margin-top:0}ha-markdown-element>:last-child{margin-bottom:0}ha-alert{display:block;margin:var(--ha-space-1) 0}a{color:var(--markdown-link-color,var(--primary-color))}img{background-color:var(--markdown-image-background-color);border-radius:var(--markdown-image-border-radius);max-width:100%}p:first-child>img:first-child{vertical-align:top}p:first-child>img:last-child{vertical-align:top}ha-markdown-element>:is(ol,ul){padding-inline-start:var(--markdown-list-indent,revert)}li:has(input[type=checkbox]){list-style:none}li:has(input[type=checkbox])>input[type=checkbox]{margin-left:0}svg{background-color:var(--markdown-svg-background-color,none);color:var(--markdown-svg-color,none)}code,pre{background-color:var(--markdown-code-background-color,none);border-radius:var(--ha-border-radius-sm);color:var(--markdown-code-text-color,inherit)}code{font-size:var(--ha-font-size-s);padding:.2em .4em}pre code{padding:0}pre{padding:var(--ha-space-4);overflow:auto;line-height:var(--ha-line-height-condensed);font-family:var(--ha-font-family-code)}h1,h2,h3,h4,h5,h6{line-height:initial}h2{font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-bold)}hr{border-color:var(--divider-color);border-bottom:none;margin:var(--ha-space-4) 0}table[role=presentation]{--markdown-table-border-collapse:separate;--markdown-table-border-width:0;--markdown-table-padding-inline:0;--markdown-table-padding-block:0}table[role=presentation] td,table[role=presentation] th{vertical-align:middle}table[role=presentation] td[valign=top],table[role=presentation] th[valign=top]{vertical-align:top}table[role=presentation] td[valign=middle],table[role=presentation] th[valign=middle]{vertical-align:middle}table[role=presentation] td[valign=bottom],table[role=presentation] th[valign=bottom]{vertical-align:bottom}table[role=presentation] td[valign=baseline],table[role=presentation] th[valign=baseline]{vertical-align:baseline}@supports (border-width:attr(border px,0)){table[role=presentation]{--markdown-table-border-width:attr(border px, 0)}table[role=presentation] td,table[role=presentation] th{vertical-align:attr(valign,middle)}}table[role=presentation][border="0"]{--markdown-table-border-width:0}table[role=presentation][border="1"]{--markdown-table-border-width:1px}table[role=presentation][border="2"]{--markdown-table-border-width:2px}table[role=presentation][border="3"]{--markdown-table-border-width:3px}table{border-collapse:var(--markdown-table-border-collapse,collapse)}div:has(> table){overflow:auto}th{text-align:var(--markdown-table-text-align,start)}td,th{border-width:var(--markdown-table-border-width,1px);border-style:var(--markdown-table-border-style,solid);border-color:var(--markdown-table-border-color,var(--divider-color));padding-inline:var(--markdown-table-padding-inline,0.5em);padding-block:var(--markdown-table-padding-block,0.25em)}blockquote{border-left:4px solid var(--divider-color);margin-inline:0;padding-inline:1em}`)),(0,o.Cg)([(0,r.MZ)()],d.prototype,"content",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"allow-svg",type:Boolean})],d.prototype,"allowSvg",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"allow-data-url",type:Boolean})],d.prototype,"allowDataUrl",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],d.prototype,"breaks",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"lazy-images"})],d.prototype,"lazyImages",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],d.prototype,"cache",void 0),(0,o.Cg)([(0,r.P)("ha-markdown-element")],d.prototype,"_markdownElement",void 0),d=(0,o.Cg)([(0,r.EM)("ha-markdown")],d)},59992:function(e,t,a){"use strict";a.a(e,async function(e,o){try{a.d(t,{V:function(){return g}});a(62953);var i=a(40445),r=a(88696),s=a(5124),l=a(6412),n=a(67576),d=e([r]);r=(d.then?(await d)():d)[0];let h,c,p=e=>e;const u=e=>void 0===e?[]:Array.isArray(e)?e:[e],g=e=>{class t extends e{get scrollableElement(){return t.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(e){var t;null===(t=super.firstUpdated)||void 0===t||t.call(this,e),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(e){var t;null===(t=super.updated)||void 0===t||t.call(this,e),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(e=!1){return(0,s.qy)(h||(h=p` <div class="${0}"></div> <div class="${0}"></div> `),(0,l.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled}),(0,l.H)({"fade-bottom":!0,rounded:e,visible:this._contentScrollable}))}static get styles(){var e;const t=Object.getPrototypeOf(this);return[...u(null!==(e=null==t?void 0:t.styles)&&void 0!==e?e:[]),(0,s.AH)(c||(c=p`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`))]}_attachScrollableElement(){const e=this.scrollableElement;e!==this._scrollTarget&&(this._detachScrollableElement(),e&&(this._scrollTarget=e,e.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(e),this._updateScrollableState(e)))}_detachScrollableElement(){var e,t;this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),null===(e=(t=this._resize).unobserve)||void 0===e||e.call(t,this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(e){const t=parseFloat(getComputedStyle(e).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:o=0,scrollTop:i=0}=e;this._contentScrollable=a-o>i+t+this.scrollFadeSafeAreaPadding}constructor(...e){super(...e),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=e=>{var t;const a=e.currentTarget;this._contentScrolled=(null!==(t=a.scrollTop)&&void 0!==t?t:0)>this.scrollFadeThreshold,this._updateScrollableState(a)},this._resize=new r.P(this,{target:null,callback:e=>{var t;const a=null===(t=e[0])||void 0===t?void 0:t.target;a&&this._updateScrollableState(a)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return t.DEFAULT_SCROLLABLE_ELEMENT=null,(0,i.Cg)([(0,n.wk)()],t.prototype,"_contentScrolled",void 0),(0,i.Cg)([(0,n.wk)()],t.prototype,"_contentScrollable",void 0),t};o()}catch(h){o(h)}})},24367:function(e,t,a){"use strict";a.d(t,{L:function(){return i},z:function(){return r}});var o=a(23832);const i=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],r=(0,o.g)(i)},15056:function(e,t,a){"use strict";a.a(e,async function(e,o){try{a.r(t);a(89463),a(74423),a(42762),a(62953);var i=a(40445),r=a(5124),s=a(63672),l=a(67576),n=a(18350),d=(a(93444),a(72554)),h=a(52763),c=(a(3587),a(65829)),p=a(82e3),u=a(14503),g=e([n,d,h,c]);[n,d,h,c]=g.then?(await g)():g;let v,m,b,f,w,_,y,k,x,C=e=>e,S=0;class $ extends r.WF{showDialog({continueFlowId:e,mfaModuleId:t,dialogClosedCallback:a}){this._instance=S++,this._dialogClosedCallback=a,this._open=!0;const o=e?this.hass.callWS({type:"auth/setup_mfa",flow_id:e}):this.hass.callWS({type:"auth/setup_mfa",mfa_module_id:t}),i=this._instance;o.then(e=>{i===this._instance&&this._processStep(e)})}closeDialog(){this._open=!1}_dialogClosed(){this._step?this._flowDone():this._resetDialogState()}render(){var e,t,a,o;return void 0===this._instance?r.s6:(0,r.qy)(v||(v=C` <ha-dialog .open="${0}" prevent-scrim-close header-title="${0}" @closed="${0}"> <div> ${0} ${0} </div> <ha-dialog-footer slot="footer"> <ha-button slot="${0}" appearance="${0}" @click="${0}">${0}</ha-button> ${0} </ha-dialog-footer> </ha-dialog> `),this._open,this._computeStepTitle(),this._dialogClosed,this._errorMessage?(0,r.qy)(m||(m=C`<div class="error">${0}</div>`),this._errorMessage):"",this._step?(0,r.qy)(f||(f=C`${0}`),"abort"===this._step.type?(0,r.qy)(w||(w=C` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown>`),this.hass.localize(`component.auth.mfa_setup.${this._step.handler}.abort.${this._step.reason}`)):"create_entry"===this._step.type?(0,r.qy)(_||(_=C`<p> ${0} </p>`),this.hass.localize("ui.panel.profile.mfa_setup.step_done",{step:this._step.title||this._step.handler})):"form"===this._step.type?(0,r.qy)(y||(y=C`<ha-markdown allow-svg breaks .content="${0}"></ha-markdown> <ha-form autofocus .hass="${0}" .data="${0}" .schema="${0}" .error="${0}" .computeLabel="${0}" .computeError="${0}" @value-changed="${0}"></ha-form>`),this.hass.localize(`component.auth.mfa_setup.${this._step.handler}.step.${this._step.step_id}.description`,this._step.description_placeholders),this.hass,this._stepData,(0,p.Hg)(this._step.data_schema),this._step.errors,this._computeLabel,this._computeError,this._stepDataChanged):""):(0,r.qy)(b||(b=C`<div class="init-spinner"> <ha-spinner></ha-spinner> </div>`)),"form"===(null===(e=this._step)||void 0===e?void 0:e.type)?"secondaryAction":"primaryAction",(0,s.J)("form"===(null===(t=this._step)||void 0===t?void 0:t.type)?"plain":void 0),this.closeDialog,this.hass.localize(["abort","create_entry"].includes((null===(a=this._step)||void 0===a?void 0:a.type)||"")?"ui.panel.profile.mfa_setup.close":"ui.common.cancel"),"form"===(null===(o=this._step)||void 0===o?void 0:o.type)?(0,r.qy)(k||(k=C`<ha-button slot="primaryAction" .disabled="${0}" @click="${0}">${0}</ha-button>`),this._isSubmitDisabled(),this._submitStep,this.hass.localize("ui.panel.profile.mfa_setup.submit")):r.s6)}static get styles(){return[u.nA,(0,r.AH)(x||(x=C`.error{color:red}ha-markdown{--markdown-svg-background-color:white;--markdown-svg-color:black;display:block;margin:0 auto}ha-markdown a{color:var(--primary-color)}ha-markdown-element p{text-align:center}ha-markdown-element svg{display:block;margin:0 auto}ha-markdown-element code{background-color:transparent}ha-form{display:block;margin-top:var(--ha-space-4)}ha-markdown-element>:last-child{margin-bottom:revert}.init-spinner{padding:10px 100px 34px;text-align:center}`))]}firstUpdated(e){super.firstUpdated(e),this.hass.loadBackendTranslation("mfa_setup","auth"),this.addEventListener("keypress",e=>{"Enter"===e.key&&this._submitStep()})}_stepDataChanged(e){this._stepData=e.detail.value}_submitStep(){if(this._isSubmitDisabled())return;this._loading=!0,this._errorMessage=void 0;const e=this._instance;this.hass.callWS({type:"auth/setup_mfa",flow_id:this._step.flow_id,user_input:this._stepData}).then(t=>{e===this._instance&&(this._processStep(t),this._loading=!1)},e=>{this._errorMessage=e&&e.body&&e.body.message||"Unknown error occurred",this._loading=!1})}_isSubmitDisabled(){return this._loading||this._hasMissingRequiredFields()}_hasMissingRequiredFields(e=("form"===(e=>null===(e=this._step)||void 0===e?void 0:e.type)()?this._step.data_schema:[])){for(const a of e){var t;if("schema"in a){if(this._hasMissingRequiredFields(a.schema))return!0}else if(a.required&&void 0===a.default&&void 0===(null===(t=a.description)||void 0===t?void 0:t.suggested_value)&&this._isEmptyValue(this._stepData[a.name]))return!0}return!1}_isEmptyValue(e){return null==e||("string"==typeof e?""===e.trim():Array.isArray(e)?0===e.length:"object"==typeof e&&0===Object.keys(e).length)}_processStep(e){e.errors||(e.errors={}),this._step=e,0===Object.keys(e.errors).length&&(this._stepData={})}_flowDone(){const e=Boolean(this._step&&["create_entry","abort"].includes(this._step.type));this._dialogClosedCallback({flowFinished:e}),this._resetDialogState()}_resetDialogState(){this._errorMessage=void 0,this._step=void 0,this._stepData={},this._dialogClosedCallback=void 0,this._instance=void 0}_computeStepTitle(){var e,t,a;return"abort"===(null===(e=this._step)||void 0===e?void 0:e.type)?this.hass.localize("ui.panel.profile.mfa_setup.title_aborted"):"create_entry"===(null===(t=this._step)||void 0===t?void 0:t.type)?this.hass.localize("ui.panel.profile.mfa_setup.title_success"):"form"===(null===(a=this._step)||void 0===a?void 0:a.type)?this.hass.localize(`component.auth.mfa_setup.${this._step.handler}.step.${this._step.step_id}.title`):""}constructor(...e){super(...e),this._loading=!1,this._open=!1,this._stepData={},this._computeLabel=e=>this.hass.localize(`component.auth.mfa_setup.${this._step.handler}.step.${this._step.step_id}.data.${e.name}`)||e.name,this._computeError=e=>this.hass.localize(`component.auth.mfa_setup.${this._step.handler}.error.${e}`)||e}}(0,i.Cg)([(0,l.MZ)({attribute:!1})],$.prototype,"hass",void 0),(0,i.Cg)([(0,l.wk)()],$.prototype,"_dialogClosedCallback",void 0),(0,i.Cg)([(0,l.wk)()],$.prototype,"_instance",void 0),(0,i.Cg)([(0,l.wk)()],$.prototype,"_loading",void 0),(0,i.Cg)([(0,l.wk)()],$.prototype,"_open",void 0),(0,i.Cg)([(0,l.wk)()],$.prototype,"_stepData",void 0),(0,i.Cg)([(0,l.wk)()],$.prototype,"_step",void 0),(0,i.Cg)([(0,l.wk)()],$.prototype,"_errorMessage",void 0),$=(0,i.Cg)([(0,l.EM)("ha-mfa-module-setup-flow")],$),o()}catch(v){o(v)}})},996:function(e,t,a){"use strict";a.d(t,{G:function(){return o}});a(45367),a(92731),a(62953);class o{get(e){return this._cache.get(e)}set(e,t){this._cache.set(e,t),this._expiration&&window.setTimeout(()=>this._cache.delete(e),this._expiration)}has(e){return this._cache.has(e)}constructor(e){this._cache=new Map,this._expiration=e}}},22348:function(e,t,a){"use strict";a.d(t,{V:function(){return i}});var o=a(37177);const i=e=>!!e&&o.n},37177:function(e,t,a){"use strict";a.d(t,{n:function(){return o}});a(27495);const o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},46571:function(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=function(){return[]},t.resolve=t,t.id=46571,e.exports=t},62003:function(e,t,a){var o={"./ha-icon-prev":["89133",[61982]],"./ha-icon-button-toolbar":["9882",[39763,41983]],"./ha-alert":["38962",[19695]],"./ha-icon-button-toggle":["62501",[77254]],"./ha-svg-icon.ts":["67094",[]],"./ha-alert.ts":["38962",[19695]],"./ha-icon":["47680",[44889]],"./ha-icon-next.ts":["43661",[63902]],"./ha-qr-code.ts":["60543",[51343,62740]],"./ha-icon-overflow-menu.ts":["75248",[39763,34995,78097]],"./ha-icon-button-toggle.ts":["62501",[77254]],"./ha-icon-button-group":["39826",[13647]],"./ha-svg-icon":["67094",[]],"./ha-icon-button-prev":["45100",[99197]],"./ha-icon-button.ts":["26300",[]],"./ha-icon-overflow-menu":["75248",[39763,34995,78097]],"./ha-icon-button-arrow-next":["99028",[54101]],"./ha-icon-button-prev.ts":["45100",[99197]],"./ha-icon-picker":["64138",[39763,32450,46095,7305,92769,3283,62574,26092,39005,32301]],"./ha-icon-button-toolbar.ts":["9882",[39763,41983]],"./ha-icon-button-arrow-prev.ts":["90248",[17041]],"./ha-icon-button-next":["3059",[81049]],"./ha-icon-next":["43661",[63902]],"./ha-icon-picker.ts":["64138",[39763,32450,46095,7305,92769,3283,62574,26092,39005,32301]],"./ha-icon-prev.ts":["89133",[61982]],"./ha-icon-button-arrow-prev":["90248",[17041]],"./ha-icon-button-next.ts":["3059",[81049]],"./ha-icon.ts":["47680",[44889]],"./ha-qr-code":["60543",[51343,62740]],"./ha-icon-button":["26300",[]],"./ha-icon-button-group.ts":["39826",[13647]],"./ha-icon-button-arrow-next.ts":["99028",[54101]]};function i(e){if(!a.o(o,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=o[e],i=t[0];return Promise.all(t[1].map(a.e)).then(function(){return a(i)})}i.keys=function(){return Object.keys(o)},i.id=62003,e.exports=i}}]);