UNPKG

iobroker.lovelace

Version:

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

25 lines 85.5 kB
export const __rspack_esm_id=50931;export const __rspack_esm_ids=[50931];export const __webpack_modules__={57237(e,t,a){a.d(t,{d:()=>i});const i=e=>e.stopPropagation()},65522(e,t,a){a.d(t,{A:()=>i});const i=e=>e.name?.trim()},66033(e,t,a){a.d(t,{L:()=>i});const i=(e,t)=>{const a=e.floor_id;return{area:e,floor:(a?t[a]:void 0)||null}}},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}}},64481(e,t,a){a.d(t,{D:()=>o,J:()=>s});a(64979);let i=!1;try{i="true"===window.localStorage.getItem("disableViewTransition")}catch{}const o=e=>{i=e},r=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},s=e=>{if(!document.startViewTransition||i)return e(!1),Promise.resolve();let t=!1;try{const a=document.startViewTransition(()=>{t=!0,e(!0)});return a.ready.catch(r),a.finished.catch(r)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),t?Promise.reject(a):(e(!1),Promise.resolve())}}},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)},13467(e,t,a){var i=a(62826),o=a(41216),r=a(78960),s=a(75640),n=a(91735),l=a(43826),d=a(5124),h=a(22441);class c extends o.R{}c.styles=[n.R,l.R,s.R,r.R,d.AH`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--primary-text-color);--md-sys-color-on-secondary-container:var(--primary-text-color);--md-input-chip-container-shape:16px;--md-input-chip-outline-color:var(--outline-color);--md-input-chip-selected-container-color:rgba(
          var(--rgb-primary-text-color),
          0.15
        );--ha-input-chip-selected-container-opacity:1;--md-input-chip-label-text-font:Roboto,sans-serif}::slotted([slot=icon]){display:flex;--mdc-icon-size:var(--md-input-chip-icon-size, 18px)}.selected::before{opacity:var(--ha-input-chip-selected-container-opacity)}`],c=(0,i.Cg)([(0,h.EM)("ha-input-chip")],c)},832(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),o=a(5124),r=a(22441),s=a(1087),n=a(26613),l=e([n]);n=(l.then?(await l)():l)[0];class d extends o.WF{render(){return this.aliases?o.qy` <ha-input-multi .value="${this.aliases}" .disabled="${this.disabled}" .sortable="${this.sortable}" update-on-blur .label="${this.hass.localize("ui.dialogs.aliases.label")}" .removeLabel="${this.hass.localize("ui.dialogs.aliases.remove")}" .addLabel="${this.hass.localize("ui.dialogs.aliases.add")}" item-index @value-changed="${this._aliasesChanged}"> </ha-input-multi> `:o.s6}_aliasesChanged(e){e.stopPropagation(),(0,s.r)(this,"value-changed",{value:e.detail.value})}constructor(...e){super(...e),this.disabled=!1,this.sortable=!1}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({type:Array})],d.prototype,"aliases",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],d.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],d.prototype,"sortable",void 0),d=(0,i.Cg)([(0,r.EM)("ha-aliases-editor")],d),t()}catch(e){t(e)}})},66086(e,t,a){a.a(e,async function(e,t){try{a(74423),a(18111),a(22489),a(61701);var i=a(62826),o=a(5124),r=a(22441),s=a(22786),n=a(1087),l=a(65522),d=a(55931),h=a(66033),c=a(49852),p=a(2514),u=a(65063),g=a(34023),v=(a(75064),a(38508)),m=a(26300),b=(a(67094),e([v,m]));[v,m]=b.then?(await b)():b;const y="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",_="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z",f="___ADD_NEW___";class w extends o.WF{willUpdate(e){this._pendingAreaId&&e.has("hass")&&this.hass.areas!==e.get("hass")?.areas&&this.hass.areas[this._pendingAreaId]&&(this._setValue(this._pendingAreaId),this._pendingAreaId=void 0)}async open(){await this.updateComplete,await(this._picker?.open())}render(){const e=this.label??this.hass.localize("ui.components.area-picker.area"),t=this._computeValueRenderer(this.hass.areas);let a=e;if(this.value&&e){const e=this.hass.areas[this.value];if(e){const{floor:t}=(0,h.L)(e,this.hass.floors);t&&(a=void 0)}}return o.qy` <ha-generic-picker .hass="${this.hass}" .autofocus="${this.autofocus}" .label="${a}" .helper="${this.helper}" .notFoundLabel="${this._notFoundLabel}" .emptyLabel="${this.hass.localize("ui.components.area-picker.no_areas")}" .disabled="${this.disabled}" .required="${this.required}" .value="${this.value}" .getItems="${this._getItems}" .getAdditionalItems="${this._getAdditionalItems}" .valueRenderer="${t}" .addButtonLabel="${this.addButtonLabel}" .searchKeys="${c.P}" .unknownItemText="${this.hass.localize("ui.components.area-picker.unknown")}" @value-changed="${this._valueChanged}"> </ha-generic-picker> `}_valueChanged(e){e.stopPropagation();const t=e.detail.value;if(t){if(t.startsWith(f)){this.hass.loadFragmentTranslation("config");const e=t.substring(f.length);return void(0,g.J)(this,{suggestedName:e,createEntry:async e=>{try{const t=await(0,p.L3)(this.hass,e);this.hass.areas[t.area_id]?this._setValue(t.area_id):this._pendingAreaId=t.area_id}catch(e){(0,u.showAlertDialog)(this,{title:this.hass.localize("ui.components.area-picker.failed_create_area"),text:e.message})}}})}this._setValue(t)}else this._setValue(void 0)}_setValue(e){this.value=e,(0,n.r)(this,"value-changed",{value:e}),(0,n.r)(this,"change")}constructor(...e){super(...e),this.noAdd=!1,this.disabled=!1,this.required=!1,this._getAreasMemoized=(0,s.A)(c.j),this._computeValueRenderer=(0,s.A)(e=>e=>{const t=this.hass.areas[e];if(!t)return o.qy` <ha-svg-icon slot="start" .path="${_}"></ha-svg-icon> <span slot="headline">${t}</span> `;const{floor:a}=(0,h.L)(t,this.hass.floors),i=t?(0,l.A)(t):void 0,r=a?(0,d.X)(a):void 0,s=t.icon;return o.qy` ${s?o.qy`<ha-icon slot="start" .icon="${s}"></ha-icon>`:o.qy`<ha-svg-icon slot="start" .path="${_}"></ha-svg-icon>`} <span slot="headline">${i}</span> ${r?o.qy`<span slot="supporting-text">${r}</span>`:o.s6} `}),this._getItems=()=>this._getAreasMemoized(this.hass.areas,this.hass.floors,this.hass.devices,this.hass.entities,this.hass.states,this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.excludeAreas),this._allAreaNames=(0,s.A)(e=>Object.values(e).map(e=>(0,l.A)(e)?.toLowerCase()).filter(Boolean)),this._getAdditionalItems=e=>{if(this.noAdd)return[];const t=this._allAreaNames(this.hass.areas);return e&&!t.includes(e.toLowerCase())?[{id:f+e,primary:this.hass.localize("ui.components.area-picker.add_new_suggestion",{name:e}),icon_path:y}]:[{id:f,primary:this.hass.localize("ui.components.area-picker.add_new"),icon_path:y}]},this._notFoundLabel=e=>this.hass.localize("ui.components.area-picker.no_match",{term:o.qy`<b>‘${e}’</b>`})}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)()],w.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)()],w.prototype,"value",void 0),(0,i.Cg)([(0,r.MZ)()],w.prototype,"helper",void 0),(0,i.Cg)([(0,r.MZ)()],w.prototype,"placeholder",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"no-add"})],w.prototype,"noAdd",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"include-domains"})],w.prototype,"includeDomains",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-domains"})],w.prototype,"excludeDomains",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"include-device-classes"})],w.prototype,"includeDeviceClasses",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-areas"})],w.prototype,"excludeAreas",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"deviceFilter",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"entityFilter",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],w.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],w.prototype,"required",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"add-button-label"})],w.prototype,"addButtonLabel",void 0),(0,i.Cg)([(0,r.P)("ha-generic-picker")],w.prototype,"_picker",void 0),(0,i.Cg)([(0,r.wk)()],w.prototype,"_pendingAreaId",void 0),w=(0,i.Cg)([(0,r.EM)("ha-area-picker")],w),t()}catch(e){t(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),h=a(22792),c=a(59992),p=a(14503),u=a(22348),g=e([o]);o=(g.then?(await g)():g)[0];const v=300,m=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"]),b=new Set(["volume-slider-container","forecast"]);class y extends((0,c.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 ${v}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},v)}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:${v}ms;--hide-duration:${v}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,u.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||m.has(e.localName)||Array.from(e.classList).some(e=>b.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"})],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:h.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),t()}catch(e){t(e)}})},93444(e,t,a){var i=a(62826),o=a(5124),r=a(22441);class s extends o.WF{render(){return o.qy` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `}static get styles(){return[o.AH`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}}s=(0,i.Cg)([(0,r.EM)("ha-dialog-footer")],s)},76538(e,t,a){var i=a(62826),o=a(5124),r=a(22441);class s extends o.WF{render(){const e=o.qy`<div class="header-title"> <slot name="title"></slot> </div>`,t=o.qy`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`;return o.qy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${"above"===this.subtitlePosition?o.qy`${t}${e}`:o.qy`${e}${t}`} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}static get styles(){return[o.AH`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`]}constructor(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,i.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],s.prototype,"subtitlePosition",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],s.prototype,"showBorder",void 0),s=(0,i.Cg)([(0,r.EM)("ha-dialog-header")],s)},72554(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),o=a(93900),r=a(35211),s=a(5124),n=a(22441),l=a(63672),d=a(1087),h=a(64481),c=a(22792),p=a(59992),u=a(14503),g=a(22348),v=(a(76538),a(26300)),m=e([o,v]);[o,v]=m.then?(await m)():m;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";class y extends((0,p.V)(s.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(e){super.updated(e),e.has("open")&&(this._open=this.open)}render(){return s.qy` <wa-dialog .open="${this._open}" .lightDismiss="${!this.preventScrimClose}" without-header aria-labelledby="${(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0))}" aria-describedby="${(0,l.J)(this.ariaDescribedBy)}" @keydown="${this._handleKeyDown}" @wa-hide="${this._handleHide}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-after-hide="${this._handleAfterHide}"> ${this.withoutHeader?s.s6:s.qy`<slot name="header"> <ha-dialog-header .subtitlePosition="${this.headerSubtitlePosition}" .showBorder="${this._bodyScrolled}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${this._i18n?.localize?.("ui.common.close")??"Close"}" .path="${b}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?s.qy`<span slot="title" class="title" id="ha-dialog-title"> ${this.headerTitle} </span>`:s.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?s.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:s.qy`<slot name="headerSubtitle" slot="subtitle"></slot>`} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${this._handleBodyScroll}"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,h.J)(()=>{this._setFullscreen(e.detail)}):this._setFullscreen(e.detail)}_setFullscreen(e){this.toggleAttribute("fullscreen",e)}_handleBodyScroll(e){this._bodyScrolled=e.target.scrollTop>0}_handleKeyDown(e){"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)}_handleHide(e){const t=e.detail?.source===e.target.dialog;this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,u.dp,s.AH`wa-dialog{--full-width:var(
            --ha-dialog-width-full,
            min(95vw, var(--safe-width))
          );--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var(
            --ha-dialog-surface-background,
            var(--card-background-color, var(--ha-color-surface-default))
          );--wa-panel-border-radius:var(
            --ha-dialog-border-radius,
            var(--ha-border-radius-3xl)
          );max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var(
            --ha-dialog-header-title-font-size,
            var(--ha-font-size-2xl)
          );line-height:var(
            --ha-dialog-header-title-line-height,
            var(--ha-line-height-condensed)
          );font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}constructor(...e){super(...e),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{if(this._hassConfig?.auth.external&&(0,g.V)(this._hassConfig.auth.external)){const e=this.querySelector("[autofocus]");return void(null!==e&&(e.id||(e.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})))}this.querySelector("[autofocus]")?.focus()}))},this._handleAfterShow=e=>{e.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,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,reflect:!0})],y.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({reflect:!0})],y.prototype,"type",void 0),(0,i.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],y.prototype,"width",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.MZ)({attribute:"header-title"})],y.prototype,"headerTitle",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],y.prototype,"headerSubtitle",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],y.prototype,"headerSubtitlePosition",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,attribute:"without-header"})],y.prototype,"withoutHeader",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_open",void 0),(0,i.Cg)([(0,n.P)(".body")],y.prototype,"bodyContainer",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.D5,subscribe:!0})],y.prototype,"_i18n",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.wk)()],y.prototype,"_bodyScrolled",void 0),(0,i.Cg)([(0,n.Ls)({passive:!0})],y.prototype,"_handleBodyScroll",null),y=(0,i.Cg)([(0,n.EM)("ha-dialog")],y),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),h=a(1087),c=a(22792),p=a(17894),u=a(22348),g=a(99611),v=a(18350),m=(a(75064),a(3449),a(49639)),b=a(88285),y=(a(67094),e([o,g,v,m,b]));[o,g,v,m,b]=y.then?(await y)():y;const _="M3 16H10V14H3M18 14V10H16V14H12V16H16V20H18V16H22V14M14 6H3V8H14M14 10H3V12H14V10Z";class f 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,h.r)(this,"value-changed",{value:this._newValue}),this._newValue=void 0),this._opened=!1,this._pickerWrapperOpen=!1,this._selectedValue=void 0,this._unsubscribeTinyKeys?.(),(0,h.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,h.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,h.r)(this,"picker-opened"),requestAnimationFrame(()=>{this._initialFieldValue&&(this._comboBox?.setFieldValue(this._initialFieldValue),this._initialFieldValue=void 0),this._hassConfig?.auth.external&&(0,u.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()}}}f.shadowRootOptions={...s.WF.shadowRootOptions,delegatesFocus:!0},(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"allow-custom-value"})],f.prototype,"allowCustomValue",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"search-label"})],f.prototype,"searchLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"getItems",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"getAdditionalItems",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"rowRenderer",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"searchFn",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"searchKeys",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"notFoundLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"empty-label"})],f.prototype,"emptyLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"popover-placement"})],f.prototype,"popoverPlacement",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"add-button-label"})],f.prototype,"addButtonLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"sections",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"sectionTitleFunction",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"selected-section"})],f.prototype,"selectedSection",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"popoverAnchor",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"use-top-label"})],f.prototype,"useTopLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"custom-value-label"})],f.prototype,"customValueLabel",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-sort"})],f.prototype,"noSort",void 0),(0,i.Cg)([(0,n.P)(".container")],f.prototype,"_containerElement",void 0),(0,i.Cg)([(0,n.P)("ha-picker-combo-box")],f.prototype,"_comboBox",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.wk)()],f.prototype,"_opened",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_pickerWrapperOpen",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_popoverWidth",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_openedNarrow",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_unknownValue",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_selectedValue",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"error-message"})],f.prototype,"errorMessage",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],f.prototype,"invalid",void 0),f=(0,i.Cg)([(0,n.EM)("ha-generic-picker")],f),t()}catch(e){t(e)}})},64138(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HaIconPicker:()=>y});a(74423),a(44114),a(18111),a(22489),a(7588),a(61701),a(13579);var o=a(62826),r=a(5124),s=a(22441),n=a(22786),l=a(1087),d=a(700),h=(a(75064),a(38508)),c=(a(47680),e([h]));h=(c.then?(await c)():c)[0];let p=[],u=!1;const g=(e,t)=>{const a=`${t}:${e.name}`,i=e.name,o=i.split("-"),r=e.keywords??[],s={iconName:i};return o.forEach((e,t)=>{s[`part${t}`]=e}),r.forEach((e,t)=>{s[`keyword${t}`]=e}),{id:a,primary:a,icon:a,search_labels:s,sorting_label:a}},v=async()=>{u=!0;const e=await a.e(81340).then(a.t.bind(a,25143,19));p=e.default.map(e=>g(e,"mdi"));const t=[];Object.keys(d.y).forEach(e=>{t.push(m(e))}),(await Promise.all(t)).forEach(e=>{p.push(...e)})},m=async e=>{try{const t=d.y[e].getIconList;if("function"!=typeof t)return[];return(await t()).map(t=>g(t,e))}catch(t){return console.warn(`Unable to load icon list for ${e} iconset`),[]}},b=e=>r.qy` <ha-combo-box-item type="button"> <ha-icon .icon="${e.id}" slot="start"></ha-icon> ${e.id} </ha-combo-box-item> `;class y extends r.WF{render(){return r.qy` <ha-generic-picker allow-custom-value .getItems="${this._getIconPickerItems}" .helper="${this.helper}" .disabled="${this.disabled}" .required="${this.required}" .errorMessage="${this.errorMessage}" .invalid="${this.invalid}" .rowRenderer="${b}" .icon="${this._icon}" .label="${this.label}" .value="${this._value}" .searchFn="${this._filterIcons}" @value-changed="${this._valueChanged}"> <slot name="start"></slot> </ha-generic-picker> `}firstUpdated(){u||v().then(()=>{this._getIconPickerItems=()=>p,this.requestUpdate()})}_valueChanged(e){e.stopPropagation(),this._setValue(e.detail.value)}_setValue(e){this.value=e,(0,l.r)(this,"value-changed",{value:this._value},{bubbles:!1,composed:!1})}get _icon(){return this.value?.length?this.value:this.placeholder}get _value(){return this.value||""}constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.invalid=!1,this._getIconPickerItems=()=>p,this._filterIcons=(0,n.A)((e,t,a)=>{const i=e.toLowerCase().replace(/\s+/g,"-"),o=a?.length?a:t;if(!i.length)return o;const r=[];for(const e of o){const t=(e.id.split(":")[1]||e.id).toLowerCase().split("-"),a=e.search_labels?Object.values(e.search_labels).filter(e=>null!==e).map(e=>e.toLowerCase()):[],o=e.id.toLowerCase();t.includes(i)?r.push({item:e,rank:1}):a.includes(i)?r.push({item:e,rank:2}):o.includes(i)?r.push({item:e,rank:3}):a.some(e=>e.includes(i))&&r.push({item:e,rank:4})}return r.sort((e,t)=>e.rank-t.rank).map(e=>e.item)})}}y.styles=r.AH`ha-generic-picker{width:100%;display:block}`,(0,o.Cg)([(0,s.MZ)()],y.prototype,"value",void 0),(0,o.Cg)([(0,s.MZ)()],y.prototype,"label",void 0),(0,o.Cg)([(0,s.MZ)()],y.prototype,"helper",void 0),(0,o.Cg)([(0,s.MZ)()],y.prototype,"placeholder",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"error-message"})],y.prototype,"errorMessage",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"disabled",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"required",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"invalid",void 0),y=(0,o.Cg)([(0,s.EM)("ha-icon-picker")],y),i()}catch(e){i(e)}})},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)},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),h=a(17894),c=(a(75064),a(47680),a(26300)),p=e([c]);c=(p.then?(await p)():p)[0];const u="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",g="M7,10L12,15L17,10H7Z";class v extends((0,h.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="${u}"></ha-icon-button> `:r.s6} <ha-svg-icon class="arrow" slot="end" .path="${g}"></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})],v.prototype,"invalid",void 0),(0,i.Cg)([(0,s.P)("ha-combo-box-item",!0)],v.prototype,"item",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:d.D5,subscribe:!0})],v.prototype,"_i18n",void 0),v=(0,i.Cg)([(0,s.EM)("ha-picker-field")],v),t()}catch(e){t(e)}})},8034(e,t,a){var i=a(62826),o=a(92070),r=a(5124),s=a(22441);class n extends r.WF{render(){const e=this._hasSlotController.test("description");return r.qy` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" part="heading" ?two-line="${!this.threeLine&&e}" ?three-line="${this.threeLine}"> <slot name="heading"></slot> ${e?r.qy`<span class="secondary"><slot name="description"></slot></span>`:r.s6} </div> </div> <div class="content"> <slot></slot> </div> `}constructor(...e){super(...e),this.narrow=!1,this.slim=!1,this.threeLine=!1,this.wrapHeading=!1,this.empty=!1,this._hasSlotController=new o.X(this,"description")}}n.styles=r.AH`:host{display:flex;padding:0 var(--ha-space-4);align-content:normal;align-self:auto;align-items:center}.body{padding-top:var(--settings-row-body-padding-top,var(--ha-space-2));padding-bottom:var(--settings-row-body-padding-bottom,var(--ha-space-2));padding-left:0;padding-inline-start:0;padding-right:var(--ha-space-4);padding-inline-end:var(--ha-space-4);overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:88px}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:var(--ha-space-1);font-family:var(
        --mdc-typography-body2-font-family,
        var(--mdc-typography-font-family, var(--ha-font-family-body))
      );font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(72px - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;min-width:0;padding:var(--settings-row-content-padding-block,var(--ha-space-4)) 0}:host([empty]) .content{display:none}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:var(--ha-space-2)}::slotted(ha-switch){padding:var(--settings-row-switch-padding-block,var(--ha-space-4)) 0}.secondary{white-space:normal}.prefix-wrap{flex:var(--settings-row-prefix-flex,1);display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`,(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],n.prototype,"narrow",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],n.prototype,"slim",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"three-line"})],n.prototype,"threeLine",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"wrap-heading",reflect:!0})],n.prototype,"wrapHeading",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],n.prototype,"empty",void 0),n=(0,i.Cg)([(0,s.EM)("ha-settings-row")],n)},85938(e,t,a){a(18111),a(22489),a(46058);var i=a(62826),o=a(5124),r=a(22441),s=a(1087);class n extends o.WF{updated(e){e.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}disconnectedCallback(){super.disconnectedCallback(),this._shouldBeDestroy=!0,setTimeout(()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)},1)}connectedCallback(){super.connectedCallback(),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}createRenderRoot(){return this}render(){return this.noStyle?o.s6:o.qy` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:var(--ha-border-radius-sm);opacity:.4}.sortable-drag{border-radius:var(--ha-border-radius-sm);opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `}async _createSortable(){if(this._sortable)return;const e=this.children[0];if(!e)return;const t=(await Promise.all([a.e(85283),a.e(70322)]).then(a.bind(a,80745))).default,i={scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150,...this.options,onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove};this.draggableSelector&&(i.draggable=this.draggableSelector),this.handleSelector&&(i.handle=this.handleSelector),void 0!==this.invertSwap&&(i.invertSwap=this.invertSwap),this.group&&(i.group=this.group),this.filter&&(i.filter=this.filter),this._sortable=new t(e,i)}_destroySortable(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}constructor(...e){super(...e),this.disabled=!1,this.noStyle=!1,this.invertSwap=!1,this.rollback=!0,this._shouldBeDestroy=!1,this._handleUpdate=e=>{(0,s.r)(this,"item-moved",{newIndex:e.newIndex,oldIndex:e.oldIndex})},this._handleAdd=e=>{(0,s.r)(this,"item-added",{index:e.newIndex,data:e.item.sortableData,item:e.item})},this._handleRemove=e=>{(0,s.r)(this,"item-removed",{index:e.oldIndex})},this._handleEnd=async e=>{(0,s.r)(this,"drag-end"),this.rollback&&e.item.placeholder&&(e.item.placeholder.replaceWith(e.item),delete e.item.placeholder)},this._handleStart=()=>{(0,s.r)(this,"drag-start")},this._handleChoose=e=>{this.rollback&&(e.item.placeholder=document.createComment("sort-placeholder"),e.item.after(e.item.placeholder))}}}(0,i.Cg)([(0,r.MZ)({type:Boolean})],n.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"no-style"})],n.prototype,"noStyle",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"draggable-selector"})],n.prototype,"draggableSelector",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"handle-selector"})],n.prototype,"handleSelector",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"filter"})],n.prototype,"filter",void 0),(0,i.Cg)([(0,r.MZ)({type:String})],n.prototype,"group",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"invert-swap"})],n.prototype,"invertSwap",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],n.prototype,"options",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],n.prototype,"rollback",void 0),n=(0,i.Cg)([(0,r.EM)("ha-sortable")],n)},26613(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(75751),l=a(1087),d=a(22792),h=a(14503),c=a(18350),p=a(26300),u=(a(3449),a(85938),a(91485)),g=e([c,p,u]);[c,p,u]=g.then?(await g)():g;const v="M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z",m="M21 11H3V9H21V11M21 13H3V15H21V13Z",b="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class y extends r.WF{render(){return r.qy` <ha-sortable handle-selector=".handle" draggable-selector=".row" .disabled="${!this.sortable||this.disabled}" @item-moved="${this._itemMoved}"> <div class="items"> ${(0,n.u)(this._items,(e,t)=>`${e}-${t}`,(e,t)=>{const a=""+(this.itemIndex?` ${t+1}`:"");return r.qy` <div class="layout horizontal center-center row"> <ha-input .type="${this.inputType}" .autocomplete="${this.autocomplete}" .disabled="${this.disabled}" dialogInitialFocus="${t}" .index="${t}" class="flex-auto" .label="${""+(this.label?`${this.label}${a}`:"")}" .value="${e}" ?data-last="${t===this._items.length-1}" @input="${this._editItem}" @change="${this._editItem}" @keydown="${this._keyDown}"> ${this.inputPrefix?r.qy`<span slot="start">${this.inputPrefix}</span>`:r.s6} ${this.inputSuffix?r.qy`<span slot="end">${this.inputSuffix}</span>`:r.s6} </ha-input> <ha-icon-button .disabled="${this.disabled}" .index="${t}" slot="navigationIcon" .label="${this.removeLabel??this._i18n?.localize("ui.common.remove")??"Remove"}" @click="${this._removeItem}" .path="${v}"></ha-icon-button> ${this.sortable?r.qy`<ha-svg-icon class="handle" .path="${m}"></ha-svg-icon>`:r.s6} </div> `})} </div> </ha-sortable> <div class="layout horizontal"> <ha-button size="small" appearance="filled" @click="${this._addItem}" .disabled="${this.disabled||null!=this.max&&this._items.length>=this.max}"> <ha-svg-icon slot="start" .path="${b}"></ha-svg-icon> ${this.addLabel??(this.label?this._i18n?.localize("ui.components.multi-textfield.add_item",{item:this.label}):this._i18n?.localize("ui.common.add"))??"Add"} </ha-button> </div> ${this.helper?r.qy`<ha-input-helper-text .disabled="${this.disabled}">${this.helper}</ha-input-helper-text>`:r.s6} `}get _items(){return this.value??[]}async _addItem(){if(null!=this.max&&this._items.length>=this.max)return;const e=[...this._items,""];this._fireChanged(e),await this.updateComplete,this._lastInput?.focus()}async _editItem(e){if(this.updateOnBlur&&"input"===e.type)return;if(!this.updateOnBlur&&"change"===e.type)return;const t=e.target.index,a=[...this._items];a[t]=e.target.value,this._fireChanged(a)}async _keyDown(e){"Enter"===e.key&&(e.stopPropagation(),this._addItem())}_itemMoved(e){e.stopPropagation();const{oldIndex:t,newIndex:a}=e.detail,i=[...this._items],[o]=i.splice(t,1);i.splice(a,0,o),this._fireChanged(i)}async _removeItem(e){const t=e.target.index,a=[...this._items];a.splice(t,1),this._fireChanged(a)}_fireChanged(e){this.value=e,(0,l.r)(this,"value-changed",{value:e})}static get styles(){return[h.RF,r.AH`.row{margin-bottom:8px;--ha-input-padding-bottom:0}ha-icon-button{display:block}.handle{cursor:grab;padding:8px;margin:-8px}`]}constructor(...e){super(...e),this.disabled=!1,this.itemIndex=!1,this.sortable=!1,this.updateOnBlur=!1}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"value",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"disabled",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"helper",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"input-type"})],y.prototype,"inputType",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"input-suffix"})],y.prototype,"inputSuffix",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"input-prefix"})],y.prototype,"inputPrefix",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"autocomplete",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"add-label"})],y.prototype,"addLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"remove-label"})],y.prototype,"removeLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"item-index",type:Boolean})],y.prototype,"itemIndex",void 0),(0,i.Cg)([(0,s.MZ)({type:Number})],y.prototype,"max",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"sortable",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"update-on-blur"})],y.prototype,"updateOnBlur",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:d.D5,subscribe:!0})],y.prototype,"_i18n",void 0),(0,i.Cg)([(0,s.P)("ha-input[data-last]")],y.prototype,"_lastInput",void 0),y=(0,i.Cg)([(0,s.EM)("ha-input-multi")],y),t()}catch(e){t(e)}})},36866(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),o=a(5124),r=a(22441),s=a(91485),n=e([s]);s=(n.then?(await n)():n)[0];const l="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 d extends s.U{willUpdate(e){super.willUpdate(e),this.label||this.placeholder||this.hasUpdated&&!e.has("_i18n")||(this.placeholder=this.i18n?.localize?.("ui.common.search")||"Search")}renderStartDefault(){return o.qy`<ha-svg-icon slot="start" .path="${l}"></ha-svg-icon>`}constructor(){super(),this.withClear=!0,this.autocomplete=this.autocomplete||"off"}}d.styles=[...s.U.styles,o.AH`:host([appearance=outlined]) wa-input.no-label::part(base){height:40px}`],d=(0,i.Cg)([(0,r.EM)("ha-input-search")],d),t()}catch(e){t(e)}})},91485(e,t,a){a.a(e,async function(e,i){try{a.d(t,{U:()=>w});var o=a(62826),r=(a(86137),a(30006)),s=a(92070),n=a(35211),l=a(5124),d=a(22441),h=a(6412),c=a(63672),p=a(57237),u=a(22792),g=a(26300),v=(a(67094),a(34127)),m=a(53305),b=e([r,g,v]);[r,g,v]=b.then?(await b)():b;const y="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",_="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",f="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z";class w extends((0,m.w)(l.WF)){get _formControl(){return this._input}showPicker(){this._input?.showPicker()}stepUp(){this._input?.stepUp()}stepDown(){this._input?.stepDown()}async firstUpdated(e){super.firstUpdated(e),this.insetLabel||(await(this._input?.updateComplete),this._syncStartSlotWidth())}render(){const e=!this.label&&this._hasSlotController.test("label"),t=!this.hint&&this._hasSlotController.test("hint"),a=this._hasSlotController.test("start");return l.qy` <wa-input .type="${this.type}" .value="${this.value??null}" .withClear="${this.withClear}" .placeholder="${this.placeholder}" .readonly="${this.readonly}" .passwordToggle="${this.passwordToggle}" .passwordVisible="${this.passwordVisible}" .withoutSpinButtons="${this.withoutSpinButtons}" .required="${this.required}" .pattern="${this.pattern}" .minlength="${this.minlength}" .maxlength="${this.maxlength}" .min="${this.min}" .max="${this.max}" .step="${this.step}" .autocapitalize="${this.autocapitalize||void 0}" .autocorrect="${this.autocorrect?"on":"off"}" .autocomplete="${this.autocomplete}" .autofocus="${this.autofocus}" .enterkeyhint="${this.enterkeyhint||void 0}" .spellcheck="${this.spellcheck}" .inputmode="${this.inputmode||void 0}" .name="${this.name}" .disabled="${this.disabled}" class="${(0,h.H)({input:!0,invalid:this.invalid||this._invalid,"label-raised":void 0!==this.value&&""!==this.value||this.label&&this.placeholder||a&&this.insetLabel,"no-label":!this.label,"hint-hidden":!(this.hint||t||this.required||this._invalid||this.invalid)})}" @input="${this._handleInput}" @change="${this._handleChange}" @blur="${this._handleBlur}" @wa-invalid="${this._handleInvalid}" exportparts="base:wa-base, hint:wa-hint, input:wa-input"> ${this.label||e?l.qy`<slot name="label" slot="label">${this.label?this._renderLabel(this.label,this.required):l.s6}</slot>`:l.s6} <slot name="start" slot="start" @slotchange="${this._syncStartSlotWidth}"> ${this.renderStartDefault()} </slot> <slot name="end" slot="end"> ${this.renderEndDefault()} </slot> <slot name="clear-button" slot="clear-button"> <ha-icon-button @click="${this._handleClearClick}" .label="${this.i18n?.localize?.("ui.components.input.clear")||"Clear"}" .path="${y}"></ha-icon-button> </slot> <slot name="password-toggle-button" slot="password-toggle-button"> <ha-icon-button @keydown="${p.d}" @click="${this._handlePasswordToggle}" .label="${this.i18n?.localize?.("ui.components.input."+(this.passwordVisible?"hide_password":"show_password"))||(this.passwordVisible?"Hide password":"Show password")}" .path="${this.passwordVisible?f:_}"></ha-icon-button> </slot> <div slot="hint" class="${(0,h.H)({error:this.invalid||this._invalid})}" role="${(0,c.J)(this.invalid||this._invalid?"alert":void 0)}" aria-live="polite"> ${this._invalid||this.invalid?this.validationMessage||this._input?.validationMessage:this.hint||(t?l.qy`<slot name="hint"></slot>`:l.s6)} </div> </wa-input> `}renderStartDefault(){return l.s6}renderEndDefault(){return l.s6}_handleClearClick(){this._input?.clear()}_handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}constructor(...e){super(...e),this.appearance="material",this.type="text",this.withClear=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.withoutSpinButtons=!1,this.autocorrect=!1,this.insetLabel=!1,this._hasSlotController=new s.X(this,"label","hint","input","start"),this._syncStartSlotWidth=()=>{const e=this._input?.shadowRoot?.querySelector('[part~="start"]'),t=e?.offsetWidth??0;t>0&&!this.insetLabel?(this.style.setProperty("--start-slot-width",`calc(${t}px + var(--ha-space-1))`),this.style.setProperty("--input-padding-inline-start","var(--ha-space-1)")):(this.style.removeProperty("--start-slot-width"),this.style.removeProperty("--input-padding-inline-start"))}}}w.styles=[m.N,l.AH`:host{display:flex;align-items:flex-start;padding-top:var(--ha-input-padding-top);padding-bottom:var(--ha-input-padding-bottom,var(--ha-space-2));text-align:var(--ha-input-text-align,start)}:host([appearance=outlined]){padding-bottom:var(--ha-input-padding-bottom)}wa-input::part(label){padding-inline-start:calc(var(--start-slot-width,0px) + var(--ha-space-4));padding-inline-end:var(--ha-space-4);padding-top:var(--ha-space-5)}:host([appearance=material]:focus-within) wa-input::part(label){color:var(--primary-color)}:host(:focus-within) wa-input::part(label),:host([type=date]) wa-input::part(label),wa-input.label-raised::part(label){padding-top:var(--ha-space-3);font-size:var(--ha-font-size-xs)}wa-input::part(base){height:56px;padding:0 var(--ha-space-4)}:host([appearance=outlined]) wa-input.no-label::part(base){height:32px;padding:0 var(--ha-space-2)}:host([appearance=outlined]) wa-input::part(base){border:1px solid var(--ha-color-border-neutral-quiet);background-color:var(--card-background-color);border-radius:var(--ha-border-radius-md);transition:border-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]) ::part(base)::after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:var(--ha-color-border-neutral-loud);transition:height var(--wa-transition-normal) ease-in-out,background-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]:focus-within) wa-input::part(base)::after{height:2px;background-color:var(--primary-color)}:host([appearance=material]) wa-input.invalid:not([disabled])::part(base)::after,:host([appearance=material]:focus-within) wa-input.invalid::part(base)::after{background-color:var(--ha-color-border-danger-normal)}wa-input::part(input){padding-top:var(--ha-space-3);padding-inline-start:var(--input-padding-inline-start,0)}wa-input.no-label::part(input){padding-top:0}:host([type=color]) wa-input::part(input){padding-top:var(--ha-space-6);padding-bottom:2px;cursor:pointer}:host([type=color]) wa-input.no-label::part(input){padding:var(--ha-space-2)}:host([type=color]) wa-input.no-label::part(base){padding:0}wa-input::part(input)::placeholder{color:var(--ha-color-neutral-60)}wa-input::part(base):hover{background-color:var(--ha-color-form-background-hover)}:host([appearance=outlined]) wa-input::part(base):hover{border-color:var(--ha-color-border-neutral-normal)}:host([appearance=outlined]:focus-within) wa-input::part(base){border-color:var(--primary-color)}wa-input:disabled::part(base){background-color:var(--ha-color-form-background-disabled)}wa-input:disabled::part(label){opacity:.5}wa-input::part(end){color:var(--ha-color-text-secondary)}ha-icon-button{display:flex;align-items:center;color:var(--ha-color-text-secondary)}:host([appearance=outlined]) wa-input.no-label{--ha-icon-button-size:24px;--mdc-icon-size:18px}`],(0,o.Cg)([(0,d.MZ)({reflect:!0})],w.prototype,"appearance",void 0),(0,o.Cg)([(0,d.MZ)({reflect:!0})],w.prototype,"type",void 0),(0,o.Cg)([(0,d.MZ)({type:Boolean,attribute:"with-clear"})],w.prototype,"withClear",void 0),(0,o.Cg)([(0,d.MZ)({type:Boolean,attribute:"password-toggle"})],w.prototype,"passwordToggle",void 0),(0,o.Cg)([(0,d.MZ)({type:Boolean,attribute:"password-visible"})],w.prototype,"passwordVisible",void 0),(0,o.Cg)([(0,d.MZ)({type:Boolean,attribute:"without-spin-buttons"})],w.prototype,"withoutSpinButtons",void 0),(0,o.Cg)([(0,d.MZ)()],w.prototype,"pattern",void 0),(0,o.Cg)([(0,d.MZ)()],w.prototype,"min",void 0),(0,o.Cg)([(0,d.MZ)()],w.prototype,"max",void 0),(0,o.Cg)([(0,d.MZ)()],w.prototype,"step",void 0),(0,o.Cg)([(0,d.MZ)({type:Boolean})],w.prototype,"autocorrect",void 0),(0,o.Cg)([(0,d.MZ)({type:Boolean,attribute:"inset-label"})],w.prototype,"insetLabel",void 0),(0,o.Cg)([(0,d.P)("wa-input")],w.prototype,"_input",void 0),(0,o.Cg)([(0,d.wk)(),(0,n.Fg)({context:u.D5,subscribe:!0})],w.prototype,"i18n",void 0),w=(0,o.Cg)([(0,d.EM)("ha-input")],w),i()}catch(e){i(e)}})},53305(e,t,a){a.d(t,{w:()=>l,N:()=>d});var i=a(62826),o=a(5124),r=a(22441),s=a(22786);a(74423);const n=Boolean(globalThis.ElementInternals)&&globalThis.HTMLElement?.prototype.attachInternals?.toString().includes("[native code]"),l=e=>{class t extends e{get _formControl(){throw new Error("_formControl getter must be implemented by subclass")}select(){this._formControl?.select()}setSelectionRange(e,t,a){this._formControl?.setSelectionRange(e,t,a)}setRangeText(e,t,a,i){this._formControl?.setRangeText(e,t,a,i)}checkValidity(){return!n||(this._formControl?.checkValidity()??!0)}reportValidity(){const e=this.checkValidity();return this._invalid=!e,e}_handleInput(){this.value=this._formControl?.value??void 0,this._invalid&&this._formControl?.checkValidity()&&(this._invalid=!1)}_handleChange(){this.value=this._formControl?.value??void 0}_handleBlur(){this.autoValidate&&(this._invalid=!this._formControl?.checkValidity())}_handleInvalid(){this._invalid=!0}constructor(...e){super(...e),this.label="",this.hint="",this.placeholder="",this.readonly=!1,this.required=!1,this.autocapitalize="",this.autofocus=!1,this.spellcheck=!0,this.inputmode="",this.enterkeyhint="",this.disabled=!1,this.validationMessage="",this.autoValidate=!1,this.invalid=!1,this._invalid=!1,this._requiredMarkerCSSVar="--ha-input-required-marker",this._renderLabel=(0,s.A)((e,t)=>{if(!t)return e;let a=getComputedStyle(this).getPropertyValue(this._requiredMarkerCSSVar);return a||(a="*"),a.startsWith('"')&&a.endsWith('"')&&(a=a.slice(1,-1)),a?`${e}${a}`:e})}}return t.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,i.Cg)([(0,r.MZ)()],t.prototype,"value",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"hint",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"placeholder",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],t.prototype,"readonly",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],t.prototype,"required",void 0),(0,i.Cg)([(0,r.MZ)({type:Number})],t.prototype,"minlength",void 0),(0,i.Cg)([(0,r.MZ)({type:Number})],t.prototype,"maxlength",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"autocapitalize",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"autocomplete",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],t.prototype,"autofocus",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],t.prototype,"spellcheck",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"inputmode",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"enterkeyhint",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"name",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],t.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"validation-message"})],t.prototype,"validationMessage",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"auto-validate"})],t.prototype,"autoValidate",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],t.prototype,"invalid",void 0),(0,i.Cg)([(0,r.wk)()],t.prototype,"_invalid",void 0),t},d=o.AH`.input{flex:1;min-width:0;--wa-transition-fast:var(--wa-transition-normal);position:relative}.input::part(label){position:absolute;top:0;font-weight:var(--ha-font-weight-normal);font-family:var(--ha-font-family-body);transition:all var(--wa-transition-normal) ease-in-out;color:var(--secondary-text-color);line-height:var(--ha-line-height-condensed);z-index:1;pointer-events:none;font-size:var(--ha-font-size-m)}.input.invalid:not([disabled])::part(label),:host(:focus-within) .input.invalid::part(label){color:var(--ha-color-fill-danger-loud-resting)}.input::part(base){background-color:var(--ha-color-form-background);border-top-left-radius:var(--ha-border-radius-sm);border-top-right-radius:var(--ha-border-radius-sm);border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square);border:none;position:relative;transition:background-color var(--wa-transition-normal) ease-in-out}:host(:focus-within) .input::part(base){outline:0}.input::part(hint){min-height:var(--ha-space-5);margin-block-start:0;margin-inline-start:var(--ha-space-3);font-size:var(--ha-font-size-s);display:flex;align-items:center;color:var(--ha-color-text-secondary)}.input.hint-hidden::part(hint){height:0;min-height:0}.error{color:var(--ha-color-on-danger-quiet)}`},49852(e,t,a){a.d(t,{P:()=>d,j:()=>l});a(74423),a(18111),a(81148),a(22489),a(61701),a(13579);var i=a(65522),o=a(71727),r=a(55931),s=a(66033),n=a(58594);const l=(e,t,a,l,d,h,c,p,u,g,v,m="")=>{let b,y,_={};const f=Object.values(e),w=Object.values(a),C=Object.values(l);(h||c||p||u||g)&&(_=(0,n.g2)(C),b=w,y=C.filter(e=>e.area_id),h&&(b=b.filter(e=>{const t=_[e.id];return!(!t||!t.length)&&_[e.id].some(e=>h.includes((0,o.m)(e.entity_id)))}),y=y.filter(e=>h.includes((0,o.m)(e.entity_id)))),c&&(b=b.filter(e=>{const t=_[e.id];return!t||!t.length||C.every(e=>!c.includes((0,o.m)(e.entity_id)))}),y=y.filter(e=>!c.includes((0,o.m)(e.entity_id)))),p&&(b=b.filter(e=>{const t=_[e.id];return!(!t||!t.length)&&_[e.id].some(e=>{const t=d[e.entity_id];return!!t&&(t.attributes.device_class&&p.includes(t.attributes.device_class))})}),y=y.filter(e=>{const t=d[e.entity_id];return t.attributes.device_class&&p.includes(t.attributes.device_class)})),u&&(b=b.filter(e=>u(e))),g&&(b=b.filter(e=>{const t=_[e.id];return!(!t||!t.length)&&_[e.id].some(e=>{const t=d[e.entity_id];return!!t&&g(t)})}),y=y.filter(e=>{const t=d[e.entity_id];return!!t&&g(t)})));let x,$=f;b&&(x=b.filter(e=>e.area_id).map(e=>e.area_id)),y&&(x=(x??[]).concat(y.filter(e=>e.area_id).map(e=>e.area_id))),x&&($=$.filter(e=>x.includes(e.area_id))),v&&($=$.filter(e=>!v.includes(e.area_id)));return $.map(e=>{const{floor:a}=(0,s.L)(e,t),o=a?(0,r.X)(a):void 0,n=(0,i.A)(e);return{id:`${m}${e.area_id}`,primary:n||e.area_id,secondary:o,icon:e.icon||void 0,icon_path:e.icon?void 0:"M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z",search_labels:{areaId:e.area_id,aliases:e.aliases.join(" ")}}})},d=[{name:"primary",weight:10},{name:"search_labels.aliases",weight:8},{name:"secondary",weight:6},{name:"search_labels.domain",weight:4},{name:"search_labels.areaId",weight:2}]},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}},59992(e,t,a){a.d(t,{V:()=>l});var i=a(62826),o=a(88696),r=a(5124),s=a(6412),n=a(22441);const l=e=>{class t extends e{get scrollableElement(){return t.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(e){super.firstUpdated?.(e),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(e){super.updated?.(e),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(e=!1){return r.qy` <div class="${(0,s.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled})}"></div> <div class="${(0,s.H)({"fade-bottom":!0,rounded:e,visible:this._contentScrollable})}"></div> `}static get styles(){const e=Object.getPrototypeOf(this);var t;return[...void 0===(t=e?.styles??[])?[]:Array.isArray(t)?t:[t],r.AH`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`]}_attachScrollableElement(){const e=this.scrollableElement;e!==this._scrollTarget&&(this._detachScrollableElement(),e&&(this._scrollTarget=e,e.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(e),this._updateScrollableState(e)))}_detachScrollableElement(){this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),this._resize.unobserve?.(this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(e){const t=parseFloat(getComputedStyle(e).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:i=0,scrollTop:o=0}=e;this._contentScrollable=a-i>o+t+this.scrollFadeSafeAreaPadding}constructor(...e){super(...e),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=e=>{const t=e.currentTarget;this._contentScrolled=(t.scrollTop??0)>this.scrollFadeThreshold,this._updateScrollableState(t)},this._resize=new o.P(this,{target:null,callback:e=>{const t=e[0]?.target;t&&this._updateScrollableState(t)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return t.DEFAULT_SCROLLABLE_ELEMENT=null,(0,i.Cg)([(0,n.wk)()],t.prototype,"_contentScrolled",void 0),(0,i.Cg)([(0,n.wk)()],t.prototype,"_contentScrollable",void 0),t}},91622(e,t,a){a.a(e,async function(e,i){try{a.r(t);a(18111),a(22489),a(61701),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var o=a(62826),r=a(5124),s=a(22441),n=a(75751),l=a(22786),d=a(1087),h=(a(5745),a(13467),a(38962)),c=a(832),p=a(66086),u=a(18350),g=a(72554),v=(a(93444),a(18198),a(64138)),m=(a(8034),a(67094),a(91485)),b=a(2514),y=a(14503),_=a(34023),f=e([h,c,p,u,g,v,m]);[h,c,p,u,g,v,m]=f.then?(await f)():f;const w="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z";class C extends r.WF{showDialog(e){this._params=e,this._error=void 0,this._name=this._params.entry?this._params.entry.name:this._params.suggestedName||"",this._aliases=this._params.entry?.aliases||[],this._icon=this._params.entry?.icon||null,this._level=this._params.entry?.level??null,this._addedAreas.clear(),this._removedAreas.clear(),this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._error="",this._params=void 0,this._addedAreas.clear(),this._removedAreas.clear(),(0,d.r)(this,"dialog-closed",{dialog:this.localName})}render(){const e=this._floorAreas(this._params?.entry,this.hass.areas,this._addedAreas,this._removedAreas);if(!this._params)return r.s6;const t=this._params.entry;return r.qy` <ha-dialog .open="${this._open}" header-title="${t?this.hass.localize("ui.panel.config.floors.editor.update_floor"):this.hass.localize("ui.panel.config.floors.editor.create_floor")}" prevent-scrim-close @closed="${this._dialogClosed}"> <div> ${this._error?r.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:""} <div class="form"> ${t?r.qy` <ha-settings-row> <span slot="heading"> ${this.hass.localize("ui.panel.config.floors.editor.floor_id")} </span> <span slot="description">${t.floor_id}</span> </ha-settings-row> `:r.s6} <ha-input autofocus .value="${this._name}" @input="${this._nameChanged}" .label="${this.hass.localize("ui.panel.config.floors.editor.name")}" .validationMessage="${this.hass.localize("ui.panel.config.floors.editor.name_required")}" required auto-validate></ha-input> <ha-input .value="${this._level}" @input="${this._levelChanged}" .label="${this.hass.localize("ui.panel.config.floors.editor.level")}" type="number" .hint="${this.hass.localize("ui.panel.config.floors.editor.level_helper")}"></ha-input> <ha-icon-picker .hass="${this.hass}" .value="${this._icon}" @value-changed="${this._iconChanged}" .label="${this.hass.localize("ui.panel.config.areas.editor.icon")}"> ${this._icon?r.s6:r.qy` <ha-floor-icon slot="start" .floor="${{level:this._level}}"></ha-floor-icon> `} </ha-icon-picker> <h3 class="header"> ${this.hass.localize("ui.panel.config.floors.editor.areas_section")} </h3> ${e.length?r.qy`<ha-chip-set> ${(0,n.u)(e,e=>e.area_id,e=>r.qy`<ha-input-chip .area="${e}" @click="${this._openArea}" @remove="${this._removeArea}" .label="${e?.name}"> ${e.icon?r.qy`<ha-icon slot="icon" .icon="${e.icon}"></ha-icon>`:r.qy`<ha-svg-icon slot="icon" .path="${w}"></ha-svg-icon>`} </ha-input-chip>`)} </ha-chip-set>`:r.qy`<p class="description"> ${this.hass.localize("ui.panel.config.floors.editor.areas_description")} </p>`} <ha-area-picker no-add .hass="${this.hass}" @value-changed="${this._addArea}" .excludeAreas="${e.map(e=>e.area_id)}" .addButtonLabel="${this.hass.localize("ui.panel.config.floors.editor.add_area")}"></ha-area-picker> <h3 class="header"> ${this.hass.localize("ui.panel.config.floors.editor.aliases_section")} </h3> <p class="description"> ${this.hass.localize("ui.panel.config.floors.editor.aliases_description")} </p> <ha-aliases-editor .hass="${this.hass}" .aliases="${this._aliases}" @value-changed="${this._aliasesChanged}"></ha-aliases-editor> </div> </div> <ha-dialog-footer slot="footer"> <ha-button appearance="plain" slot="secondaryAction" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button slot="primaryAction" @click="${this._updateEntry}" .disabled="${!!this._submitting}"> ${t?this.hass.localize("ui.common.save"):this.hass.localize("ui.common.create")} </ha-button> </ha-dialog-footer> </ha-dialog> `}_openArea(e){const t=e.target.area;(0,_.J)(this,{entry:t,updateEntry:e=>(0,b.gs)(this.hass,t.area_id,e)})}_removeArea(e){const t=e.target.area.area_id;if(this._addedAreas.has(t))return this._addedAreas.delete(t),void(this._addedAreas=new Set(this._addedAreas));this._removedAreas.add(t),this._removedAreas=new Set(this._removedAreas)}_addArea(e){const t=e.detail.value;if(t){if(e.target.value="",this._removedAreas.has(t))return this._removedAreas.delete(t),void(this._removedAreas=new Set(this._removedAreas));this._addedAreas.add(t),this._addedAreas=new Set(this._addedAreas)}}_nameChanged(e){this._error=void 0,this._name=e.target.value??""}_levelChanged(e){this._error=void 0,this._level=""===e.target.value?null:Number(e.target.value)}_iconChanged(e){this._error=void 0,this._icon=e.detail.value}async _updateEntry(){if(""===this._name.trim())return void(this._error=this.hass.localize("ui.panel.config.floors.editor.name_required"));this._error=void 0,this._submitting=!0;const e=!this._params.entry;try{const t={name:this._name.trim(),icon:this._icon||(e?void 0:null),level:this._level,aliases:this._aliases};e?await this._params.createEntry(t,this._addedAreas):await this._params.updateEntry(t,this._addedAreas,this._removedAreas),this.closeDialog()}catch(e){this._error=e.message||this.hass.localize("ui.panel.config.floors.editor.unknown_error")}finally{this._submitting=!1}}_aliasesChanged(e){this._aliases=e.detail.value}static get styles(){return[y.RF,y.nA,r.AH`ha-input{--ha-input-padding-bottom:var(--ha-space-4)}ha-floor-icon{color:var(--secondary-text-color)}ha-chip-set{margin-bottom:var(--ha-space-2)}`]}constructor(...e){super(...e),this._addedAreas=new Set,this._removedAreas=new Set,this._open=!1,this._floorAreas=(0,l.A)((e,t,a,i)=>Object.values(t).filter(t=>(t.floor_id===e?.floor_id||a.has(t.area_id))&&!i.has(t.area_id)))}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],C.prototype,"_name",void 0),(0,o.Cg)([(0,s.wk)()],C.prototype,"_aliases",void 0),(0,o.Cg)([(0,s.wk)()],C.prototype,"_icon",void 0),(0,o.Cg)([(0,s.wk)()],C.prototype,"_level",void 0),(0,o.Cg)([(0,s.wk)()],C.prototype,"_error",void 0),(0,o.Cg)([(0,s.wk)()],C.prototype,"_params",void 0),(0,o.Cg)([(0,s.wk)()],C.prototype,"_submitting",void 0),(0,o.Cg)([(0,s.wk)()],C.prototype,"_addedAreas",void 0),(0,o.Cg)([(0,s.wk)()],C.prototype,"_removedAreas",void 0),(0,o.Cg)([(0,s.wk)()],C.prototype,"_open",void 0),C=(0,o.Cg)([(0,s.EM)("dialog-floor-registry-detail")],C),i()}catch(e){i(e)}})},34023(e,t,a){a.d(t,{E:()=>o,J:()=>r});var i=a(1087);const o=()=>Promise.all([a.e(32450),a.e(7305),a.e(92769),a.e(3283),a.e(85010),a.e(89100),a.e(42209),a.e(26092),a.e(8851),a.e(66201),a.e(26295),a.e(52808),a.e(93e3),a.e(61023)]).then(a.bind(a,39803)),r=(e,t)=>{(0,i.r)(e,"show-dialog",{dialogTag:"dialog-area-registry-detail",dialogImport:o,dialogParams:t})}},22348(e,t,a){a.d(t,{V:()=>o});var i=a(37177);const o=e=>!!e&&i.n},37177(e,t,a){a.d(t,{n:()=>i});const i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},88438(e,t,a){a.d(t,{C:()=>i});const i="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}};