iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
22 lines • 61.4 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[61617],{65522:function(e,t,a){a.d(t,{A:function(){return i}});a(42762);const i=e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.trim()}},66033:function(e,t,a){a.d(t,{L:function(){return i}});const i=(e,t)=>{const a=e.floor_id;return{area:e,floor:(a?t[a]:void 0)||null}}},60353:function(e,t,a){a.d(t,{u:function(){return 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={}){var t,a;this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=null!==(t=e.velocitySwipeThreshold)&&void 0!==t?t:.5,this._movementTimeThreshold=null!==(a=e.movementTimeThreshold)&&void 0!==a?a:100}}},64481:function(e,t,a){a.d(t,{D:function(){return o},J:function(){return s}});a(16280),a(3362),a(55815),a(64979),a(79739);let i=!1;try{i="true"===window.localStorage.getItem("disableViewTransition")}catch(n){}const o=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:function(e,t,a){var i=a(40445),o=a(99731),r=a(67576);class s extends o.Y{}s=(0,i.Cg)([(0,r.EM)("ha-chip-set")],s)},13467:function(e,t,a){var i=a(40445),o=a(41216),r=a(78960),s=a(75640),n=a(91735),l=a(43826),d=a(5124),h=a(67576);let c;class p extends o.R{}p.styles=[n.R,l.R,s.R,r.R,(0,d.AH)(c||(c=(e=>e)`: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)}`))],p=(0,i.Cg)([(0,h.EM)("ha-input-chip")],p)},832:function(e,t,a){a.a(e,async function(e,t){try{a(62953);var i=a(40445),o=a(5124),r=a(67576),s=a(1087),n=a(26613),l=e([n]);n=(l.then?(await l)():l)[0];let d,h=e=>e;class c extends o.WF{render(){return this.aliases?(0,o.qy)(d||(d=h` <ha-input-multi .value="${0}" .disabled="${0}" .sortable="${0}" update-on-blur .label="${0}" .removeLabel="${0}" .addLabel="${0}" item-index @value-changed="${0}"> </ha-input-multi> `),this.aliases,this.disabled,this.sortable,this.hass.localize("ui.dialogs.aliases.label"),this.hass.localize("ui.dialogs.aliases.remove"),this.hass.localize("ui.dialogs.aliases.add"),this._aliasesChanged):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})],c.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({type:Array})],c.prototype,"aliases",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],c.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],c.prototype,"sortable",void 0),c=(0,i.Cg)([(0,r.EM)("ha-aliases-editor")],c),t()}catch(d){t(d)}})},66086:function(e,t,a){a.a(e,async function(e,t){try{a(74423),a(18111),a(22489),a(61701),a(3362),a(62953);var i=a(40445),o=a(5124),r=a(67576),s=a(22786),n=a(1087),l=a(65522),d=a(55931),h=a(66033),c=a(49852),p=a(53641),u=a(65063),v=a(34023),g=(a(75064),a(38508)),m=a(26300),f=(a(67094),e([g,m]));[g,m]=f.then?(await f)():f;let b,y,_,w,x,C,$,k=e=>e;const S="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",A="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",M="___ADD_NEW___";class L extends o.WF{willUpdate(e){var t;this._pendingAreaId&&e.has("hass")&&this.hass.areas!==(null===(t=e.get("hass"))||void 0===t?void 0:t.areas)&&this.hass.areas[this._pendingAreaId]&&(this._setValue(this._pendingAreaId),this._pendingAreaId=void 0)}async open(){var e;await this.updateComplete,await(null===(e=this._picker)||void 0===e?void 0:e.open())}render(){var e;const t=null!==(e=this.label)&&void 0!==e?e:this.hass.localize("ui.components.area-picker.area"),a=this._computeValueRenderer(this.hass.areas);let i=t;if(this.value&&t){const e=this.hass.areas[this.value];if(e){const{floor:t}=(0,h.L)(e,this.hass.floors);t&&(i=void 0)}}return(0,o.qy)(b||(b=k` <ha-generic-picker .hass="${0}" .autofocus="${0}" .label="${0}" .helper="${0}" .notFoundLabel="${0}" .emptyLabel="${0}" .disabled="${0}" .required="${0}" .value="${0}" .getItems="${0}" .getAdditionalItems="${0}" .valueRenderer="${0}" .addButtonLabel="${0}" .searchKeys="${0}" .unknownItemText="${0}" @value-changed="${0}"> </ha-generic-picker> `),this.hass,this.autofocus,i,this.helper,this._notFoundLabel,this.hass.localize("ui.components.area-picker.no_areas"),this.disabled,this.required,this.value,this._getItems,this._getAdditionalItems,a,this.addButtonLabel,c.P,this.hass.localize("ui.components.area-picker.unknown"),this._valueChanged)}_valueChanged(e){e.stopPropagation();const t=e.detail.value;if(t){if(t.startsWith(M)){this.hass.loadFragmentTranslation("config");const e=t.substring(M.length);return void(0,v.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(t){(0,u.showAlertDialog)(this,{title:this.hass.localize("ui.components.area-picker.failed_create_area"),text:t.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(0,o.qy)(y||(y=k` <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <span slot="headline">${0}</span> `),A,t);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(0,o.qy)(_||(_=k` ${0} <span slot="headline">${0}</span> ${0} `),s?(0,o.qy)(w||(w=k`<ha-icon slot="start" .icon="${0}"></ha-icon>`),s):(0,o.qy)(x||(x=k`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),A),i,r?(0,o.qy)(C||(C=k`<span slot="supporting-text">${0}</span>`),r):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=>{var t;return null===(t=(0,l.A)(e))||void 0===t?void 0:t.toLowerCase()}).filter(Boolean)),this._getAdditionalItems=e=>{if(this.noAdd)return[];const t=this._allAreaNames(this.hass.areas);return e&&!t.includes(e.toLowerCase())?[{id:M+e,primary:this.hass.localize("ui.components.area-picker.add_new_suggestion",{name:e}),icon_path:S}]:[{id:M,primary:this.hass.localize("ui.components.area-picker.add_new"),icon_path:S}]},this._notFoundLabel=e=>this.hass.localize("ui.components.area-picker.no_match",{term:(0,o.qy)($||($=k`<b>‘${0}’</b>`),e)})}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],L.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)()],L.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)()],L.prototype,"value",void 0),(0,i.Cg)([(0,r.MZ)()],L.prototype,"helper",void 0),(0,i.Cg)([(0,r.MZ)()],L.prototype,"placeholder",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"no-add"})],L.prototype,"noAdd",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"include-domains"})],L.prototype,"includeDomains",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-domains"})],L.prototype,"excludeDomains",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"include-device-classes"})],L.prototype,"includeDeviceClasses",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-areas"})],L.prototype,"excludeAreas",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],L.prototype,"deviceFilter",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],L.prototype,"entityFilter",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],L.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],L.prototype,"required",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"add-button-label"})],L.prototype,"addButtonLabel",void 0),(0,i.Cg)([(0,r.P)("ha-generic-picker")],L.prototype,"_picker",void 0),(0,i.Cg)([(0,r.wk)()],L.prototype,"_pendingAreaId",void 0),L=(0,i.Cg)([(0,r.EM)("ha-area-picker")],L),t()}catch(b){t(b)}})},99611:function(e,t,a){a.a(e,async function(e,t){try{a(18111),a(13579),a(3362),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var i=a(40445),o=a(1126),r=a(35211),s=a(5124),n=a(67576),l=a(1087),d=a(60353),h=a(22792),c=a(59992),p=a(14503),u=a(22348),v=e([o,c]);[o,c]=v.then?(await v)():v;let g,m,f=e=>e;const b=300,y=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),_=new Set(["volume-slider-container","forecast"]);class w 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(0,s.qy)(g||(g=f` <wa-drawer id="drawer" placement="bottom" .open="${0}" .lightDismiss="${0}" .ariaLabelledby="${0}" .ariaDescribedby="${0}" @keydown="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-hide="${0}" @wa-after-hide="${0}" @click="${0}" without-header @touchstart="${0}"> <div class="handle-wrapper" aria-hidden="true"> <div class="handle"></div> </div> <slot name="header"></slot> <div class="content-wrapper"> <div id="body" class="body ha-scrollbar"> <slot></slot> </div> ${0} </div> <slot name="footer"></slot> </wa-drawer> `),this._drawerOpen,!this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this._handleKeyDown,this._handleShow,this._handleAfterShow,this._handleHide,this._handleAfterHide,this._handleCloseAction,this._handleTouchStart,this.renderScrollableFades())}_startResizing(e){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(e)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${b}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},b)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.removeEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0}),this._unregisterResizeHandlers(),this._isDragging=!1}static get styles(){return[...super.styles,p.dp,(0,s.AH)(m||(m=f`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${0}ms;--hide-duration:${0}ms}wa-drawer::part(dialog){max-height:min(var(--ha-bottom-sheet-max-height,90vh),calc(100vh - max(var(--safe-area-inset-top),48px)));max-height:min(var(--ha-bottom-sheet-max-height,90dvh),calc(100dvh - max(var(--safe-area-inset-top),48px)));align-items:center;transform:var(--dialog-transform);transition:var(--dialog-transition)}@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}`),b,b)]}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(()=>{var e;const t=this._autofocusElement;null!==(e=this._hassConfig)&&void 0!==e&&e.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}})):null==t||t.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 a of t){if(a===this._drawer)break;if(a instanceof HTMLElement&&(a.scrollTop>0||y.has(a.localName)||Array.from(a.classList).some(e=>_.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=()=>{var e;this._unregisterResizeHandlers(),this._isDragging=!1;const t=this._gestureRecognizer.end();if(t.isSwipe)return void(t.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const a=null===(e=this._drawer.shadowRoot)||void 0===e?void 0:e.querySelector('[part="body"]'),i=(null==a?void 0:a.offsetHeight)||0;i>0&&t.delta<0&&Math.abs(t.delta)>.5*i?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,i.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],w.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],w.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],w.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],w.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.wk)()],w.prototype,"_drawerOpen",void 0),(0,i.Cg)([(0,n.wk)()],w.prototype,"_sliderInteractionActive",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:h.WF,subscribe:!0})],w.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.P)("#drawer")],w.prototype,"_drawer",void 0),(0,i.Cg)([(0,n.P)("#body")],w.prototype,"_bodyElement",void 0),(0,i.Cg)([(0,n.P)("[autofocus]")],w.prototype,"_autofocusElement",void 0),w=(0,i.Cg)([(0,n.EM)("ha-bottom-sheet")],w),t()}catch(g){t(g)}})},93444:function(e,t,a){var i=a(40445),o=a(5124),r=a(67576);let s,n,l=e=>e;class d extends o.WF{render(){return(0,o.qy)(s||(s=l` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `))}static get styles(){return[(0,o.AH)(n||(n=l`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}}d=(0,i.Cg)([(0,r.EM)("ha-dialog-footer")],d)},76538:function(e,t,a){a(62953);var i=a(40445),o=a(5124),r=a(67576);let s,n,l,d,h,c,p=e=>e;class u extends o.WF{render(){const e=(0,o.qy)(s||(s=p`<div class="header-title"> <slot name="title"></slot> </div>`)),t=(0,o.qy)(n||(n=p`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`));return(0,o.qy)(l||(l=p` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${0} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `),"above"===this.subtitlePosition?(0,o.qy)(d||(d=p`${0}${0}`),t,e):(0,o.qy)(h||(h=p`${0}${0}`),e,t))}static get styles(){return[(0,o.AH)(c||(c=p`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`))]}constructor(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,i.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],u.prototype,"subtitlePosition",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],u.prototype,"showBorder",void 0),u=(0,i.Cg)([(0,r.EM)("ha-dialog-header")],u)},72554:function(e,t,a){a.a(e,async function(e,t){try{a(3362),a(62953),a(49255);var i=a(40445),o=a(93900),r=a(35211),s=a(5124),n=a(67576),l=a(63672),d=a(1087),h=a(64481),c=a(22792),p=a(59992),u=a(14503),v=a(22348),g=(a(76538),a(26300)),m=e([o,g,p]);[o,g,p]=m.then?(await m)():m;let f,b,y,_,w,x,C,$=e=>e;const k="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";class S extends((0,p.V)(s.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(e){super.updated(e),e.has("open")&&(this._open=this.open)}render(){var e,t,a;return(0,s.qy)(f||(f=$` <wa-dialog .open="${0}" .lightDismiss="${0}" without-header aria-labelledby="${0}" aria-describedby="${0}" @keydown="${0}" @wa-hide="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-after-hide="${0}"> ${0} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${0}"> <slot></slot> </div> ${0} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `),this._open,!this.preventScrimClose,(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)),(0,l.J)(this.ariaDescribedBy),this._handleKeyDown,this._handleHide,this._handleShow,this._handleAfterShow,this._handleAfterHide,this.withoutHeader?s.s6:(0,s.qy)(b||(b=$`<slot name="header"> <ha-dialog-header .subtitlePosition="${0}" .showBorder="${0}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> </slot> ${0} ${0} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`),this.headerSubtitlePosition,this._bodyScrolled,null!==(e=null===(t=this._i18n)||void 0===t||null===(a=t.localize)||void 0===a?void 0:a.call(t,"ui.common.close"))&&void 0!==e?e:"Close",k,void 0!==this.headerTitle?(0,s.qy)(y||(y=$`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,s.qy)(_||(_=$`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,s.qy)(w||(w=$`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,s.qy)(x||(x=$`<slot name="headerSubtitle" slot="subtitle"></slot>`))),this._handleBodyScroll,this.renderScrollableFades())}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,h.J)(()=>{this._setFullscreen(e.detail)}):this._setFullscreen(e.detail)}_setFullscreen(e){this.toggleAttribute("fullscreen",e)}_handleBodyScroll(e){this._bodyScrolled=e.target.scrollTop>0}_handleKeyDown(e){"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)}_handleHide(e){var t;const a=(null===(t=e.detail)||void 0===t?void 0:t.source)===e.target.dialog;this.preventScrimClose&&this._escapePressed&&a&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,u.dp,(0,s.AH)(C||(C=$`wa-dialog{--full-width:var(
--ha-dialog-width-full,
min(95vw, var(--safe-width))
);--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var(
--ha-dialog-surface-background,
var(--card-background-color, var(--ha-color-surface-default))
);--wa-panel-border-radius:var(
--ha-dialog-border-radius,
var(--ha-border-radius-3xl)
);max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var(
--ha-dialog-header-title-font-size,
var(--ha-font-size-2xl)
);line-height:var(
--ha-dialog-header-title-line-height,
var(--ha-line-height-condensed)
);font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}constructor(...e){super(...e),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var e,t;if(null!==(e=this._hassConfig)&&void 0!==e&&e.auth.external&&(0,v.V)(this._hassConfig.auth.external)){const e=this.querySelector("[autofocus]");return void(null!==e&&(e.id||(e.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})))}null===(t=this.querySelector("[autofocus]"))||void 0===t||t.focus()}))},this._handleAfterShow=e=>{e.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,i.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],S.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],S.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],S.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({reflect:!0})],S.prototype,"type",void 0),(0,i.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],S.prototype,"width",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],S.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-title"})],S.prototype,"headerTitle",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],S.prototype,"headerSubtitle",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],S.prototype,"headerSubtitlePosition",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],S.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],S.prototype,"withoutHeader",void 0),(0,i.Cg)([(0,n.wk)()],S.prototype,"_open",void 0),(0,i.Cg)([(0,n.P)(".body")],S.prototype,"bodyContainer",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.D5,subscribe:!0})],S.prototype,"_i18n",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],S.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.wk)()],S.prototype,"_bodyScrolled",void 0),(0,i.Cg)([(0,n.Ls)({passive:!0})],S.prototype,"_handleBodyScroll",null),S=(0,i.Cg)([(0,n.EM)("ha-dialog")],S),t()}catch(f){t(f)}})},64138:function(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HaIconPicker:function(){return x}});a(74423),a(44114),a(26910),a(18111),a(22489),a(7588),a(61701),a(13579),a(3362),a(27495),a(25440),a(62953);var o=a(40445),r=a(5124),s=a(67576),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,v,g=e=>e,m=[],f=!1;const b=(e,t)=>{var a;const i=`${t}:${e.name}`,o=e.name,r=o.split("-"),s=null!==(a=e.keywords)&&void 0!==a?a:[],n={iconName:o};return r.forEach((e,t)=>{n[`part${t}`]=e}),s.forEach((e,t)=>{n[`keyword${t}`]=e}),{id:i,primary:i,icon:i,search_labels:n,sorting_label:i}},y=async()=>{f=!0;const e=await a.e(81340).then(a.t.bind(a,25143,19));m=e.default.map(e=>b(e,"mdi"));const t=[];Object.keys(d.y).forEach(e=>{t.push(_(e))}),(await Promise.all(t)).forEach(e=>{m.push(...e)})},_=async e=>{try{const t=d.y[e].getIconList;if("function"!=typeof t)return[];return(await t()).map(t=>b(t,e))}catch(t){return console.warn(`Unable to load icon list for ${e} iconset`),[]}},w=e=>(0,r.qy)(p||(p=g` <ha-combo-box-item type="button"> <ha-icon .icon="${0}" slot="start"></ha-icon> ${0} </ha-combo-box-item> `),e.id,e.id);class x extends r.WF{render(){return(0,r.qy)(u||(u=g` <ha-generic-picker allow-custom-value .getItems="${0}" .helper="${0}" .disabled="${0}" .required="${0}" .errorMessage="${0}" .invalid="${0}" .rowRenderer="${0}" .icon="${0}" .label="${0}" .value="${0}" .searchFn="${0}" @value-changed="${0}"> <slot name="start"></slot> </ha-generic-picker> `),this._getIconPickerItems,this.helper,this.disabled,this.required,this.errorMessage,this.invalid,w,this._icon,this.label,this._value,this._filterIcons,this._valueChanged)}firstUpdated(){f||y().then(()=>{this._getIconPickerItems=()=>m,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(){var e;return null!==(e=this.value)&&void 0!==e&&e.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=()=>m,this._filterIcons=(0,n.A)((e,t,a)=>{const i=e.toLowerCase().replace(/\s+/g,"-"),o=null!=a&&a.length?a:t;if(!i.length)return o;const r=[];for(const s of o){const e=(s.id.split(":")[1]||s.id).toLowerCase().split("-"),t=s.search_labels?Object.values(s.search_labels).filter(e=>null!==e).map(e=>e.toLowerCase()):[],a=s.id.toLowerCase();e.includes(i)?r.push({item:s,rank:1}):t.includes(i)?r.push({item:s,rank:2}):a.includes(i)?r.push({item:s,rank:3}):t.some(e=>e.includes(i))&&r.push({item:s,rank:4})}return r.sort((e,t)=>e.rank-t.rank).map(e=>e.item)})}}x.styles=(0,r.AH)(v||(v=g`ha-generic-picker{width:100%;display:block}`)),(0,o.Cg)([(0,s.MZ)()],x.prototype,"value",void 0),(0,o.Cg)([(0,s.MZ)()],x.prototype,"label",void 0),(0,o.Cg)([(0,s.MZ)()],x.prototype,"helper",void 0),(0,o.Cg)([(0,s.MZ)()],x.prototype,"placeholder",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"error-message"})],x.prototype,"errorMessage",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],x.prototype,"disabled",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],x.prototype,"required",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],x.prototype,"invalid",void 0),x=(0,o.Cg)([(0,s.EM)("ha-icon-picker")],x),i()}catch(p){i(p)}})},8034:function(e,t,a){a(27495),a(62953);var i=a(40445),o=a(92070),r=a(5124),s=a(67576);let n,l,d,h=e=>e;class c extends r.WF{render(){const e=this._hasSlotController.test("description");return(0,r.qy)(n||(n=h` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" part="heading" ?two-line="${0}" ?three-line="${0}"> <slot name="heading"></slot> ${0} </div> </div> <div class="content"> <slot></slot> </div> `),!this.threeLine&&e,this.threeLine,e?(0,r.qy)(l||(l=h`<span class="secondary"><slot name="description"></slot></span>`)):r.s6)}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")}}c.styles=(0,r.AH)(d||(d=h`: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})],c.prototype,"narrow",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],c.prototype,"slim",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"three-line"})],c.prototype,"threeLine",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"wrap-heading",reflect:!0})],c.prototype,"wrapHeading",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],c.prototype,"empty",void 0),c=(0,i.Cg)([(0,s.EM)("ha-settings-row")],c)},85938:function(e,t,a){a(18111),a(22489),a(3362),a(46058),a(62953);var i=a(40445),o=a(5124),r=a(67576),s=a(1087);let n,l=e=>e;class d 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:(0,o.qy)(n||(n=l` <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=Object.assign(Object.assign({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})],d.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"no-style"})],d.prototype,"noStyle",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"draggable-selector"})],d.prototype,"draggableSelector",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"handle-selector"})],d.prototype,"handleSelector",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"filter"})],d.prototype,"filter",void 0),(0,i.Cg)([(0,r.MZ)({type:String})],d.prototype,"group",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"invert-swap"})],d.prototype,"invertSwap",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"options",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],d.prototype,"rollback",void 0),d=(0,i.Cg)([(0,r.EM)("ha-sortable")],d)},26613:function(e,t,a){a.a(e,async function(e,t){try{a(3362),a(62953);var i=a(40445),o=a(35211),r=a(5124),s=a(67576),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)),v=e([c,p,u]);[c,p,u]=v.then?(await v)():v;let g,m,f,b,y,_,w,x=e=>e;const C="M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z",$="M21 11H3V9H21V11M21 13H3V15H21V13Z",k="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class S extends r.WF{render(){var e,t,a,i;return(0,r.qy)(g||(g=x` <ha-sortable handle-selector=".handle" draggable-selector=".row" .disabled="${0}" @item-moved="${0}"> <div class="items"> ${0} </div> </ha-sortable> <div class="layout horizontal"> <ha-button size="small" appearance="filled" @click="${0}" .disabled="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> </div> ${0} `),!this.sortable||this.disabled,this._itemMoved,(0,n.u)(this._items,(e,t)=>`${e}-${t}`,(e,t)=>{var a,i,o;const s=""+(this.itemIndex?` ${t+1}`:"");return(0,r.qy)(m||(m=x` <div class="layout horizontal center-center row"> <ha-input .type="${0}" .autocomplete="${0}" .disabled="${0}" dialogInitialFocus="${0}" .index="${0}" class="flex-auto" .label="${0}" .value="${0}" ?data-last="${0}" @input="${0}" @change="${0}" @keydown="${0}"> ${0} ${0} </ha-input> <ha-icon-button .disabled="${0}" .index="${0}" slot="navigationIcon" .label="${0}" @click="${0}" .path="${0}"></ha-icon-button> ${0} </div> `),this.inputType,this.autocomplete,this.disabled,t,t,""+(this.label?`${this.label}${s}`:""),e,t===this._items.length-1,this._editItem,this._editItem,this._keyDown,this.inputPrefix?(0,r.qy)(f||(f=x`<span slot="start">${0}</span>`),this.inputPrefix):r.s6,this.inputSuffix?(0,r.qy)(b||(b=x`<span slot="end">${0}</span>`),this.inputSuffix):r.s6,this.disabled,t,null!==(a=null!==(i=this.removeLabel)&&void 0!==i?i:null===(o=this._i18n)||void 0===o?void 0:o.localize("ui.common.remove"))&&void 0!==a?a:"Remove",this._removeItem,C,this.sortable?(0,r.qy)(y||(y=x`<ha-svg-icon class="handle" .path="${0}"></ha-svg-icon>`),$):r.s6)}),this._addItem,this.disabled||null!=this.max&&this._items.length>=this.max,k,null!==(e=null!==(t=this.addLabel)&&void 0!==t?t:this.label?null===(a=this._i18n)||void 0===a?void 0:a.localize("ui.components.multi-textfield.add_item",{item:this.label}):null===(i=this._i18n)||void 0===i?void 0:i.localize("ui.common.add"))&&void 0!==e?e:"Add",this.helper?(0,r.qy)(_||(_=x`<ha-input-helper-text .disabled="${0}">${0}</ha-input-helper-text>`),this.disabled,this.helper):r.s6)}get _items(){var e;return null!==(e=this.value)&&void 0!==e?e:[]}async _addItem(){var e;if(null!=this.max&&this._items.length>=this.max)return;const t=[...this._items,""];this._fireChanged(t),await this.updateComplete,null===(e=this._lastInput)||void 0===e||e.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,(0,r.AH)(w||(w=x`.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})],S.prototype,"value",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],S.prototype,"disabled",void 0),(0,i.Cg)([(0,s.MZ)()],S.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)()],S.prototype,"helper",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"input-type"})],S.prototype,"inputType",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"input-suffix"})],S.prototype,"inputSuffix",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"input-prefix"})],S.prototype,"inputPrefix",void 0),(0,i.Cg)([(0,s.MZ)()],S.prototype,"autocomplete",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"add-label"})],S.prototype,"addLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"remove-label"})],S.prototype,"removeLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"item-index",type:Boolean})],S.prototype,"itemIndex",void 0),(0,i.Cg)([(0,s.MZ)({type:Number})],S.prototype,"max",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],S.prototype,"sortable",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"update-on-blur"})],S.prototype,"updateOnBlur",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:d.D5,subscribe:!0})],S.prototype,"_i18n",void 0),(0,i.Cg)([(0,s.P)("ha-input[data-last]")],S.prototype,"_lastInput",void 0),S=(0,i.Cg)([(0,s.EM)("ha-input-multi")],S),t()}catch(g){t(g)}})},36866:function(e,t,a){a.a(e,async function(e,t){try{a(62953);var i=a(40445),o=a(5124),r=a(67576),s=a(91485),n=e([s]);s=(n.then?(await n)():n)[0];let l,d,h=e=>e;const c="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z";class p extends s.U{willUpdate(e){var t,a;(super.willUpdate(e),this.label||this.placeholder||this.hasUpdated&&!e.has("_i18n"))||(this.placeholder=(null===(t=this.i18n)||void 0===t||null===(a=t.localize)||void 0===a?void 0:a.call(t,"ui.common.search"))||"Search")}renderStartDefault(){return(0,o.qy)(l||(l=h`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),c)}constructor(){super(),this.withClear=!0,this.autocomplete=this.autocomplete||"off"}}p.styles=[...s.U.styles,(0,o.AH)(d||(d=h`:host([appearance=outlined]) wa-input.no-label::part(base){height:40px}`))],p=(0,i.Cg)([(0,r.EM)("ha-input-search")],p),t()}catch(l){t(l)}})},49852:function(e,t,a){a.d(t,{P:function(){return d},j:function(){return 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,v,g,m="")=>{let f,b,y={};const _=Object.values(e),w=Object.values(a),x=Object.values(l);(h||c||p||u||v)&&(y=(0,n.g2)(x),f=w,b=x.filter(e=>e.area_id),h&&(f=f.filter(e=>{const t=y[e.id];return!(!t||!t.length)&&y[e.id].some(e=>h.includes((0,o.m)(e.entity_id)))}),b=b.filter(e=>h.includes((0,o.m)(e.entity_id)))),c&&(f=f.filter(e=>{const t=y[e.id];return!t||!t.length||x.every(e=>!c.includes((0,o.m)(e.entity_id)))}),b=b.filter(e=>!c.includes((0,o.m)(e.entity_id)))),p&&(f=f.filter(e=>{const t=y[e.id];return!(!t||!t.length)&&y[e.id].some(e=>{const t=d[e.entity_id];return!!t&&(t.attributes.device_class&&p.includes(t.attributes.device_class))})}),b=b.filter(e=>{const t=d[e.entity_id];return t.attributes.device_class&&p.includes(t.attributes.device_class)})),u&&(f=f.filter(e=>u(e))),v&&(f=f.filter(e=>{const t=y[e.id];return!(!t||!t.length)&&y[e.id].some(e=>{const t=d[e.entity_id];return!!t&&v(t)})}),b=b.filter(e=>{const t=d[e.entity_id];return!!t&&v(t)})));let C,$=_;f&&(C=f.filter(e=>e.area_id).map(e=>e.area_id)),b&&(C=(null!=C?C:[]).concat(b.filter(e=>e.area_id).map(e=>e.area_id))),C&&($=$.filter(e=>C.includes(e.area_id))),g&&($=$.filter(e=>!g.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}]},59992:function(e,t,a){a.a(e,async function(e,i){try{a.d(t,{V:function(){return v}});a(62953);var o=a(40445),r=a(88696),s=a(5124),n=a(6412),l=a(67576),d=e([r]);r=(d.then?(await d)():d)[0];let h,c,p=e=>e;const u=e=>void 0===e?[]:Array.isArray(e)?e:[e],v=e=>{class t extends e{get scrollableElement(){return t.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(e){var t;null===(t=super.firstUpdated)||void 0===t||t.call(this,e),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(e){var t;null===(t=super.updated)||void 0===t||t.call(this,e),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(e=!1){return(0,s.qy)(h||(h=p` <div class="${0}"></div> <div class="${0}"></div> `),(0,n.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled}),(0,n.H)({"fade-bottom":!0,rounded:e,visible:this._contentScrollable}))}static get styles(){var e;const t=Object.getPrototypeOf(this);return[...u(null!==(e=null==t?void 0:t.styles)&&void 0!==e?e:[]),(0,s.AH)(c||(c=p`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`))]}_attachScrollableElement(){const e=this.scrollableElement;e!==this._scrollTarget&&(this._detachScrollableElement(),e&&(this._scrollTarget=e,e.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(e),this._updateScrollableState(e)))}_detachScrollableElement(){var e,t;this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),null===(e=(t=this._resize).unobserve)||void 0===e||e.call(t,this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(e){const t=parseFloat(getComputedStyle(e).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight: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=>{var t;const a=e.currentTarget;this._contentScrolled=(null!==(t=a.scrollTop)&&void 0!==t?t:0)>this.scrollFadeThreshold,this._updateScrollableState(a)},this._resize=new r.P(this,{target:null,callback:e=>{var t;const a=null===(t=e[0])||void 0===t?void 0:t.target;a&&this._updateScrollableState(a)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return t.DEFAULT_SCROLLABLE_ELEMENT=null,(0,o.Cg)([(0,l.wk)()],t.prototype,"_contentScrolled",void 0),(0,o.Cg)([(0,l.wk)()],t.prototype,"_contentScrollable",void 0),t};i()}catch(h){i(h)}})},91622:function(e,t,a){a.a(e,async function(e,i){try{a.r(t);a(18111),a(22489),a(61701),a(3362),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(42762),a(62953);var o=a(40445),r=a(5124),s=a(67576),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),v=a(72554),g=(a(93444),a(18198),a(64138)),m=(a(8034),a(67094),a(91485)),f=a(53641),b=a(14503),y=a(34023),_=e([h,c,p,u,v,g,m]);[h,c,p,u,v,g,m]=_.then?(await _)():_;let w,x,C,$,k,S,A,M,L,E,Z=e=>e;const T="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 H extends r.WF{showDialog(e){var t,a,i,o;this._params=e,this._error=void 0,this._name=this._params.entry?this._params.entry.name:this._params.suggestedName||"",this._aliases=(null===(t=this._params.entry)||void 0===t?void 0:t.aliases)||[],this._icon=(null===(a=this._params.entry)||void 0===a?void 0:a.icon)||null,this._level=null!==(i=null===(o=this._params.entry)||void 0===o?void 0:o.level)&&void 0!==i?i: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(){var e;const t=this._floorAreas(null===(e=this._params)||void 0===e?void 0:e.entry,this.hass.areas,this._addedAreas,this._removedAreas);if(!this._params)return r.s6;const a=this._params.entry;return(0,r.qy)(w||(w=Z` <ha-dialog .open="${0}" header-title="${0}" prevent-scrim-close @closed="${0}"> <div> ${0} <div class="form"> ${0} <ha-input autofocus .value="${0}" @input="${0}" .label="${0}" .validationMessage="${0}" required auto-validate></ha-input> <ha-input .value="${0}" @input="${0}" .label="${0}" type="number" .hint="${0}"></ha-input> <ha-icon-picker .hass="${0}" .value="${0}" @value-changed="${0}" .label="${0}"> ${0} </ha-icon-picker> <h3 class="header"> ${0} </h3> ${0} <ha-area-picker no-add .hass="${0}" @value-changed="${0}" .excludeAreas="${0}" .addButtonLabel="${0}"></ha-area-picker> <h3 class="header"> ${0} </h3> <p class="description"> ${0} </p> <ha-aliases-editor .hass="${0}" .aliases="${0}" @value-changed="${0}"></ha-aliases-editor> </div> </div> <ha-dialog-footer slot="footer"> <ha-button appearance="plain" slot="secondaryAction" @click="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" @click="${0}" .disabled="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this._open,a?this.hass.localize("ui.panel.config.floors.editor.update_floor"):this.hass.localize("ui.panel.config.floors.editor.create_floor"),this._dialogClosed,this._error?(0,r.qy)(x||(x=Z`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):"",a?(0,r.qy)(C||(C=Z` <ha-settings-row> <span slot="heading"> ${0} </span> <span slot="description">${0}</span> </ha-settings-row> `),this.hass.localize("ui.panel.config.floors.editor.floor_id"),a.floor_id):r.s6,this._name,this._nameChanged,this.hass.localize("ui.panel.config.floors.editor.name"),this.hass.localize("ui.panel.config.floors.editor.name_required"),this._level,this._levelChanged,this.hass.localize("ui.panel.config.floors.editor.level"),this.hass.localize("ui.panel.config.floors.editor.level_helper"),this.hass,this._icon,this._iconChanged,this.hass.localize("ui.panel.config.areas.editor.icon"),this._icon?r.s6:(0,r.qy)($||($=Z` <ha-floor-icon slot="start" .floor="${0}"></ha-floor-icon> `),{level:this._level}),this.hass.localize("ui.panel.config.floors.editor.areas_section"),t.length?(0,r.qy)(k||(k=Z`<ha-chip-set> ${0} </ha-chip-set>`),(0,n.u)(t,e=>e.area_id,e=>(0,r.qy)(S||(S=Z`<ha-input-chip .area="${0}" @click="${0}" @remove="${0}" .label="${0}"> ${0} </ha-input-chip>`),e,this._openArea,this._removeArea,null==e?void 0:e.name,e.icon?(0,r.qy)(A||(A=Z`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),e.icon):(0,r.qy)(M||(M=Z`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),T)))):(0,r.qy)(L||(L=Z`<p class="description"> ${0} </p>`),this.hass.localize("ui.panel.config.floors.editor.areas_description")),this.hass,this._addArea,t.map(e=>e.area_id),this.hass.localize("ui.panel.config.floors.editor.add_area"),this.hass.localize("ui.panel.config.floors.editor.aliases_section"),this.hass.localize("ui.panel.config.floors.editor.aliases_description"),this.hass,this._aliases,this._aliasesChanged,this.closeDialog,this.hass.localize("ui.common.cancel"),this._updateEntry,!!this._submitting,a?this.hass.localize("ui.common.save"):this.hass.localize("ui.common.create"))}_openArea(e){const t=e.target.area;(0,y.J)(this,{entry:t,updateEntry:e=>(0,f.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){var t;this._error=void 0,this._name=null!==(t=e.target.value)&&void 0!==t?t:""}_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(t){this._error=t.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[b.RF,b.nA,(0,r.AH)(E||(E=Z`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===(null==e?void 0:e.floor_id)||a.has(t.area_id))&&!i.has(t.area_id)))}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],H.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_name",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_aliases",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_icon",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_level",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_error",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_params",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_submitting",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_addedAreas",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_removedAreas",void 0),(0,o.Cg)([(0,s.wk)()],H.prototype,"_open",void 0),H=(0,o.Cg)([(0,s.EM)("dialog-floor-registry-detail")],H),i()}catch(w){i(w)}})},34023:function(e,t,a){a.d(t,{E:function(){return o},J:function(){return r}});a(3362),a(62953);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(33889),a.e(62574),a.e(26092),a.e(39005),a.e(8851),a.e(66201),a.e(52808),a.e(33887),a.e(33790),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:function(e,t,a){a.d(t,{V:function(){return o}});var i=a(37177);const o=e=>!!e&&i.n},37177:function(e,t,a){a.d(t,{n:function(){return i}});a(27495);const i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},88438:function(e,t,a){a.d(t,{C:function(){return i}});const i="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}}]);