UNPKG

iobroker.lovelace

Version:

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

7 lines 55.4 kB
export const __rspack_esm_id=87785;export const __rspack_esm_ids=[87785];export const __webpack_modules__={60353(e,t,a){a.d(t,{u:()=>i});class i{start(e){const t=Date.now();this._startY=e,this._startTime=t,this._lastY=e,this._lastTime=t,this._delta=0}move(e){const t=Date.now();return this._delta=this._startY-e,this._lastY=e,this._lastTime=t,this._delta}end(){const e=this.getVelocity(),t=Math.abs(e)>this._velocityThreshold;return{velocity:e,delta:this._delta,isSwipe:t,isDownwardSwipe:e>0}}getDelta(){return this._delta}getVelocity(){if(Date.now()-this._lastTime>=this._movementTimeThreshold)return 0;const e=this._lastTime-this._startTime;return e>0?(this._lastY-this._startY)/e:0}reset(){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0}constructor(e={}){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=e.velocitySwipeThreshold??.5,this._movementTimeThreshold=e.movementTimeThreshold??100}}},3109(e,t,a){var i=a(62826),o=a(86137),r=a(22441);class s extends o.A{constructor(){super(),this.play=!0,this.iterations=1,this.fill="both",this.name="fadeIn"}}(0,i.Cg)([(0,r.MZ)({type:Boolean})],s.prototype,"play",void 0),s=(0,i.Cg)([(0,r.EM)("ha-fade-in")],s)},5745(e,t,a){var i=a(62826),o=a(99731),r=a(22441);class s extends o.Y{}s=(0,i.Cg)([(0,r.EM)("ha-chip-set")],s)},38962(e,t,a){a.a(e,async function(e,i){try{a.r(t);var o=a(62826),r=a(5124),s=a(22441),n=a(6412),l=a(93421),d=a(1087),c=a(26300),h=(a(67094),e([c]));c=(h.then?(await h)():h)[0];const p="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={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class u extends r.WF{render(){return r.qy` <div class="issue-type ${(0,n.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${m[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,n.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?r.qy`<div class="title">${this.title}</div>`:r.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?r.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:r.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,d.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}u.styles=r.AH`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`,(0,o.Cg)([(0,s.MZ)()],u.prototype,"title",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"alert-type"})],u.prototype,"alertType",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"dismissable",void 0),(0,o.Cg)([(0,s.wk)(),(0,l.IW)()],u.prototype,"_localize",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"narrow",void 0),u=(0,o.Cg)([(0,s.EM)("ha-alert")],u),i()}catch(e){i(e)}})},99611(e,t,a){a.a(e,async function(e,t){try{a(18111),a(13579),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(62826),o=a(1126),r=a(35211),s=a(5124),n=a(22441),l=a(1087),d=a(60353),c=a(22792),h=a(59992),p=a(14503),m=a(22348),u=e([o]);o=(u.then?(await u)():u)[0];const b=300,g=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),v=new Set(["volume-slider-container","forecast"]);class f extends((0,h.V)(s.WF)){get scrollableElement(){return this._bodyElement}connectedCallback(){super.connectedCallback(),this.addEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.addEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0})}updated(e){super.updated(e),e.has("open")&&(this._drawerOpen=this.open)}render(){return s.qy` <wa-drawer id="drawer" placement="bottom" .open="${this._drawerOpen}" .lightDismiss="${!this.preventScrimClose}" .ariaLabelledby="${this.ariaLabelledBy}" .ariaDescribedby="${this.ariaDescribedBy}" @keydown="${this._handleKeyDown}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-hide="${this._handleHide}" @wa-after-hide="${this._handleAfterHide}" @click="${this._handleCloseAction}" without-header @touchstart="${this._handleTouchStart}"> <div class="handle-wrapper" aria-hidden="true"> <div class="handle"></div> </div> <slot name="header"></slot> <div class="content-wrapper"> <div id="body" class="body ha-scrollbar"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer"></slot> </wa-drawer> `}_startResizing(e){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(e)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${b}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},b)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.removeEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0}),this._unregisterResizeHandlers(),this._isDragging=!1}static get styles(){return[...super.styles,p.dp,s.AH`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${b}ms;--hide-duration:${b}ms}wa-drawer::part(dialog){max-height:min(var(--ha-bottom-sheet-max-height,90vh),calc(100vh - max(var(--safe-area-inset-top),48px)));max-height:min(var(--ha-bottom-sheet-max-height,90dvh),calc(100dvh - max(var(--safe-area-inset-top),48px)));align-items:center;transform:var(--dialog-transform);transition:var(--dialog-transition)}@media (prefers-reduced-motion:reduce){wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:1ms;--hide-duration:1ms}wa-drawer::part(dialog){transition:1ms}}wa-drawer::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));background-color:var(--ha-bottom-sheet-scrim-color,var(--mdc-dialog-scrim-color,none))}wa-drawer::part(body){max-width:var(--ha-bottom-sheet-max-width);width:100%;position:relative;border-top-left-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));border-top-right-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));background-color:var(--ha-bottom-sheet-surface-background,var(--ha-dialog-surface-background,var(--card-background-color,var(--ha-color-surface-default))));-webkit-backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));padding:var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left))}:host([flexcontent]) wa-drawer::part(body){display:flex;flex-direction:column}:host([prevent-scrim-close]) .handle-wrapper{display:none}.handle-wrapper{position:absolute;top:0;inset-inline-start:0;width:100%;padding-bottom:2px;display:flex;justify-content:center;align-items:center;pointer-events:none;z-index:1}.handle-wrapper .handle{height:16px;width:200px;display:flex;justify-content:center;align-items:center}.handle-wrapper .handle::after{content:"";border-radius:var(--ha-border-radius-md);height:4px;background:var(--ha-bottom-sheet-handle-color,var(--divider-color));width:40px}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{padding:var(--ha-bottom-sheet-content-padding,0);box-sizing:border-box}:host([flexcontent]) .body{flex:1;max-width:100%;display:flex;flex-direction:column;padding:var(--ha-bottom-sheet-content-padding,var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)));box-sizing:border-box}slot[name=footer]{display:block;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%;box-sizing:border-box}:host([flexcontent]) slot[name=footer]{flex-shrink:0}`]}constructor(...e){super(...e),this.open=!1,this.flexContent=!1,this.preventScrimClose=!1,this._drawerOpen=!1,this._sliderInteractionActive=!1,this._gestureRecognizer=new d.u,this._isDragging=!1,this._escapePressed=!1,this._handleShow=async()=>{this._drawerOpen=!0,this.open=!0,(0,l.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{const e=this._autofocusElement;this._hassConfig?.auth.external&&(0,m.V)(this._hassConfig.auth.external)?e&&(e.id||(e.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})):e?.focus()})},this._handleAfterShow=()=>{(0,l.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=e=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);e.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,l.r)(this,"closed"))},this._handleHide=e=>{if(e.eventPhase!==Event.AT_TARGET)return;const t=e.detail.source===e.target.drawer;if(this._sliderInteractionActive)return e.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1},this._handleKeyDown=e=>{"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)},this._handleCloseAction=e=>{e.composedPath().some(e=>e instanceof HTMLElement&&("close"===e.getAttribute("data-dialog")||"close"===e.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=e=>{if(this.preventScrimClose)return;const t=e.composedPath();for(const e of t){if(e===this._drawer)break;if(e instanceof HTMLElement&&(e.scrollTop>0||g.has(e.localName)||Array.from(e.classList).some(e=>v.has(e))))return}e.stopPropagation(),this._startResizing(e.touches[0].clientY)},this._handleTouchMove=e=>{const t=e.touches[0].clientY,a=this._gestureRecognizer.move(t);a<0&&(e.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*a}px)`)}))},this._handleTouchEnd=()=>{this._unregisterResizeHandlers(),this._isDragging=!1;const e=this._gestureRecognizer.end();if(e.isSwipe)return void(e.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const t=this._drawer.shadowRoot?.querySelector('[part="body"]'),a=t?.offsetHeight||0;a>0&&e.delta<0&&Math.abs(e.delta)>.5*a?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,i.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],f.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],f.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],f.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],f.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],f.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_drawerOpen",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_sliderInteractionActive",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],f.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.P)("#drawer")],f.prototype,"_drawer",void 0),(0,i.Cg)([(0,n.P)("#body")],f.prototype,"_bodyElement",void 0),(0,i.Cg)([(0,n.P)("[autofocus]")],f.prototype,"_autofocusElement",void 0),f=(0,i.Cg)([(0,n.EM)("ha-bottom-sheet")],f),t()}catch(e){t(e)}})},38508(e,t,a){a.a(e,async function(e,t){try{a(18111),a(13579);var i=a(62826),o=a(61366),r=a(35211),s=a(5124),n=a(22441),l=a(63672),d=a(91335),c=a(1087),h=a(22792),p=a(17894),m=a(22348),u=a(99611),b=a(18350),g=(a(75064),a(3449),a(49639)),v=a(88285),f=(a(67094),e([o,u,b,g,v]));[o,u,b,g,v]=f.then?(await f)():f;const _="M3 16H10V14H3M18 14V10H16V14H12V16H16V20H18V16H22V14M14 6H3V8H14M14 10H3V12H14V10Z";class y extends((0,p.c)(s.WF)){willUpdate(e){e.has("value")&&this._setUnknownValue()}setFieldValue(e){this._comboBox?this._comboBox.setFieldValue(e):this._initialFieldValue=e}render(){const e=this.useTopLabel&&this.value?void 0:this.label;return s.qy`<div class="container"> ${this.useTopLabel&&this.label?s.qy`<label ?disabled="${this.disabled}">${this.label}</label>`:s.s6} <div id="picker"> <slot name="field"> ${this.addButtonLabel&&!this.value?s.qy`<ha-button size="small" appearance="filled" @click="${this.open}" .disabled="${this.disabled}"> <ha-svg-icon .path="${_}" slot="start"></ha-svg-icon> ${this.addButtonLabel} </ha-button>`:s.qy`<ha-picker-field type="button" class="${this._opened?"opened":""}" compact="compact" .unknown="${this._unknownValue}" .unknownItemText="${this.unknownItemText}" aria-label="${(0,l.J)(this.label)}" @click="${this.open}" @clear="${this._clear}" .icon="${this.icon}" .image="${this.image}" .label="${e}" .placeholder="${this.placeholder}" .value="${this.value}" .valueRenderer="${this.valueRenderer}" .required="${this.required}" .disabled="${this.disabled}" .invalid="${this.invalid}" .hideClearIcon="${this.hideClearIcon}"> <slot name="start"></slot> </ha-picker-field>`} </slot> </div> ${this._pickerWrapperOpen||this._opened?this._openedNarrow?s.qy` <ha-bottom-sheet flexcontent .open="${this._pickerWrapperOpen}" @wa-after-show="${this._dialogOpened}" @closed="${this._hidePicker}" role="dialog" aria-modal="true" aria-label="${this.label||"Select option"}"> ${this._renderComboBox(!0)} </ha-bottom-sheet> `:s.qy` <wa-popover .open="${this._pickerWrapperOpen}" style="--body-width:${this._popoverWidth}px" without-arrow distance="-4" .placement="${this.popoverPlacement}" .for="${this.popoverAnchor?null:"picker"}" .anchor="${this.popoverAnchor??null}" auto-size="vertical" auto-size-padding="16" @wa-after-show="${this._dialogOpened}" @wa-after-hide="${this._hidePicker}" trap-focus role="dialog" aria-modal="true" aria-label="${this.label||"Select option"}"> ${this._renderComboBox()} </wa-popover> `:s.s6} </div> ${this._renderHelper()}`}_renderComboBox(e=!1){return this._opened?s.qy` <ha-picker-combo-box id="combo-box" .allowCustomValue="${this.allowCustomValue}" .label="${this.searchLabel}" .value="${this._selectedValue??this.value}" @value-changed="${this._valueChanged}" .rowRenderer="${this.rowRenderer}" .notFoundLabel="${this.notFoundLabel}" .emptyLabel="${this.emptyLabel}" .getItems="${this.getItems}" .getAdditionalItems="${this.getAdditionalItems}" .searchFn="${this.searchFn}" .mode="${e?"dialog":"popover"}" .sections="${this.sections}" .sectionTitleFunction="${this.sectionTitleFunction}" .selectedSection="${this.selectedSection}" .searchKeys="${this.searchKeys}" .customValueLabel="${this.customValueLabel}" .noSort="${this.noSort}"></ha-picker-combo-box> `:s.s6}_renderHelper(){const e=this.invalid&&this.errorMessage,t=!e&&this.helper;return e||t?s.qy`<ha-input-helper-text .disabled="${this.disabled}"> ${e?this.errorMessage:this.helper} </ha-input-helper-text>`:s.s6}refreshItems(){this._comboBox?.refreshItems()}_hidePicker(e){e.stopPropagation(),this._newValue&&((0,c.r)(this,"value-changed",{value:this._newValue}),this._newValue=void 0),this._opened=!1,this._pickerWrapperOpen=!1,this._selectedValue=void 0,this._unsubscribeTinyKeys?.(),(0,c.r)(this,"picker-closed")}_valueChanged(e){e.stopPropagation();const t=e.detail.value;t&&(this._pickerWrapperOpen=!1,this._newValue=t)}_clear(e){e.stopPropagation(),this._setValue(void 0)}_setValue(e){this.value=e,(0,c.r)(this,"value-changed",{value:e})}async open(e,t){e?.stopPropagation(),this.disabled||(this._selectedValue=t?.selectedValue,this._openedNarrow=this._narrow,this._popoverWidth=this._containerElement?.offsetWidth||250,this._pickerWrapperOpen=!0,this._unsubscribeTinyKeys=(0,d.Tc)(this,{Escape:this._handleEscClose}))}connectedCallback(){super.connectedCallback(),this._handleResize(),window.addEventListener("resize",this._handleResize)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._handleResize),this._unsubscribeTinyKeys?.()}static get styles(){return[s.AH`.container{position:relative;display:block;max-width:100%}label[disabled]{color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}label{display:block;margin:0 0 8px}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}:host([invalid]) ha-input-helper-text{color:var(--mdc-theme-error,var(--error-color,#b00020))}wa-popover{--wa-space-l:0}wa-popover::part(dialog)::backdrop{background:0 0}wa-popover::part(body){width:var(--ha-generic-picker-width,max(var(--body-width),250px));max-width:var(--ha-generic-picker-max-width,var(--ha-generic-picker-width,max(var(--body-width),250px)));max-height:500px;height:70vh;overflow:hidden}@media (max-height:1000px){wa-popover::part(body){max-height:400px}}ha-bottom-sheet{--ha-bottom-sheet-height:90vh;--ha-bottom-sheet-height:calc(100dvh - var(--ha-space-12));--ha-bottom-sheet-max-height:var(--ha-bottom-sheet-height);--ha-bottom-sheet-max-width:600px;--ha-bottom-sheet-padding:0;--ha-bottom-sheet-surface-background:var(--card-background-color);--ha-bottom-sheet-border-radius:var(--ha-border-radius-2xl);--ha-bottom-sheet-content-padding:0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}`]}constructor(...e){super(...e),this.popoverPlacement="bottom",this.useTopLabel=!1,this.noSort=!1,this._opened=!1,this._pickerWrapperOpen=!1,this._popoverWidth=0,this._openedNarrow=!1,this._unknownValue=!1,this._narrow=!1,this.invalid=!1,this._setUnknownValue=()=>{const e=this.getItems();!this.allowCustomValue&&void 0!==this.value&&null!==this.value&&""!==this.value&&e?this._unknownValue=!e.some(e=>"string"!=typeof e&&e.id===this.value):this._unknownValue=!1},this._dialogOpened=()=>{this._opened=!0,(0,c.r)(this,"picker-opened"),requestAnimationFrame(()=>{this._initialFieldValue&&(this._comboBox?.setFieldValue(this._initialFieldValue),this._initialFieldValue=void 0),this._hassConfig?.auth.external&&(0,m.V)(this._hassConfig.auth.external)?this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:"combo-box"}}):this._comboBox?.focus()})},this._handleResize=()=>{this._narrow=window.matchMedia("(max-width: 870px)").matches||window.matchMedia("(max-height: 500px)").matches,!this._openedNarrow&&this._pickerWrapperOpen&&(this._popoverWidth=this._containerElement?.offsetWidth||250)},this._handleEscClose=e=>{e.stopPropagation()}}}y.shadowRootOptions={...s.WF.shadowRootOptions,delegatesFocus:!0},(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"allow-custom-value"})],y.prototype,"allowCustomValue",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"search-label"})],y.prototype,"searchLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"getItems",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"getAdditionalItems",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"rowRenderer",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"searchFn",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"searchKeys",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"notFoundLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"empty-label"})],y.prototype,"emptyLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"popover-placement"})],y.prototype,"popoverPlacement",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"add-button-label"})],y.prototype,"addButtonLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"sections",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"sectionTitleFunction",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"selected-section"})],y.prototype,"selectedSection",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"popoverAnchor",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"use-top-label"})],y.prototype,"useTopLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"custom-value-label"})],y.prototype,"customValueLabel",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-sort"})],y.prototype,"noSort",void 0),(0,i.Cg)([(0,n.P)(".container")],y.prototype,"_containerElement",void 0),(0,i.Cg)([(0,n.P)("ha-picker-combo-box")],y.prototype,"_comboBox",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:h.WF,subscribe:!0})],y.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_opened",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_pickerWrapperOpen",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_popoverWidth",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_openedNarrow",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_unknownValue",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_selectedValue",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"error-message"})],y.prototype,"errorMessage",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],y.prototype,"invalid",void 0),y=(0,i.Cg)([(0,n.EM)("ha-generic-picker")],y),t()}catch(e){t(e)}})},47680(e,t,a){a.r(t),a.d(t,{HaIcon:()=>k});a(74423);var i=a(62826),o=a(5124),r=a(22441),s=a(1087),n=a(9899),l=a(700),d=(a(44114),a(18111),a(7588),a(95192)),c=a(7553);const h=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}');let p;const m=()=>(p||(p=u().catch(e=>{throw p=void 0,e})),p),u=async()=>{const e=(0,d.y$)("hass-icon-db","mdi-icon-store"),t=await(0,d.Jt)("_version",e);return t?t!==h.version&&(await(0,d.IU)(e),(0,d.hZ)("_version",h.version,e)):(0,d.hZ)("_version",h.version,e),e},b=["mdi","hass","hassio","hademo"];let g=[];a(67094);const v={},f={},_=(0,n.s)(()=>(async e=>{const t=Object.keys(e),a=await Promise.allSettled(Object.values(e));(await m())("readwrite",i=>{a.forEach((a,o)=>{"fulfilled"===a.status&&Object.entries(a.value).forEach(([e,t])=>{i.put(t,e)}),delete e[t[o]]})})})(f),2e3),y={},w={"home-assistant":()=>a.e(58781).then(a.bind(a,53580)).then(e=>e.mdiHomeAssistant),"music-assistant":()=>a.e(56009).then(a.bind(a,10576)).then(e=>e.mdiMusicAssistant),esphome:()=>a.e(88800).then(a.bind(a,45091)).then(e=>e.mdiEsphomeLogo)};class k extends o.WF{willUpdate(e){super.willUpdate(e),e.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}render(){return this.icon?this._legacy?o.qy` <iron-icon .icon="${this.icon}"></iron-icon>`:o.qy`<ha-svg-icon .path="${this._path}" .secondaryPath="${this._secondaryPath}" .viewBox="${this._viewBox}"></ha-svg-icon>`:o.s6}async _loadIcon(){if(!this.icon)return;const e=this.icon,[t,a]=this.icon.split(":",2);let i,o=a;if(!t||!o)return;if(!b.includes(t)){const a=l.y[t];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(o),e)):void(this._legacy=!0)}if(this._legacy=!1,o in v){const e=v[o];let a;e.newName?(a=`Icon ${t}:${o} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,o=e.newName):a=`Icon ${t}:${o} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${e.removeIn}.`,console.warn(a),(0,s.r)(this,"write_log",{level:"warning",message:a})}if(o in y)return void(this._path=y[o]);if(o in w){const t=await w[o]();return this.icon===e&&(this._path=t),void(y[o]=t)}try{i=await(e=>new Promise((t,a)=>{if(g.push([e,t,a]),g.length>1)return;const i=m();(0,c.h)(1e3,(async()=>{(await i)("readonly",e=>{for(const[t,a,i]of g)(0,d.Yd)(e.get(t)).then(e=>a(e)).catch(e=>i(e));g=[]})})()).catch(e=>{for(const[,,t]of g)t(e);g=[]})}))(o)}catch(e){i=void 0}if(i)return this.icon===e&&(this._path=i),void(y[o]=i);const r=(e=>{let t;for(const a of h.parts){if(void 0!==a.start&&e<a.start)break;t=a}return t.file})(o);if(r in f)return void this._setPath(f[r],o,e);const n=fetch(`/static/mdi/${r}.json`).then(e=>e.json());f[r]=n,this._setPath(n,o,e),n.catch(()=>{delete f[r]}),_()}async _setCustomPath(e,t){const a=await e;this.icon===t&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}async _setPath(e,t,a){try{const i=await e;this.icon===a&&(this._path=i[t]),y[t]=i[t]}catch(e){}}constructor(...e){super(...e),this._legacy=!1}}k.styles=o.AH`:host{fill:currentcolor}`,(0,i.Cg)([(0,r.MZ)()],k.prototype,"icon",void 0),(0,i.Cg)([(0,r.wk)()],k.prototype,"_path",void 0),(0,i.Cg)([(0,r.wk)()],k.prototype,"_secondaryPath",void 0),(0,i.Cg)([(0,r.wk)()],k.prototype,"_viewBox",void 0),(0,i.Cg)([(0,r.wk)()],k.prototype,"_legacy",void 0),k=(0,i.Cg)([(0,r.EM)("ha-icon")],k)},3449(e,t,a){var i=a(62826),o=a(5124),r=a(22441);class s extends o.WF{render(){return o.qy`<slot></slot>`}constructor(...e){super(...e),this.disabled=!1}}s.styles=o.AH`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:var(--ha-font-size-s);padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px;letter-spacing:var(
        --mdc-typography-caption-letter-spacing,
        .0333333333em
      );line-height:normal}:host([disabled]){color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}`,(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],s.prototype,"disabled",void 0),s=(0,i.Cg)([(0,r.EM)("ha-input-helper-text")],s)},38377(e,t,a){a(74423),a(18111),a(22489),a(61701),a(18237);var i=a(62826),o=a(5124),r=a(22441),s=a(20889),n=a(30015),l=a.n(n),d=a(1087),c=(a(14603),a(47566),a(98721),a(2209));let h;var p=a(996);const m=e=>o.qy`${e}`,u=new p.G(1e3),b={reType:/(?<input>(\[!(?<type>caution|important|note|tip|warning)\])(?:\s|\\n)?)/i,typeToHaAlert:{caution:"error",important:"info",note:"info",tip:"success",warning:"warning"}};class g extends o.mN{disconnectedCallback(){if(super.disconnectedCallback(),this.cache){const e=this._computeCacheKey();u.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();u.has(e)&&((0,o.XX)(m((0,s._)(u.get(e))),this.renderRoot),this._resize())}}_computeCacheKey(){return l()({content:this.content,allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl,breaks:this.breaks})}async _render(){const e=await(async(e,t,i)=>(h||(h=(0,c.LV)(new Worker(new URL(a.p+a.u(55640),a.b)))),h.renderMarkdown(e,t,i)))(String(this.content),{breaks:this.breaks,gfm:!0},{allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl});(0,o.XX)(m((0,s._)(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){const a=e.firstElementChild?.firstChild?.textContent&&b.reType.exec(e.firstElementChild.firstChild.textContent);if(a){const{type:i}=a.groups,o=document.createElement("ha-alert");o.alertType=b.typeToHaAlert[i.toLowerCase()],o.append(...Array.from(e.childNodes).map(e=>{const t=Array.from(e.childNodes);if(!this.breaks&&t.length){const e=t[0];e.nodeType===Node.TEXT_NODE&&e.textContent===a.input&&e.textContent?.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(o,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,d.r)(this,"content-resize")}}(0,i.Cg)([(0,r.MZ)()],g.prototype,"content",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"allow-svg",type:Boolean})],g.prototype,"allowSvg",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"allow-data-url",type:Boolean})],g.prototype,"allowDataUrl",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"breaks",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"lazy-images"})],g.prototype,"lazyImages",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"cache",void 0),g=(0,i.Cg)([(0,r.EM)("ha-markdown-element")],g)},3587(e,t,a){var i=a(62826),o=a(5124),r=a(22441);a(38377);class s extends o.WF{async getUpdateComplete(){const e=await super.getUpdateComplete();return await(this._markdownElement?.updateComplete),e}render(){return this.content?o.qy`<ha-markdown-element .content="${this.content}" .allowSvg="${this.allowSvg}" .allowDataUrl="${this.allowDataUrl}" .breaks="${this.breaks}" .lazyImages="${this.lazyImages}" .cache="${this.cache}"></ha-markdown-element>`:o.s6}constructor(...e){super(...e),this.allowSvg=!1,this.allowDataUrl=!1,this.breaks=!1,this.lazyImages=!1,this.cache=!1}}s.styles=o.AH`: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,i.Cg)([(0,r.MZ)()],s.prototype,"content",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"allow-svg",type:Boolean})],s.prototype,"allowSvg",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"allow-data-url",type:Boolean})],s.prototype,"allowDataUrl",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],s.prototype,"breaks",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"lazy-images"})],s.prototype,"lazyImages",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],s.prototype,"cache",void 0),(0,i.Cg)([(0,r.P)("ha-markdown-element")],s.prototype,"_markdownElement",void 0),s=(0,i.Cg)([(0,r.EM)("ha-markdown")],s)},88285(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),o=a(35211),r=a(5124),s=a(22441),n=a(63672),l=a(1087),d=a(22792),c=a(17894),h=(a(75064),a(47680),a(26300)),p=e([h]);h=(p.then?(await p)():p)[0];const m="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",u="M7,10L12,15L17,10H7Z";class b extends((0,c.c)(r.WF)){async focus(){await this.updateComplete,await(this.item?.focus())}render(){const e=!!this.value,t=!(!this.value||this.required||this.disabled||this.hideClearIcon),a=this.placeholder??this.label,i=this.label&&e?r.qy`<span slot="overline">${this.label}${this.required?" *":""}</span>`:r.s6,o=e?this.valueRenderer?this.valueRenderer(this.value??""):r.qy`<span slot="headline">${this.value}</span>`:a?r.qy`<span slot="headline" class="placeholder"> ${a}${this.required?" *":""} </span>`:r.s6;return r.qy` <ha-combo-box-item aria-label="${(0,n.J)(this.label||this.placeholder)}" .disabled="${this.disabled}" type="button" compact="compact"> ${this.image?r.qy`<img alt="${this.label??""}" slot="start" .src="${this.image}" crossorigin="anonymous" referrerpolicy="no-referrer">`:this.icon?r.qy`<ha-icon slot="start" .icon="${this.icon}"></ha-icon>`:r.qy`<slot name="start"></slot>`} ${i}${o} ${this.unknown?r.qy`<div slot="supporting-text" class="unknown"> ${this.unknownItemText||this._i18n?.localize("ui.components.combo-box.unknown_item")} </div>`:r.s6} ${t?r.qy` <ha-icon-button class="clear" slot="end" @click="${this._clear}" .path="${m}"></ha-icon-button> `:r.s6} <ha-svg-icon class="arrow" slot="end" .path="${u}"></ha-svg-icon> </ha-combo-box-item> `}_clear(e){e.stopPropagation(),(0,l.r)(this,"clear")}static get styles(){return[r.AH`ha-combo-box-item[disabled]{background-color:var(--ha-color-form-background-disabled);--md-list-item-disabled-opacity:0.5;opacity:.5;cursor:not-allowed}ha-combo-box-item{position:relative;background-color:var(--ha-color-form-background);border-radius:var(--ha-border-radius-sm);border-end-end-radius:0;border-end-start-radius:0;--md-list-item-one-line-container-height:56px;--md-list-item-two-line-container-height:56px;--md-list-item-top-space:0px;--md-list-item-bottom-space:0px;--md-list-item-leading-space:var(--ha-space-4);--md-list-item-trailing-space:var(--ha-space-2);--ha-md-list-item-gap:var(--ha-space-2);--md-focus-ring-width:0px;--md-focus-ring-duration:0s}ha-combo-box-item:after{display:block;content:"";position:absolute;pointer-events:none;bottom:0;left:0;right:0;height:1px;width:100%;background-color:var(--ha-color-border-neutral-loud);transform:height 180ms ease-in-out,background-color 180ms ease-in-out}ha-combo-box-item:focus:after{height:2px;background-color:var(--mdc-theme-primary)}:host([unknown]) ha-combo-box-item{background-color:var(--ha-color-fill-warning-quiet-resting)}:host([invalid]) ha-combo-box-item:after{height:2px;background-color:var(--mdc-theme-error,var(--error-color,#b00020))}.clear{margin:0 -8px;--ha-icon-button-size:32px;--ha-icon-button-padding-inline:var(--ha-space-1)}.arrow{--mdc-icon-size:20px;width:32px}.placeholder{color:var(--secondary-text-color)}:host([invalid]) .placeholder{color:var(--mdc-theme-error,var(--error-color,#b00020))}.unknown{color:var(--ha-color-on-warning-normal)}`]}constructor(...e){super(...e),this.invalid=!1}}(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],b.prototype,"invalid",void 0),(0,i.Cg)([(0,s.P)("ha-combo-box-item",!0)],b.prototype,"item",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:d.D5,subscribe:!0})],b.prototype,"_i18n",void 0),b=(0,i.Cg)([(0,s.EM)("ha-picker-field")],b),t()}catch(e){t(e)}})},65829(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HaSpinner:()=>d});var o=a(62826),r=a(55262),s=a(5124),n=a(22441),l=e([r]);r=(l.then?(await l)():l)[0];class d extends r.A{updated(e){if(super.updated(e),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[r.A.styles,s.AH`:host{--indicator-color:var(
            --ha-spinner-indicator-color,
            var(--primary-color)
          );--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`]}}(0,o.Cg)([(0,n.MZ)()],d.prototype,"size",void 0),d=(0,o.Cg)([(0,n.EM)("ha-spinner")],d),i()}catch(e){i(e)}})},76944(e,t,a){a.d(t,{MV:()=>s,VR:()=>r,d8:()=>i,jJ:()=>n,l3:()=>o});const i=async e=>e.callWS({type:"application_credentials/config"}),o=async(e,t)=>e.callWS({type:"application_credentials/config_entry",config_entry_id:t}),r=async e=>e.callWS({type:"application_credentials/list"}),s=async(e,t,a,i,o)=>e.callWS({type:"application_credentials/create",domain:t,client_id:a,client_secret:i,name:o}),n=async(e,t)=>e.callWS({type:"application_credentials/delete",application_credentials_id:t})},700(e,t,a){a.d(t,{y:()=>s});const i=window;"customIconsets"in i||(i.customIconsets={});const o=i.customIconsets,r=window;"customIcons"in r||(r.customIcons={});const s=new Proxy(r.customIcons,{get:(e,t)=>e[t]??(o[t]?{getIcon:o[t]}:void 0)})},17894(e,t,a){a.d(t,{c:()=>r});var i=a(62826),o=a(22441);const r=e=>{class t extends e{constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.unknown=!1,this.hideClearIcon=!1}}return(0,i.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"disabled",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"required",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"icon",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"image",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"placeholder",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"helper",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],t.prototype,"unknown",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"unknown-item-text"})],t.prototype,"unknownItemText",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"hide-clear-icon",type:Boolean})],t.prototype,"hideClearIcon",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],t.prototype,"valueRenderer",void 0),t}},82196(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{DialogAddApplicationCredential:()=>y});a(18111),a(20116),a(61701);var o=a(62826),r=a(5124),s=a(22441),n=a(1087),l=a(38962),d=a(18350),c=a(72554),h=(a(93444),a(3109),a(38508)),p=(a(3587),a(65829)),m=a(91485),u=a(76944),b=a(95350),g=a(14503),v=a(36918),f=e([l,d,c,h,p,m]);[l,d,c,h,p,m]=f.then?(await f)():f;const _="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z";class y extends r.WF{showDialog(e){this._params=e,this._domain=e.selectedDomain,this._manifest=e.manifest,this._invalid=!1,this._name="",this._description="",this._clientId="",this._clientSecret="",this._error=void 0,this._loading=!1,this._open=!0,this._fetchConfig()}async _fetchConfig(){this._config=await(0,u.d8)(this.hass),this._domains=Object.keys(this._config.integrations).map(e=>({id:e,name:(0,b.p$)(this.hass.localize,e)})),await this.hass.loadBackendTranslation("application_credentials"),this._updateDescription()}render(){if(!this._params)return r.s6;const e=this._params.selectedDomain?(0,b.p$)(this.hass.localize,this._domain):"";return r.qy` <ha-dialog .open="${this._open}" @closed="${this._abortDialog}" .preventScrimClose="${!!(this._domain||this._name||this._clientId||this._clientSecret)}" .headerTitle="${this.hass.localize("ui.panel.config.application_credentials.editor.caption")}"> ${this._config?r.qy`<div> ${this._error?r.qy`<ha-alert alert-type="error">${this._error}</ha-alert> `:r.s6} ${this._params.selectedDomain&&!this._description?r.qy`<p> ${this.hass.localize("ui.panel.config.application_credentials.editor.missing_credentials",{integration:e})} ${this._manifest?.is_built_in||this._manifest?.documentation?r.qy`<a href="${this._manifest.is_built_in?(0,v.o)(this.hass,`/integrations/${this._domain}`):this._manifest.documentation}" target="_blank" rel="noreferrer"> ${this.hass.localize("ui.panel.config.application_credentials.editor.missing_credentials_domain_link",{integration:e})} <ha-svg-icon .path="${_}"></ha-svg-icon> </a>`:r.s6} </p>`:r.s6} ${this._params.selectedDomain&&this._description?r.s6:r.qy`<p> ${this.hass.localize("ui.panel.config.application_credentials.editor.description")} <a href="${(0,v.o)(this.hass,"/integrations/application_credentials")}" target="_blank" rel="noreferrer"> ${this.hass.localize("ui.panel.config.application_credentials.editor.view_documentation")} <ha-svg-icon .path="${_}"></ha-svg-icon> </a> </p>`} ${this._params.selectedDomain?r.s6:r.qy`<ha-generic-picker name="domain" .hass="${this.hass}" .label="${this.hass.localize("ui.panel.config.application_credentials.editor.domain")}" .value="${this._domain}" .invalid="${this._invalid&&!this._domain}" .getItems="${this._getDomainItems}" required .disabled="${!this._domains}" .valueRenderer="${this._domainRenderer}" @value-changed="${this._handleDomainPicked}" .errorMessage="${this.hass.localize("ui.common.error_required")}"></ha-generic-picker>`} ${this._description?r.qy`<ha-markdown breaks .content="${this._description}"></ha-markdown>`:r.s6} <ha-input class="name" name="name" .label="${this.hass.localize("ui.panel.config.application_credentials.editor.name")}" .value="${this._name}" .invalid="${this._invalid&&!this._name}" required @input="${this._handleValueChanged}" .validationMessage="${this.hass.localize("ui.common.error_required")}" dialogInitialFocus></ha-input> <ha-input class="clientId" name="clientId" .label="${this.hass.localize("ui.panel.config.application_credentials.editor.client_id")}" .value="${this._clientId}" .invalid="${this._invalid&&!this._clientId}" required @input="${this._handleValueChanged}" .validationMessage="${this.hass.localize("ui.common.error_required")}" dialogInitialFocus .hint="${this.hass.localize("ui.panel.config.application_credentials.editor.client_id_helper")}"></ha-input> <ha-input type="password" password-toggle .label="${this.hass.localize("ui.panel.config.application_credentials.editor.client_secret")}" name="clientSecret" .value="${this._clientSecret}" .invalid="${this._invalid&&!this._clientSecret}" required @input="${this._handleValueChanged}" .validationMessage="${this.hass.localize("ui.common.error_required")}" .hint="${this.hass.localize("ui.panel.config.application_credentials.editor.client_secret_helper")}"></ha-input> </div> <ha-dialog-footer slot="footer"> <ha-button appearance="plain" slot="secondaryAction" @click="${this._closeDialog}" .disabled="${this._loading}"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button slot="primaryAction" @click="${this._addApplicationCredential}" .loading="${this._loading}"> ${this.hass.localize("ui.panel.config.application_credentials.editor.add")} </ha-button> </ha-dialog-footer>`:r.qy`<ha-fade-in .delay="${500}"> <ha-spinner size="large"></ha-spinner> </ha-fade-in>`} </ha-dialog> `}_closeDialog(){this._open=!1}closeDialog(){this._params=void 0,this._domains=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}_handleDomainPicked(e){e.stopPropagation(),this._domain=e.detail.value,this._updateDescription()}async _updateDescription(){if(!this._domain)return;await this.hass.loadBackendTranslation("application_credentials",this._domain);const e=this._config.integrations[this._domain];this._description=this.hass.localize(`component.${this._domain}.application_credentials.description`,e.description_placeholders)}_handleValueChanged(e){this._error=void 0;const t=e.target.name,a=e.target.value;this[`_${t}`]=a}_abortDialog(){this._params&&this._params.dialogAbortedCallback&&this._params.dialogAbortedCallback(),this.closeDialog()}async _addApplicationCredential(e){if(e.preventDefault(),!(this._domain&&this._name&&this._clientId&&this._clientSecret))return void(this._invalid=!0);let t;this._invalid=!1,this._loading=!0,this._error="";try{t=await(0,u.MV)(this.hass,this._domain,this._clientId,this._clientSecret,this._name)}catch(e){return this._loading=!1,void(this._error=e.message)}this._params.applicationCredentialAddedCallback(t),this.closeDialog()}static get styles(){return[g.nA,r.AH`ha-dialog{--mdc-dialog-max-width:500px;--dialog-z-index:10}.row{display:flex;padding:var(--ha-space-2) 0}a{text-decoration:none}a ha-svg-icon{--mdc-icon-size:16px}ha-markdown{margin-top:var(--ha-space-4);margin-bottom:var(--ha-space-4)}ha-fade-in{display:flex;width:100%;justify-content:center}`]}constructor(...e){super(...e),this._loading=!1,this._open=!1,this._invalid=!1,this._getDomainItems=()=>this._domains?.map(e=>({id:e.id,primary:e.name,sorting_label:e.name}))??[],this._domainRenderer=e=>{const t=this._domains?.find(t=>t.id===e);return r.qy`<span slot="headline">${t?t.name:e}</span>`}}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_loading",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_error",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_params",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_domain",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_manifest",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_name",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_description",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_clientId",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_clientSecret",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_domains",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_config",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_open",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_invalid",void 0),y=(0,o.Cg)([(0,s.EM)("dialog-add-application-credential")],y),i()}catch(e){i(e)}})},996(e,t,a){a.d(t,{G:()=>i});a(45367),a(92731);class i{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}}},36918(e,t,a){a.d(t,{o:()=>i});const i=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},88438(e,t,a){a.d(t,{C:()=>i});const i="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0},46571(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=46571,e.exports=t},62003(e,t,a){var i={"./ha-icon-prev":["89133",[61982]],"./ha-icon-button-toolbar":["9882",[39763,76775]],"./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,85545]],"./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,85545]],"./ha-icon-button-arrow-next":["99028",[54101]],"./ha-icon-button-prev.ts":["45100",[99197]],"./ha-icon-picker":["64138",[39763,32450,46095,7305,92769,3283,26092,71749]],"./ha-icon-button-toolbar.ts":["9882",[39763,76775]],"./ha-icon-button-arrow-prev.ts":["90248",[17041]],"./ha-icon-button-next":["25440",[81049]],"./ha-icon-next":["43661",[63902]],"./ha-icon-picker.ts":["64138",[39763,32450,46095,7305,92769,3283,26092,71749]],"./ha-icon-prev.ts":["89133",[61982]],"./ha-icon-button-arrow-prev":["90248",[17041]],"./ha-icon-button-next.ts":["25440",[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 o(e){if(!a.o(i,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=i[e],o=t[0];return Promise.all(t[1].map(a.e)).then(()=>a(o))}o.keys=()=>Object.keys(i),o.id=62003,e.exports=o}};