iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
37 lines • 48.7 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[55335],{93421:function(t,e,a){a.d(e,{IW:function(){return c},dH:function(){return d},fI:function(){return l}});a(44114),a(62953);var i=a(35211),o=a(22792),r=a(32172);const s=(t,e)=>{let a=t;for(const i of e){if(null==a)return;a=a[i]}return a},n=(t,e,a)=>{const o=(0,r.p)({transformer:function(t){return a.call(this,t)},watch:e?[e]:[]}),s=(0,i.Fg)({context:t,subscribe:!0});return(t,e)=>{o(t,e),s(t,e)}},l=t=>n(o.iN,t.entityIdPath[0],function(e){const a=s(this,t.entityIdPath);return"string"==typeof a?null==e?void 0:e[a]:void 0}),d=t=>n(o.X1,t.entityIdPath[0],function(e){const a=s(this,t.entityIdPath);return"string"==typeof a?null==e?void 0:e[a]:void 0}),c=()=>n(o.D5,void 0,({localize:t})=>t)},32172:function(t,e,a){a.d(e,{p:function(){return i}});a(16280),a(18111),a(7588),a(45367),a(92731),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);function i(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const i=String(a),o=e;if(o._transformers){if(!o.hasOwnProperty("_transformers")){const t=o._transformers;o._transformers=new Map,t.forEach((t,e)=>o._transformers.set(e,t))}}else{o._transformers=new Map,o._watching=new Map;const t=o.willUpdate;o.willUpdate=function(e){t.call(this,e);const a=new Set;e.forEach((t,e)=>{const i=this._watching.get(e);void 0!==i&&i.forEach(t=>a.add(t))}),a.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}o._transformers.set(a,t.transformer),t.watch&&t.watch.forEach(t=>{let e=o._watching.get(t);e||(e=new Set,o._watching.set(t,e)),e.add(a)});const r=Object.getOwnPropertyDescriptor(e,a);let s;if(void 0===r)s={get(){return this[`__transform_${i}`]},set(t){const e=this[`__transform_${i}`],a=this._transformers.get(i);this[`__transform_${i}`]=a?a.call(this,t):t,this[`__original_${i}`]=t,this.requestUpdate(i,e)},configurable:!0,enumerable:!0};else{const t=r.set;s=Object.assign(Object.assign({},r),{},{set(e){const a=this[`__transform_${i}`],o=this._transformers.get(i);this[`__transform_${i}`]=o?o.call(this,e):e,this[`__original_${i}`]=e,this.requestUpdate(i,a),null==t||t.call(this,e)}})}Object.defineProperty(e,a,s)}}},60353:function(t,e,a){a.d(e,{u:function(){return i}});class i{start(t){const e=Date.now();this._startY=t,this._startTime=e,this._lastY=t,this._lastTime=e,this._delta=0}move(t){const e=Date.now();return this._delta=this._startY-t,this._lastY=t,this._lastTime=e,this._delta}end(){const t=this.getVelocity(),e=Math.abs(t)>this._velocityThreshold;return{velocity:t,delta:this._delta,isSwipe:e,isDownwardSwipe:t>0}}getDelta(){return this._delta}getVelocity(){if(Date.now()-this._lastTime>=this._movementTimeThreshold)return 0;const t=this._lastTime-this._startTime;return t>0?(this._lastY-this._startY)/t:0}reset(){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0}constructor(t={}){var e,a;this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=null!==(e=t.velocitySwipeThreshold)&&void 0!==e?e:.5,this._movementTimeThreshold=null!==(a=t.movementTimeThreshold)&&void 0!==a?a:100}}},64481:function(t,e,a){a.d(e,{D:function(){return o},J:function(){return s}});a(16280),a(3362),a(55815),a(64979),a(79739);let i=!1;try{i="true"===window.localStorage.getItem("disableViewTransition")}catch(n){}const o=t=>{i=t},r=t=>{if(!(t=>(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name)(t))throw t},s=t=>{if(!document.startViewTransition||i)return t(!1),Promise.resolve();let e=!1;try{const a=document.startViewTransition(()=>{e=!0,t(!0)});return a.ready.catch(r),a.finished.catch(r)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),e?Promise.reject(a):(t(!1),Promise.resolve())}}},5745:function(t,e,a){var i=a(40445),o=a(99731),r=a(67576);class s extends o.Y{}s=(0,i.Cg)([(0,r.EM)("ha-chip-set")],s)},38962:function(t,e,a){a.a(t,async function(t,i){try{a.r(e);a(62953);var o=a(40445),r=a(5124),s=a(67576),n=a(6412),l=a(93421),d=a(1087),c=a(26300),h=(a(67094),t([c]));c=(h.then?(await h)():h)[0];let p,f,u,v,g=t=>t;const b="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 w extends r.WF{render(){var t;return(0,r.qy)(p||(p=g` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,n.H)({[this.alertType]:!0}),this.title?"":"no-title",m[this.alertType],(0,n.H)({content:!0,narrow:this.narrow}),this.title?(0,r.qy)(f||(f=g`<div class="title">${0}</div>`),this.title):r.s6,this.dismissable?(0,r.qy)(u||(u=g`<ha-icon-button ="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(t=this._localize)||void 0===t?void 0:t.call(this,"ui.common.dismiss_alert"),b):r.s6)}_dismissClicked(){(0,d.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}w.styles=(0,r.AH)(v||(v=g`.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)()],w.prototype,"title",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"alert-type"})],w.prototype,"alertType",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"dismissable",void 0),(0,o.Cg)([(0,s.wk)(),(0,l.IW)()],w.prototype,"_localize",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"narrow",void 0),w=(0,o.Cg)([(0,s.EM)("ha-alert")],w),i()}catch(p){i(p)}})},99611:function(t,e,a){a.a(t,async function(t,e){try{a(18111),a(13579),a(3362),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var i=a(40445),o=a(1126),r=a(35211),s=a(5124),n=a(67576),l=a(1087),d=a(60353),c=a(22792),h=a(59992),p=a(14503),f=a(22348),u=t([o,h]);[o,h]=u.then?(await u)():u;let v,g,b=t=>t;const m=300,w=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"]),_=new Set(["volume-slider-container","forecast"]);class y 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(t){super.updated(t),t.has("open")&&(this._drawerOpen=this.open)}render(){return(0,s.qy)(v||(v=b` <wa-drawer id="drawer" placement="bottom" .open="${0}" .lightDismiss="${0}" .ariaLabelledby="${0}" .ariaDescribedby="${0}" ="${0}" -show="${0}" -after-show="${0}" -hide="${0}" -after-hide="${0}" ="${0}" without-header ="${0}"> <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> ${0} </div> <slot name="footer"></slot> </wa-drawer> `),this._drawerOpen,!this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this._handleKeyDown,this._handleShow,this._handleAfterShow,this._handleHide,this._handleAfterHide,this._handleCloseAction,this._handleTouchStart,this.renderScrollableFades())}_startResizing(t){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(t)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${m}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},m)}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,(0,s.AH)(g||(g=b`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${0}ms;--hide-duration:${0}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)} (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}`),m,m)]}constructor(...t){super(...t),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(()=>{var t;const e=this._autofocusElement;null!==(t=this._hassConfig)&&void 0!==t&&t.auth.external&&(0,f.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}})):null==e||e.focus()})},this._handleAfterShow=()=>{(0,l.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=t=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);t.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,l.r)(this,"closed"))},this._handleHide=t=>{if(t.eventPhase!==Event.AT_TARGET)return;const e=t.detail.source===t.target.drawer;if(this._sliderInteractionActive)return t.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&e&&t.preventDefault(),this._escapePressed=!1},this._handleKeyDown=t=>{"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)},this._handleCloseAction=t=>{t.composedPath().some(t=>t instanceof HTMLElement&&("close"===t.getAttribute("data-dialog")||"close"===t.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=t=>{if(this.preventScrimClose)return;const e=t.composedPath();for(const a of e){if(a===this._drawer)break;if(a instanceof HTMLElement&&(a.scrollTop>0||w.has(a.localName)||Array.from(a.classList).some(t=>_.has(t))))return}t.stopPropagation(),this._startResizing(t.touches[0].clientY)},this._handleTouchMove=t=>{const e=t.touches[0].clientY,a=this._gestureRecognizer.move(e);a<0&&(t.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*a}px)`)}))},this._handleTouchEnd=()=>{var t;this._unregisterResizeHandlers(),this._isDragging=!1;const e=this._gestureRecognizer.end();if(e.isSwipe)return void(e.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const a=null===(t=this._drawer.shadowRoot)||void 0===t?void 0:t.querySelector('[part="body"]'),i=(null==a?void 0:a.offsetHeight)||0;i>0&&e.delta<0&&Math.abs(e.delta)>.5*i?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"})],y.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],y.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],y.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],y.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],y.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_drawerOpen",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_sliderInteractionActive",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],y.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.P)("#drawer")],y.prototype,"_drawer",void 0),(0,i.Cg)([(0,n.P)("#body")],y.prototype,"_bodyElement",void 0),(0,i.Cg)([(0,n.P)("[autofocus]")],y.prototype,"_autofocusElement",void 0),y=(0,i.Cg)([(0,n.EM)("ha-bottom-sheet")],y),e()}catch(v){e(v)}})},93444:function(t,e,a){var i=a(40445),o=a(5124),r=a(67576);let s,n,l=t=>t;class d extends o.WF{render(){return(0,o.qy)(s||(s=l` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `))}static get styles(){return[(0,o.AH)(n||(n=l`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}}d=(0,i.Cg)([(0,r.EM)("ha-dialog-footer")],d)},76538:function(t,e,a){a(62953);var i=a(40445),o=a(5124),r=a(67576);let s,n,l,d,c,h,p=t=>t;class f extends o.WF{render(){const t=(0,o.qy)(s||(s=p`<div class="header-title"> <slot name="title"></slot> </div>`)),e=(0,o.qy)(n||(n=p`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`));return(0,o.qy)(l||(l=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,o.qy)(d||(d=p`${0}${0}`),e,t):(0,o.qy)(c||(c=p`${0}${0}`),t,e))}static get styles(){return[(0,o.AH)(h||(h=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))} 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(...t){super(...t),this.subtitlePosition="below",this.showBorder=!1}}(0,i.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],f.prototype,"subtitlePosition",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],f.prototype,"showBorder",void 0),f=(0,i.Cg)([(0,r.EM)("ha-dialog-header")],f)},72554:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953),a(49255);var i=a(40445),o=a(93900),r=a(35211),s=a(5124),n=a(67576),l=a(63672),d=a(1087),c=a(64481),h=a(22792),p=a(59992),f=a(14503),u=a(22348),v=(a(76538),a(26300)),g=t([o,v,p]);[o,v,p]=g.then?(await g)():g;let b,m,w,_,y,x,C,S=t=>t;const k="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 T extends((0,p.V)(s.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(t){super.updated(t),t.has("open")&&(this._open=this.open)}render(){var t,e,a;return(0,s.qy)(b||(b=S` <wa-dialog .open="${0}" .lightDismiss="${0}" without-header aria-labelledby="${0}" aria-describedby="${0}" ="${0}" -hide="${0}" -show="${0}" -after-show="${0}" -after-hide="${0}"> ${0} <div class="content-wrapper"> <div class="body ha-scrollbar" ="${0}"> <slot></slot> </div> ${0} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `),this._open,!this.preventScrimClose,(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)),(0,l.J)(this.ariaDescribedBy),this._handleKeyDown,this._handleHide,this._handleShow,this._handleAfterShow,this._handleAfterHide,this.withoutHeader?s.s6:(0,s.qy)(m||(m=S`<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!==(t=null===(e=this._i18n)||void 0===e||null===(a=e.localize)||void 0===a?void 0:a.call(e,"ui.common.close"))&&void 0!==t?t:"Close",k,void 0!==this.headerTitle?(0,s.qy)(w||(w=S`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,s.qy)(_||(_=S`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,s.qy)(y||(y=S`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,s.qy)(x||(x=S`<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(t){this._open?(0,c.J)(()=>{this._setFullscreen(t.detail)}):this._setFullscreen(t.detail)}_setFullscreen(t){this.toggleAttribute("fullscreen",t)}_handleBodyScroll(t){this._bodyScrolled=t.target.scrollTop>0}_handleKeyDown(t){"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)}_handleHide(t){var e;const a=(null===(e=t.detail)||void 0===e?void 0:e.source)===t.target.dialog;this.preventScrimClose&&this._escapePressed&&a&&t.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,f.dp,(0,s.AH)(C||(C=S`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))} (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)} 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(...t){super(...t),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 t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var t,e;if(null!==(t=this._hassConfig)&&void 0!==t&&t.auth.external&&(0,u.V)(this._hassConfig.auth.external)){const t=this.querySelector("[autofocus]");return void(null!==t&&(t.id||(t.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})))}null===(e=this.querySelector("[autofocus]"))||void 0===e||e.focus()}))},this._handleAfterShow=t=>{t.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,i.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],T.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],T.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],T.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({reflect:!0})],T.prototype,"type",void 0),(0,i.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],T.prototype,"width",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],T.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-title"})],T.prototype,"headerTitle",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],T.prototype,"headerSubtitle",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],T.prototype,"headerSubtitlePosition",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],T.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],T.prototype,"withoutHeader",void 0),(0,i.Cg)([(0,n.wk)()],T.prototype,"_open",void 0),(0,i.Cg)([(0,n.P)(".body")],T.prototype,"bodyContainer",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:h.D5,subscribe:!0})],T.prototype,"_i18n",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:h.WF,subscribe:!0})],T.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.wk)()],T.prototype,"_bodyScrolled",void 0),(0,i.Cg)([(0,n.Ls)({passive:!0})],T.prototype,"_handleBodyScroll",null),T=(0,i.Cg)([(0,n.EM)("ha-dialog")],T),e()}catch(b){e(b)}})},47680:function(t,e,a){a.r(e),a.d(e,{HaIcon:function(){return T}});a(74423),a(3362),a(62953);var i=a(40445),o=a(5124),r=a(67576),s=a(1087),n=a(9899),l=a(700),d=(a(44114),a(18111),a(7588),a(96167),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 f=()=>(p||(p=u().catch(t=>{throw p=void 0,t})),p),u=async()=>{const t=(0,d.y$)("hass-icon-db","mdi-icon-store"),e=await(0,d.Jt)("_version",t);return e?e!==h.version&&(await(0,d.IU)(t),(0,d.hZ)("_version",h.version,t)):(0,d.hZ)("_version",h.version,t),t},v=["mdi","hass","hassio","hademo"];let g=[];a(67094);let b,m,w,_=t=>t;const y={},x={},C=(0,n.s)(()=>(async t=>{const e=Object.keys(t),a=await Promise.allSettled(Object.values(t));(await f())("readwrite",i=>{a.forEach((a,o)=>{"fulfilled"===a.status&&Object.entries(a.value).forEach(([t,e])=>{i.put(e,t)}),delete t[e[o]]})})})(x),2e3),S={},k={"home-assistant":()=>a.e(58781).then(a.bind(a,53580)).then(t=>t.mdiHomeAssistant),"music-assistant":()=>a.e(56009).then(a.bind(a,10576)).then(t=>t.mdiMusicAssistant),esphome:()=>a.e(88800).then(a.bind(a,45091)).then(t=>t.mdiEsphomeLogo)};class T extends o.WF{willUpdate(t){super.willUpdate(t),t.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}render(){return this.icon?this._legacy?(0,o.qy)(b||(b=_` <iron-icon .icon="${0}"></iron-icon>`),this.icon):(0,o.qy)(m||(m=_`<ha-svg-icon .path="${0}" .secondaryPath="${0}" .viewBox="${0}"></ha-svg-icon>`),this._path,this._secondaryPath,this._viewBox):o.s6}async _loadIcon(){if(!this.icon)return;const t=this.icon,[e,a]=this.icon.split(":",2);let i,o=a;if(!e||!o)return;if(!v.includes(e)){const a=l.y[e];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(o),t)):void(this._legacy=!0)}if(this._legacy=!1,o in y){const t=y[o];let a;t.newName?(a=`Icon ${e}:${o} was renamed to ${e}:${t.newName}, please change your config, it will be removed in version ${t.removeIn}.`,o=t.newName):a=`Icon ${e}:${o} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${t.removeIn}.`,console.warn(a),(0,s.r)(this,"write_log",{level:"warning",message:a})}if(o in S)return void(this._path=S[o]);if(o in k){const e=await k[o]();return this.icon===t&&(this._path=e),void(S[o]=e)}try{i=await(t=>new Promise((e,a)=>{if(g.push([t,e,a]),g.length>1)return;const i=f();(0,c.h)(1e3,(async()=>{(await i)("readonly",t=>{for(const[e,a,i]of g)(0,d.Yd)(t.get(e)).then(t=>a(t)).catch(t=>i(t));g=[]})})()).catch(t=>{for(const[,,e]of g)e(t);g=[]})}))(o)}catch(p){i=void 0}if(i)return this.icon===t&&(this._path=i),void(S[o]=i);const r=(t=>{let e;for(const a of h.parts){if(void 0!==a.start&&t<a.start)break;e=a}return e.file})(o);if(r in x)return void this._setPath(x[r],o,t);const n=fetch(`/static/mdi/${r}.json`).then(t=>t.json());x[r]=n,this._setPath(n,o,t),n.catch(()=>{delete x[r]}),C()}async _setCustomPath(t,e){const a=await t;this.icon===e&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}async _setPath(t,e,a){try{const i=await t;this.icon===a&&(this._path=i[e]),S[e]=i[e]}catch(i){}}constructor(...t){super(...t),this._legacy=!1}}T.styles=(0,o.AH)(w||(w=_`:host{fill:currentcolor}`)),(0,i.Cg)([(0,r.MZ)()],T.prototype,"icon",void 0),(0,i.Cg)([(0,r.wk)()],T.prototype,"_path",void 0),(0,i.Cg)([(0,r.wk)()],T.prototype,"_secondaryPath",void 0),(0,i.Cg)([(0,r.wk)()],T.prototype,"_viewBox",void 0),(0,i.Cg)([(0,r.wk)()],T.prototype,"_legacy",void 0),T=(0,i.Cg)([(0,r.EM)("ha-icon")],T)},34127:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var i=a(40445),o=a(52630),r=a(5124),s=a(67576),n=t([o]);o=(n.then?(await n)():n)[0];let l,d=t=>t;class c extends o.A{static get styles(){return[o.A.styles,(0,r.AH)(l||(l=d`:host{--wa-tooltip-background-color:var(
--ha-tooltip-background-color,
var(--ha-color-surface-default)
);--wa-tooltip-content-color:var(
--ha-tooltip-text-color,
var(--primary-text-color)
);--wa-tooltip-font-family:var(
--ha-tooltip-font-family,
var(--ha-font-family-body)
);--wa-tooltip-font-size:var(
--ha-tooltip-font-size,
var(--ha-font-size-m)
);--wa-tooltip-font-weight:var(
--ha-tooltip-font-weight,
var(--ha-font-weight-medium)
);--wa-tooltip-line-height:var(
--ha-tooltip-line-height,
var(--ha-line-height-condensed)
);--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
--ha-tooltip-border-radius,
var(--ha-border-radius-md)
);--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`))]}constructor(...t){super(...t),this.showDelay=350,this.hideDelay=150}}(0,i.Cg)([(0,s.MZ)({attribute:"show-delay",type:Number})],c.prototype,"showDelay",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"hide-delay",type:Number})],c.prototype,"hideDelay",void 0),c=(0,i.Cg)([(0,s.EM)("ha-tooltip")],c),e()}catch(l){e(l)}})},36866:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var i=a(40445),o=a(5124),r=a(67576),s=a(91485),n=t([s]);s=(n.then?(await n)():n)[0];let l,d,c=t=>t;const h="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z";class p extends s.U{willUpdate(t){var e,a;(super.willUpdate(t),this.label||this.placeholder||this.hasUpdated&&!t.has("_i18n"))||(this.placeholder=(null===(e=this.i18n)||void 0===e||null===(a=e.localize)||void 0===a?void 0:a.call(e,"ui.common.search"))||"Search")}renderStartDefault(){return(0,o.qy)(l||(l=c`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),h)}constructor(){super(),this.withClear=!0,this.autocomplete=this.autocomplete||"off"}}p.styles=[...s.U.styles,(0,o.AH)(d||(d=c`:host([appearance=outlined]) wa-input.no-label::part(base){height:40px}`))],p=(0,i.Cg)([(0,r.EM)("ha-input-search")],p),e()}catch(l){e(l)}})},700:function(t,e,a){a.d(e,{y:function(){return 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:(t,e)=>{var a;return null!==(a=t[e])&&void 0!==a?a:o[e]?{getIcon:o[e]}:void 0}})},22675:function(t,e,a){a.d(e,{HV:function(){return r},Hh:function(){return o}});var i=a(23832);const o="unavailable",r="unknown",s=[o,r,"off"];(0,i.g)(s)},24717:function(t,e,a){a.d(e,{Ak:function(){return r},Bd:function(){return s},Ri:function(){return o},lg:function(){return n},qT:function(){return d},uu:function(){return l}});a(74423);var i=a(22675),o=function(t){return t[t.TURN_ON=1]="TURN_ON",t[t.TURN_OFF=2]="TURN_OFF",t[t.PAUSE=4]="PAUSE",t[t.STOP=8]="STOP",t[t.RETURN_HOME=16]="RETURN_HOME",t[t.FAN_SPEED=32]="FAN_SPEED",t[t.BATTERY=64]="BATTERY",t[t.STATUS=128]="STATUS",t[t.SEND_COMMAND=256]="SEND_COMMAND",t[t.LOCATE=512]="LOCATE",t[t.CLEAN_SPOT=1024]="CLEAN_SPOT",t[t.MAP=2048]="MAP",t[t.STATE=4096]="STATE",t[t.START=8192]="START",t[t.CLEAN_AREA=16384]="CLEAN_AREA",t}({});function r(t){return["cleaning","on"].includes(t.state)}function s(t){return t.state!==i.Hh&&!r(t)}function n(t){return!["docked","off","idle"].includes(t.state)}function l(t){return t.state!==i.Hh&&"returning"!==t.state}const d=(t,e)=>t.callWS({type:"vacuum/get_segments",entity_id:e})},59992:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{V:function(){return u}});a(62953);var o=a(40445),r=a(88696),s=a(5124),n=a(6412),l=a(67576),d=t([r]);r=(d.then?(await d)():d)[0];let c,h,p=t=>t;const f=t=>void 0===t?[]:Array.isArray(t)?t:[t],u=t=>{class e extends t{get scrollableElement(){return e.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(t){var e;null===(e=super.firstUpdated)||void 0===e||e.call(this,t),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(t){var e;null===(e=super.updated)||void 0===e||e.call(this,t),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(t=!1){return(0,s.qy)(c||(c=p` <div class="${0}"></div> <div class="${0}"></div> `),(0,n.H)({"fade-top":!0,rounded:t,visible:this._contentScrolled}),(0,n.H)({"fade-bottom":!0,rounded:t,visible:this._contentScrollable}))}static get styles(){var t;const e=Object.getPrototypeOf(this);return[...f(null!==(t=null==e?void 0:e.styles)&&void 0!==t?t:[]),(0,s.AH)(h||(h=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 t=this.scrollableElement;t!==this._scrollTarget&&(this._detachScrollableElement(),t&&(this._scrollTarget=t,t.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(t),this._updateScrollableState(t)))}_detachScrollableElement(){var t,e;this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),null===(t=(e=this._resize).unobserve)||void 0===t||t.call(e,this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(t){const e=parseFloat(getComputedStyle(t).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:i=0,scrollTop:o=0}=t;this._contentScrollable=a-i>o+e+this.scrollFadeSafeAreaPadding}constructor(...t){super(...t),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=t=>{var e;const a=t.currentTarget;this._contentScrolled=(null!==(e=a.scrollTop)&&void 0!==e?e:0)>this.scrollFadeThreshold,this._updateScrollableState(a)},this._resize=new r.P(this,{target:null,callback:t=>{var e;const a=null===(e=t[0])||void 0===e?void 0:e.target;a&&this._updateScrollableState(a)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return e.DEFAULT_SCROLLABLE_ELEMENT=null,(0,o.Cg)([(0,l.wk)()],e.prototype,"_contentScrolled",void 0),(0,o.Cg)([(0,l.wk)()],e.prototype,"_contentScrollable",void 0),e};i()}catch(c){i(c)}})},57181:function(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{DialogVacuumSegmentMapping:function(){return y}});a(3362),a(62953);var o=a(40445),r=a(5124),s=a(67576),n=a(1087),l=a(65522),d=a(37981),c=a(81816),h=a(28455),p=a(15638),f=a(18350),u=(a(93444),a(77677)),v=a(72554),g=a(59241),b=a(14503),m=t([f,u,v]);[f,u,v]=m.then?(await m)():m;let w,_=t=>t;class y extends r.WF{async showDialog(t){this._params=t,this._open=!0,await this._loadCurrentMapping()}closeDialog(){return this._open=!1,this._params=void 0,this._areaMapping=void 0,!0}async _loadCurrentMapping(){var t;if(!this._params)return;const e=this._params.entityId;this._entry=await(0,g.v)(this.hass,e),null!==(t=this._entry)&&void 0!==t&&null!==(t=t.options)&&void 0!==t&&t.vacuum?this._areaMapping=this._entry.options.vacuum.area_mapping||{}:this._areaMapping={}}_dialogClosed(){this._params=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}_valueChanged(t){this._areaMapping=t.detail.value}async _save(){if(this._params&&this._areaMapping){this._submitting=!0;try{var t,e;const a=this._mapper,i=Object.assign(Object.assign({},null!==(t=null===(e=this._entry)||void 0===e||null===(e=e.options)||void 0===e?void 0:e.vacuum)&&void 0!==t?t:{}),{},{area_mapping:this._areaMapping,last_seen_segments:a.lastSeenSegments});await(0,g.G_)(this.hass,this._params.entityId,{options_domain:"vacuum",options:i}),this.closeDialog()}catch(a){}finally{this._submitting=!1}}}render(){if(!this._params)return r.s6;const t=this.hass.states[this._params.entityId],e=t?(0,h.ln)(t,this.hass.entities,this.hass.devices,this.hass.areas,this.hass.floors):this._entry?(0,h.jI)(this._entry,this.hass.entities,this.hass.devices,this.hass.areas,this.hass.floors):void 0,a=t?(0,c.aH)(t,this.hass.entities,this.hass.devices):this._entry?(0,c.cx)(this._entry,this.hass.devices):this._params.entityId,i=null!=e&&e.device?(0,d.xn)(e.device):void 0,o=[null!=e&&e.area?(0,l.A)(e.area):void 0,i,a].filter(t=>Boolean(t));return(0,r.qy)(w||(w=_` <ha-dialog .open="${0}" ="${0}" .headerTitle="${0}" .headerSubtitle="${0}"> <ha-vacuum-segment-area-mapper .hass="${0}" entity-id="${0}" .value="${0}" -changed="${0}"></ha-vacuum-segment-area-mapper> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" ="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" ="${0}" .disabled="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this._open,this._dialogClosed,this.hass.localize("ui.dialogs.vacuum_segment_mapping.title"),o.join((0,p.qC)(this.hass.language,this.hass.translationMetadata.translations)?" ◂ ":" ▸ "),this.hass,this._params.entityId,this._areaMapping,this._valueChanged,this.closeDialog,this.hass.localize("ui.common.cancel"),this._save,this._submitting,this.hass.localize("ui.common.save"))}constructor(...t){super(...t),this._open=!1,this._submitting=!1}}y.styles=[b.nA],(0,o.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_params",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_open",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_areaMapping",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_submitting",void 0),(0,o.Cg)([(0,s.P)("ha-vacuum-segment-area-mapper")],y.prototype,"_mapper",void 0),y=(0,o.Cg)([(0,s.EM)("dialog-vacuum-segment-mapping")],y),i()}catch(w){i(w)}})},85614:function(t,e,a){a.d(e,{i:function(){return i}});a(3362),a(62953);const i=async()=>{await Promise.all([a.e(38085),a.e(22309)]).then(a.bind(a,40772))}},22348:function(t,e,a){a.d(e,{V:function(){return o}});var i=a(37177);const o=t=>!!t&&i.n},37177:function(t,e,a){a.d(e,{n:function(){return i}});a(27495);const i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},88438:function(t,e,a){a.d(e,{C:function(){return i}});const i="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}}]);