UNPKG

iobroker.lovelace

Version:

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

4 lines 51.4 kB
export const __rspack_esm_id=93e3;export const __rspack_esm_ids=[93e3];export const __webpack_modules__={57237(t,e,o){o.d(e,{d:()=>a});const a=t=>t.stopPropagation()},60353(t,e,o){o.d(e,{u:()=>a});class a{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={}){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=t.velocitySwipeThreshold??.5,this._movementTimeThreshold=t.movementTimeThreshold??100}}},5745(t,e,o){var a=o(62826),i=o(99731),r=o(22441);class s extends i.Y{}s=(0,a.Cg)([(0,r.EM)("ha-chip-set")],s)},99611(t,e,o){o.a(t,async function(t,e){try{o(18111),o(13579),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var a=o(62826),i=o(1126),r=o(35211),s=o(5124),n=o(22441),l=o(1087),d=o(60353),h=o(22792),c=o(59992),p=o(14503),u=o(22348),b=t([i]);i=(b.then?(await b)():b)[0];const v=300,g=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),m=new Set(["volume-slider-container","forecast"]);class _ 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(t){super.updated(t),t.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(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 ${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(...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(()=>{const t=this._autofocusElement;this._hassConfig?.auth.external&&(0,u.V)(this._hassConfig.auth.external)?t&&(t.id||(t.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})):t?.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 t of e){if(t===this._drawer)break;if(t instanceof HTMLElement&&(t.scrollTop>0||g.has(t.localName)||Array.from(t.classList).some(t=>m.has(t))))return}t.stopPropagation(),this._startResizing(t.touches[0].clientY)},this._handleTouchMove=t=>{const e=t.touches[0].clientY,o=this._gestureRecognizer.move(e);o<0&&(t.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*o}px)`)}))},this._handleTouchEnd=()=>{this._unregisterResizeHandlers(),this._isDragging=!1;const t=this._gestureRecognizer.end();if(t.isSwipe)return void(t.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const e=this._drawer.shadowRoot?.querySelector('[part="body"]'),o=e?.offsetHeight||0;o>0&&t.delta<0&&Math.abs(t.delta)>.5*o?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,a.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],_.prototype,"ariaLabelledBy",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],_.prototype,"ariaDescribedBy",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"open",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],_.prototype,"flexContent",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],_.prototype,"preventScrimClose",void 0),(0,a.Cg)([(0,n.wk)()],_.prototype,"_drawerOpen",void 0),(0,a.Cg)([(0,n.wk)()],_.prototype,"_sliderInteractionActive",void 0),(0,a.Cg)([(0,n.wk)(),(0,r.Fg)({context:h.WF,subscribe:!0})],_.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,n.P)("#drawer")],_.prototype,"_drawer",void 0),(0,a.Cg)([(0,n.P)("#body")],_.prototype,"_bodyElement",void 0),(0,a.Cg)([(0,n.P)("[autofocus]")],_.prototype,"_autofocusElement",void 0),_=(0,a.Cg)([(0,n.EM)("ha-bottom-sheet")],_),e()}catch(t){e(t)}})},18198(t,e,o){o.d(e,{Dc:()=>n,Si:()=>s});var a=o(62826),i=o(5124),r=o(22441);o(47680),o(67094);const s=t=>{switch(t.level){case 0:return"M11,10H13V16H11V10M22,12H19V20H5V12H2L12,3L22,12M15,10A2,2 0 0,0 13,8H11A2,2 0 0,0 9,10V16A2,2 0 0,0 11,18H13A2,2 0 0,0 15,16V10Z";case 1:return"M12,3L2,12H5V20H19V12H22L12,3M10,8H14V18H12V10H10V8Z";case 2:return"M12,3L2,12H5V20H19V12H22L12,3M9,8H13A2,2 0 0,1 15,10V12A2,2 0 0,1 13,14H11V16H15V18H9V14A2,2 0 0,1 11,12H13V10H9V8Z";case 3:return"M12,3L22,12H19V20H5V12H2L12,3M15,11.5V10C15,8.89 14.1,8 13,8H9V10H13V12H11V14H13V16H9V18H13A2,2 0 0,0 15,16V14.5A1.5,1.5 0 0,0 13.5,13A1.5,1.5 0 0,0 15,11.5Z";case-1:return"M12,3L2,12H5V20H19V12H22L12,3M11,15H7V13H11V15M15,18H13V10H11V8H15V18Z"}return"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"},n=t=>{switch(t.level){case 0:return"mdi:home-floor-0";case 1:return"mdi:home-floor-1";case 2:return"mdi:home-floor-2";case 3:return"mdi:home-floor-3";case-1:return"mdi:home-floor-negative-1"}return"mdi:home"};class l extends i.WF{render(){if(!this.floor)return i.s6;if(this.floor.icon)return i.qy`<ha-icon .icon="${this.floor.icon}"></ha-icon>`;const t=s(this.floor);return i.qy`<ha-svg-icon .path="${t}"></ha-svg-icon>`}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],l.prototype,"floor",void 0),(0,a.Cg)([(0,r.MZ)()],l.prototype,"icon",void 0),l=(0,a.Cg)([(0,r.EM)("ha-floor-icon")],l)},7089(t,e,o){o.a(t,async function(t,e){try{o(74423),o(18111),o(81148),o(22489),o(7588),o(61701),o(13579);var a=o(62826),i=o(5124),r=o(22441),s=o(22786),n=o(1087),l=o(71727),d=o(55931),h=o(2514),c=o(58594),p=o(32250),u=o(65063),b=o(27986),v=(o(75064),o(18198),o(38508)),g=o(26300),m=(o(67094),t([v,g]));[v,g]=m.then?(await m)():m;const _="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",y="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___",w=[{name:"search_labels.floorName",weight:10},{name:"search_labels.aliases",weight:8},{name:"search_labels.floor_id",weight:3}];class C extends i.WF{willUpdate(t){this._pendingFloorId&&t.has("hass")&&this.hass.floors!==t.get("hass")?.floors&&this.hass.floors[this._pendingFloorId]&&(this._setValue(this._pendingFloorId),this._pendingFloorId=void 0)}async open(){await this.updateComplete,await(this._picker?.open())}render(){const t=this.placeholder??this.hass.localize("ui.components.floor-picker.floor"),e=this._computeValueRenderer(this.hass.floors);return i.qy` <ha-generic-picker .hass="${this.hass}" .autofocus="${this.autofocus}" .disabled="${this.disabled}" .label="${this.label}" .helper="${this.helper}" .placeholder="${t}" .notFoundLabel="${this._notFoundLabel}" .emptyLabel="${this.hass.localize("ui.components.floor-picker.no_floors")}" .value="${this.value}" .getItems="${this._getItems}" .getAdditionalItems="${this._getAdditionalItems}" .valueRenderer="${e}" .rowRenderer="${this._rowRenderer}" .searchKeys="${w}" .unknownItemText="${this.hass.localize("ui.components.floor-picker.unknown")}" @value-changed="${this._valueChanged}"> </ha-generic-picker> `}_valueChanged(t){t.stopPropagation();const e=t.detail.value;if(e){if(e.startsWith(f)){this.hass.loadFragmentTranslation("config");const t=e.substring(f.length);return void(0,b.k)(this,{suggestedName:t,createEntry:async(t,e)=>{try{const o=await(0,p.KD)(this.hass,t);e.forEach(t=>{(0,h.gs)(this.hass,t,{floor_id:o.floor_id})}),this.hass.floors[o.floor_id]?this._setValue(o.floor_id):this._pendingFloorId=o.floor_id}catch(t){(0,u.showAlertDialog)(this,{title:this.hass.localize("ui.components.floor-picker.failed_create_floor"),text:t.message})}}})}this._setValue(e)}else this._setValue(void 0)}_setValue(t){this.value=t,(0,n.r)(this,"value-changed",{value:t}),(0,n.r)(this,"change")}constructor(...t){super(...t),this.noAdd=!1,this.disabled=!1,this.required=!1,this._computeValueRenderer=(0,s.A)(t=>t=>{const e=this.hass.floors[t];if(!e)return i.qy` <ha-svg-icon slot="start" .path="${y}"></ha-svg-icon> <span slot="headline">${e}</span> `;const o=e?(0,d.X)(e):void 0;return i.qy` <ha-floor-icon slot="start" .floor="${e}"></ha-floor-icon> <span slot="headline">${o}</span> `}),this._getFloors=(0,s.A)((t,e,o,a,i,r,s,n,h,u)=>{const b=Object.values(t),v=Object.values(e),g=Object.values(o),m=Object.values(a);let _,y,f={};(i||r||s||n||h)&&(f=(0,c.g2)(m),_=g,y=m.filter(t=>t.area_id),i&&(_=_.filter(t=>{const e=f[t.id];return!(!e||!e.length)&&f[t.id].some(t=>i.includes((0,l.m)(t.entity_id)))}),y=y.filter(t=>i.includes((0,l.m)(t.entity_id)))),r&&(_=_.filter(t=>{const e=f[t.id];return!e||!e.length||m.every(t=>!r.includes((0,l.m)(t.entity_id)))}),y=y.filter(t=>!r.includes((0,l.m)(t.entity_id)))),s&&(_=_.filter(t=>{const e=f[t.id];return!(!e||!e.length)&&f[t.id].some(t=>{const e=this.hass.states[t.entity_id];return!!e&&(e.attributes.device_class&&s.includes(e.attributes.device_class))})}),y=y.filter(t=>{const e=this.hass.states[t.entity_id];return e.attributes.device_class&&s.includes(e.attributes.device_class)})),n&&(_=_.filter(t=>n(t))),h&&(_=_.filter(t=>{const e=f[t.id];return!(!e||!e.length)&&f[t.id].some(t=>{const e=this.hass.states[t.entity_id];return!!e&&h(e)})}),y=y.filter(t=>{const e=this.hass.states[t.entity_id];return!!e&&h(e)})));let w,C=b;if(_&&(w=_.filter(t=>t.area_id).map(t=>t.area_id)),y&&(w=(w??[]).concat(y.filter(t=>t.area_id).map(t=>t.area_id))),w){const t=(0,p._o)(v);C=C.filter(e=>t[e.floor_id]?.some(t=>w.includes(t.area_id)))}u&&(C=C.filter(t=>!u.includes(t.floor_id)));return C.map(t=>{const e=(0,d.X)(t);return{id:t.floor_id,primary:e,floor:t,search_labels:{floorName:e,floor_id:t.floor_id,aliases:t.aliases.join(" ")}}})}),this._rowRenderer=t=>i.qy` <ha-combo-box-item type="button" compact="compact"> ${t.icon_path?i.qy` <ha-svg-icon slot="start" style="margin:0 4px" .path="${t.icon_path}"></ha-svg-icon> `:i.qy` <ha-floor-icon slot="start" .floor="${t.floor}" style="margin:0 4px"></ha-floor-icon> `} <span slot="headline">${t.primary}</span> </ha-combo-box-item> `,this._getItems=()=>this._getFloors(this.hass.floors,this.hass.areas,this.hass.devices,this.hass.entities,this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.excludeFloors),this._allFloorNames=(0,s.A)(t=>Object.values(t).map(t=>(0,d.X)(t)?.toLowerCase()).filter(Boolean)),this._getAdditionalItems=t=>{if(this.noAdd)return[];const e=this._allFloorNames(this.hass.floors);return t&&!e.includes(t.toLowerCase())?[{id:f+t,primary:this.hass.localize("ui.components.floor-picker.add_new_suggestion",{name:t}),icon_path:_}]:[{id:f,primary:this.hass.localize("ui.components.floor-picker.add_new"),icon_path:_}]},this._notFoundLabel=t=>this.hass.localize("ui.components.floor-picker.no_match",{term:i.qy`<b>‘${t}’</b>`})}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)()],C.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],C.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)()],C.prototype,"helper",void 0),(0,a.Cg)([(0,r.MZ)()],C.prototype,"placeholder",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"no-add"})],C.prototype,"noAdd",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"include-domains"})],C.prototype,"includeDomains",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-domains"})],C.prototype,"excludeDomains",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"include-device-classes"})],C.prototype,"includeDeviceClasses",void 0),(0,a.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-floors"})],C.prototype,"excludeFloors",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],C.prototype,"deviceFilter",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],C.prototype,"entityFilter",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],C.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],C.prototype,"required",void 0),(0,a.Cg)([(0,r.P)("ha-generic-picker")],C.prototype,"_picker",void 0),(0,a.Cg)([(0,r.wk)()],C.prototype,"_pendingFloorId",void 0),C=(0,a.Cg)([(0,r.EM)("ha-floor-picker")],C),e()}catch(t){e(t)}})},38508(t,e,o){o.a(t,async function(t,e){try{o(18111),o(13579);var a=o(62826),i=o(61366),r=o(35211),s=o(5124),n=o(22441),l=o(63672),d=o(91335),h=o(1087),c=o(22792),p=o(17894),u=o(22348),b=o(99611),v=o(18350),g=(o(75064),o(3449),o(49639)),m=o(88285),_=(o(67094),t([i,b,v,g,m]));[i,b,v,g,m]=_.then?(await _)():_;const y="M3 16H10V14H3M18 14V10H16V14H12V16H16V20H18V16H22V14M14 6H3V8H14M14 10H3V12H14V10Z";class f extends((0,p.c)(s.WF)){willUpdate(t){t.has("value")&&this._setUnknownValue()}setFieldValue(t){this._comboBox?this._comboBox.setFieldValue(t):this._initialFieldValue=t}render(){const t=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="${y}" 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="${t}" .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(t=!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="${t?"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 t=this.invalid&&this.errorMessage,e=!t&&this.helper;return t||e?s.qy`<ha-input-helper-text .disabled="${this.disabled}"> ${t?this.errorMessage:this.helper} </ha-input-helper-text>`:s.s6}refreshItems(){this._comboBox?.refreshItems()}_hidePicker(t){t.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(t){t.stopPropagation();const e=t.detail.value;e&&(this._pickerWrapperOpen=!1,this._newValue=e)}_clear(t){t.stopPropagation(),this._setValue(void 0)}_setValue(t){this.value=t,(0,h.r)(this,"value-changed",{value:t})}async open(t,e){t?.stopPropagation(),this.disabled||(this._selectedValue=e?.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(...t){super(...t),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 t=this.getItems();!this.allowCustomValue&&void 0!==this.value&&null!==this.value&&""!==this.value&&t?this._unknownValue=!t.some(t=>"string"!=typeof t&&t.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=t=>{t.stopPropagation()}}}f.shadowRootOptions={...s.WF.shadowRootOptions,delegatesFocus:!0},(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"allow-custom-value"})],f.prototype,"allowCustomValue",void 0),(0,a.Cg)([(0,n.MZ)({type:String,attribute:"search-label"})],f.prototype,"searchLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"getItems",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"getAdditionalItems",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"rowRenderer",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"searchFn",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"searchKeys",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"notFoundLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"empty-label"})],f.prototype,"emptyLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"popover-placement"})],f.prototype,"popoverPlacement",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"add-button-label"})],f.prototype,"addButtonLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"sections",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"sectionTitleFunction",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"selected-section"})],f.prototype,"selectedSection",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"popoverAnchor",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"use-top-label"})],f.prototype,"useTopLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"custom-value-label"})],f.prototype,"customValueLabel",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-sort"})],f.prototype,"noSort",void 0),(0,a.Cg)([(0,n.P)(".container")],f.prototype,"_containerElement",void 0),(0,a.Cg)([(0,n.P)("ha-picker-combo-box")],f.prototype,"_comboBox",void 0),(0,a.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],f.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,n.wk)()],f.prototype,"_opened",void 0),(0,a.Cg)([(0,n.wk)()],f.prototype,"_pickerWrapperOpen",void 0),(0,a.Cg)([(0,n.wk)()],f.prototype,"_popoverWidth",void 0),(0,a.Cg)([(0,n.wk)()],f.prototype,"_openedNarrow",void 0),(0,a.Cg)([(0,n.wk)()],f.prototype,"_unknownValue",void 0),(0,a.Cg)([(0,n.wk)()],f.prototype,"_selectedValue",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"error-message"})],f.prototype,"errorMessage",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],f.prototype,"invalid",void 0),f=(0,a.Cg)([(0,n.EM)("ha-generic-picker")],f),e()}catch(t){e(t)}})},3449(t,e,o){var a=o(62826),i=o(5124),r=o(22441);class s extends i.WF{render(){return i.qy`<slot></slot>`}constructor(...t){super(...t),this.disabled=!1}}s.styles=i.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,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],s.prototype,"disabled",void 0),s=(0,a.Cg)([(0,r.EM)("ha-input-helper-text")],s)},88285(t,e,o){o.a(t,async function(t,e){try{var a=o(62826),i=o(35211),r=o(5124),s=o(22441),n=o(63672),l=o(1087),d=o(22792),h=o(17894),c=(o(75064),o(47680),o(26300)),p=t([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",b="M7,10L12,15L17,10H7Z";class v extends((0,h.c)(r.WF)){async focus(){await this.updateComplete,await(this.item?.focus())}render(){const t=!!this.value,e=!(!this.value||this.required||this.disabled||this.hideClearIcon),o=this.placeholder??this.label,a=this.label&&t?r.qy`<span slot="overline">${this.label}${this.required?" *":""}</span>`:r.s6,i=t?this.valueRenderer?this.valueRenderer(this.value??""):r.qy`<span slot="headline">${this.value}</span>`:o?r.qy`<span slot="headline" class="placeholder"> ${o}${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>`} ${a}${i} ${this.unknown?r.qy`<div slot="supporting-text" class="unknown"> ${this.unknownItemText||this._i18n?.localize("ui.components.combo-box.unknown_item")} </div>`:r.s6} ${e?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="${b}"></ha-svg-icon> </ha-combo-box-item> `}_clear(t){t.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(...t){super(...t),this.invalid=!1}}(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],v.prototype,"invalid",void 0),(0,a.Cg)([(0,s.P)("ha-combo-box-item",!0)],v.prototype,"item",void 0),(0,a.Cg)([(0,s.wk)(),(0,i.Fg)({context:d.D5,subscribe:!0})],v.prototype,"_i18n",void 0),v=(0,a.Cg)([(0,s.EM)("ha-picker-field")],v),e()}catch(t){e(t)}})},36866(t,e,o){o.a(t,async function(t,e){try{var a=o(62826),i=o(5124),r=o(22441),s=o(91485),n=t([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(t){super.willUpdate(t),this.label||this.placeholder||this.hasUpdated&&!t.has("_i18n")||(this.placeholder=this.i18n?.localize?.("ui.common.search")||"Search")}renderStartDefault(){return i.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,i.AH`:host([appearance=outlined]) wa-input.no-label::part(base){height:40px}`],d=(0,a.Cg)([(0,r.EM)("ha-input-search")],d),e()}catch(t){e(t)}})},91485(t,e,o){o.a(t,async function(t,a){try{o.d(e,{U:()=>w});var i=o(62826),r=(o(86137),o(30006)),s=o(92070),n=o(35211),l=o(5124),d=o(22441),h=o(6412),c=o(63672),p=o(57237),u=o(22792),b=o(26300),v=(o(67094),o(34127)),g=o(53305),m=t([r,b,v]);[r,b,v]=m.then?(await m)():m;const _="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",y="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,g.w)(l.WF)){get _formControl(){return this._input}showPicker(){this._input?.showPicker()}stepUp(){this._input?.stepUp()}stepDown(){this._input?.stepDown()}async firstUpdated(t){super.firstUpdated(t),this.insetLabel||(await(this._input?.updateComplete),this._syncStartSlotWidth())}render(){const t=!this.label&&this._hasSlotController.test("label"),e=!this.hint&&this._hasSlotController.test("hint"),o=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||o&&this.insetLabel,"no-label":!this.label,"hint-hidden":!(this.hint||e||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||t?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="${_}"></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:y}"></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||(e?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(...t){super(...t),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 t=this._input?.shadowRoot?.querySelector('[part~="start"]'),e=t?.offsetWidth??0;e>0&&!this.insetLabel?(this.style.setProperty("--start-slot-width",`calc(${e}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=[g.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,i.Cg)([(0,d.MZ)({reflect:!0})],w.prototype,"appearance",void 0),(0,i.Cg)([(0,d.MZ)({reflect:!0})],w.prototype,"type",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,attribute:"with-clear"})],w.prototype,"withClear",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,attribute:"password-toggle"})],w.prototype,"passwordToggle",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,attribute:"password-visible"})],w.prototype,"passwordVisible",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,attribute:"without-spin-buttons"})],w.prototype,"withoutSpinButtons",void 0),(0,i.Cg)([(0,d.MZ)()],w.prototype,"pattern",void 0),(0,i.Cg)([(0,d.MZ)()],w.prototype,"min",void 0),(0,i.Cg)([(0,d.MZ)()],w.prototype,"max",void 0),(0,i.Cg)([(0,d.MZ)()],w.prototype,"step",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean})],w.prototype,"autocorrect",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,attribute:"inset-label"})],w.prototype,"insetLabel",void 0),(0,i.Cg)([(0,d.P)("wa-input")],w.prototype,"_input",void 0),(0,i.Cg)([(0,d.wk)(),(0,n.Fg)({context:u.D5,subscribe:!0})],w.prototype,"i18n",void 0),w=(0,i.Cg)([(0,d.EM)("ha-input")],w),a()}catch(t){a(t)}})},53305(t,e,o){o.d(e,{w:()=>l,N:()=>d});var a=o(62826),i=o(5124),r=o(22441),s=o(22786);o(74423);const n=Boolean(globalThis.ElementInternals)&&globalThis.HTMLElement?.prototype.attachInternals?.toString().includes("[native code]"),l=t=>{class e extends t{get _formControl(){throw new Error("_formControl getter must be implemented by subclass")}select(){this._formControl?.select()}setSelectionRange(t,e,o){this._formControl?.setSelectionRange(t,e,o)}setRangeText(t,e,o,a){this._formControl?.setRangeText(t,e,o,a)}checkValidity(){return!n||(this._formControl?.checkValidity()??!0)}reportValidity(){const t=this.checkValidity();return this._invalid=!t,t}_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(...t){super(...t),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)((t,e)=>{if(!e)return t;let o=getComputedStyle(this).getPropertyValue(this._requiredMarkerCSSVar);return o||(o="*"),o.startsWith('"')&&o.endsWith('"')&&(o=o.slice(1,-1)),o?`${t}${o}`:t})}}return e.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,a.Cg)([(0,r.MZ)()],e.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"hint",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"placeholder",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"readonly",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],e.prototype,"required",void 0),(0,a.Cg)([(0,r.MZ)({type:Number})],e.prototype,"minlength",void 0),(0,a.Cg)([(0,r.MZ)({type:Number})],e.prototype,"maxlength",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"autocapitalize",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"autocomplete",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"autofocus",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"spellcheck",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"inputmode",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"enterkeyhint",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"name",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"validation-message"})],e.prototype,"validationMessage",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"auto-validate"})],e.prototype,"autoValidate",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"invalid",void 0),(0,a.Cg)([(0,r.wk)()],e.prototype,"_invalid",void 0),e},d=i.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)}`},32250(t,e,o){o.d(e,{KD:()=>a,NL:()=>i,Rj:()=>s,_o:()=>n,ls:()=>r});o(44114);const a=(t,e)=>t.callWS({type:"config/floor_registry/create",...e}),i=(t,e,o)=>t.callWS({type:"config/floor_registry/update",floor_id:e,...o}),r=(t,e)=>t.callWS({type:"config/floor_registry/delete",floor_id:e}),s=(t,e)=>t.callWS({type:"config/floor_registry/reorder",floor_ids:e}),n=t=>{const e={};for(const o of t)o.floor_id&&(o.floor_id in e||(e[o.floor_id]=[]),e[o.floor_id].push(o));return e}},17894(t,e,o){o.d(e,{c:()=>r});var a=o(62826),i=o(22441);const r=t=>{class e extends t{constructor(...t){super(...t),this.disabled=!1,this.required=!1,this.unknown=!1,this.hideClearIcon=!1}}return(0,a.Cg)([(0,i.MZ)({type:Boolean})],e.prototype,"disabled",void 0),(0,a.Cg)([(0,i.MZ)({type:Boolean})],e.prototype,"required",void 0),(0,a.Cg)([(0,i.MZ)()],e.prototype,"icon",void 0),(0,a.Cg)([(0,i.MZ)()],e.prototype,"image",void 0),(0,a.Cg)([(0,i.MZ)()],e.prototype,"label",void 0),(0,a.Cg)([(0,i.MZ)()],e.prototype,"placeholder",void 0),(0,a.Cg)([(0,i.MZ)()],e.prototype,"helper",void 0),(0,a.Cg)([(0,i.MZ)()],e.prototype,"value",void 0),(0,a.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],e.prototype,"unknown",void 0),(0,a.Cg)([(0,i.MZ)({attribute:"unknown-item-text"})],e.prototype,"unknownItemText",void 0),(0,a.Cg)([(0,i.MZ)({attribute:"hide-clear-icon",type:Boolean})],e.prototype,"hideClearIcon",void 0),(0,a.Cg)([(0,i.MZ)({attribute:!1})],e.prototype,"valueRenderer",void 0),e}},59992(t,e,o){o.d(e,{V:()=>l});var a=o(62826),i=o(88696),r=o(5124),s=o(6412),n=o(22441);const l=t=>{class e extends t{get scrollableElement(){return e.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(t){super.firstUpdated?.(t),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(t){super.updated?.(t),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(t=!1){return r.qy` <div class="${(0,s.H)({"fade-top":!0,rounded:t,visible:this._contentScrolled})}"></div> <div class="${(0,s.H)({"fade-bottom":!0,rounded:t,visible:this._contentScrollable})}"></div> `}static get styles(){const t=Object.getPrototypeOf(this);var e;return[...void 0===(e=t?.styles??[])?[]:Array.isArray(e)?e:[e],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 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(){this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),this._resize.unobserve?.(this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(t){const e=parseFloat(getComputedStyle(t).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:o=0,clientHeight:a=0,scrollTop:i=0}=t;this._contentScrollable=o-a>i+e+this.scrollFadeSafeAreaPadding}constructor(...t){super(...t),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=t=>{const e=t.currentTarget;this._contentScrolled=(e.scrollTop??0)>this.scrollFadeThreshold,this._updateScrollableState(e)},this._resize=new i.P(this,{target:null,callback:t=>{const e=t[0]?.target;e&&this._updateScrollableState(e)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return e.DEFAULT_SCROLLABLE_ELEMENT=null,(0,a.Cg)([(0,n.wk)()],e.prototype,"_contentScrolled",void 0),(0,a.Cg)([(0,n.wk)()],e.prototype,"_contentScrollable",void 0),e}},27986(t,e,o){o.d(e,{k:()=>r});var a=o(1087);const i=()=>Promise.all([o.e(32450),o.e(7305),o.e(92769),o.e(3283),o.e(8158),o.e(26092),o.e(50931)]).then(o.bind(o,91622)),r=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-floor-registry-detail",dialogImport:i,dialogParams:e})}},22348(t,e,o){o.d(e,{V:()=>i});var a=o(37177);const i=t=>!!t&&a.n},37177(t,e,o){o.d(e,{n:()=>a});const a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},88438(t,e,o){o.d(e,{C:()=>a});const a="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}};