"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["56382"],{63708:function(t,e,a){a.d(e,{fW:function(){return r}});a(18111),a(13579);var i=a(44537),o=a(36312);const r=(t,e)=>(l(e)||n(t,e))&&!d(t,e)&&s(t,e),n=(t,e)=>!e.component||(0,i.e)(e.component).some(e=>(0,o.x)(t,e)),s=(t,e)=>!e.not_component||!(0,i.e)(e.not_component).some(e=>(0,o.x)(t,e)),l=t=>t.core,d=(t,e)=>(t=>t.advancedOnly)(e)&&!(t=>{var e;return null===(e=t.userData)||void 0===e?void 0:e.showAdvanced})(t)},26218:function(t,e,a){a.d(e,{a:function(){return o}});a(16280);const i=(0,a(77796).n)(t=>{history.replaceState({scrollPosition:t},"")},300);function o(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const o=e.connectedCallback;e.connectedCallback=function(){o.call(this);const e=this[a];e&&this.updateComplete.then(()=>{const a=this.renderRoot.querySelector(t);a&&setTimeout(()=>{a.scrollTop=e},0)})};const r=Object.getOwnPropertyDescriptor(e,a);let n;if(void 0===r)n={get(){var t;return this[`__${String(a)}`]||(null===(t=history.state)||void 0===t?void 0:t.scrollPosition)},set(t){i(t),this[`__${String(a)}`]=t},configurable:!0,enumerable:!0};else{const t=r.set;n=Object.assign(Object.assign({},r),{},{set(e){i(e),this[`__${String(a)}`]=e,null==t||t.call(this,e)}})}Object.defineProperty(e,a,n)}}},76830:function(t,e,a){a.d(e,{d:function(){return i}});a(18111),a(20116);const i=(t,e=!0)=>{if(t.defaultPrevented||0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey)return;const a=t.composedPath().find(t=>"A"===t.tagName);if(!a||a.target||a.hasAttribute("download")||"external"===a.getAttribute("rel"))return;let i=a.href;if(!i||-1!==i.indexOf("mailto:"))return;const o=window.location,r=o.origin||o.protocol+"//"+o.host;return i.startsWith(r)&&(i=i.slice(r.length),"#"!==i)?(e&&t.preventDefault(),i):void 0}},69093:function(t,e,a){a.d(e,{t:function(){return o}});var i=a(71727);const o=t=>(0,i.m)(t.entity_id)},82286:function(t,e,a){a.d(e,{$:function(){return i}});const i=(t,e)=>o(t.attributes,e),o=(t,e)=>0!==(t.supported_features&e)},77090:function(t,e,a){a.d(e,{s:function(){return i}});const i=t=>!(!t.detail.selected||"property"!==t.detail.source)&&(t.currentTarget.selected=!1,!0)},80880:function(t,e,a){a.d(e,{Y:function(){return i}});a(84864),a(57465),a(27495),a(25440);const i=(t,e="_")=>{const a="àáâäæãåāăąабçćčđďдèéêëēėęěеёэфğǵгḧхîïíīįìıİийкłлḿмñńǹňнôöòóœøōõőоṕпŕřрßśšşșсťțтûüùúūǘůűųувẃẍÿýыžźżз·",i=`aaaaaaaaaaabcccdddeeeeeeeeeeefggghhiiiiiiiiijkllmmnnnnnoooooooooopprrrsssssstttuuuuuuuuuuvwxyyyzzzz${e}`,o=new RegExp(a.split("").join("|"),"g"),r={"ж":"zh","х":"kh","ц":"ts","ч":"ch","ш":"sh","щ":"shch","ю":"iu","я":"ia"};let n;return""===t?n="":(n=t.toString().toLowerCase().replace(o,t=>i.charAt(a.indexOf(t))).replace(/[а-я]/g,t=>r[t]||"").replace(/(\d),(?=\d)/g,"$1").replace(/[^a-z0-9]+/g,e).replace(new RegExp(`(${e})\\1+`,"g"),"$1").replace(new RegExp(`^${e}+`),"").replace(new RegExp(`${e}+$`),""),""===n&&(n="unknown")),n}},77796:function(t,e,a){a.d(e,{n:function(){return i}});a(62953);const i=(t,e,a=!0,i=!0)=>{let o,r=0;const n=(...n)=>{const s=()=>{r=!1===a?0:Date.now(),o=void 0,t(...n)},l=Date.now();r||!1!==a||(r=l);const d=e-(l-r);d<=0||d>e?(o&&(clearTimeout(o),o=void 0),r=l,t(...n)):o||!1===i||(o=window.setTimeout(s,d))};return n.cancel=()=>{clearTimeout(o),o=void 0,r=0},n}},76776:function(t,e,a){a(62953);var i=a(40445),o=a(96196),r=a(77845);let n,s,l,d=t=>t;class h extends o.WF{render(){return(0,o.qy)(n||(n=d` ${0} <slot></slot> `),this.header?(0,o.qy)(s||(s=d`<h1 class="card-header">${0}</h1>`),this.header):o.s6)}constructor(...t){super(...t),this.raised=!1}}h.styles=(0,o.AH)(l||(l=d`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
    :host
      ::slotted(
        .card-content:not(:nth-child(1 of .card-content, .card-header))
      ),
    slot:not(:first-child)::slotted(.card-content) {
      padding-top: 0;
      margin-top: calc(var(--ha-space-2) * -1);
    }
    :host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`)),(0,i.Cg)([(0,r.MZ)()],h.prototype,"header",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"raised",void 0),h=(0,i.Cg)([(0,r.EM)("ha-card")],h)},27661:function(t,e,a){var i=a(40445),o=a(51978),r=a(94743),n=a(77845),s=a(96196),l=a(63091);let d,h,c,p=t=>t;class g extends o.n{firstUpdated(t){super.firstUpdated(t),this.style.setProperty("--mdc-theme-secondary","var(--primary-color)")}}g.styles=[r.R,(0,s.AH)(d||(d=p`:host{--mdc-typography-button-text-transform:none;--mdc-typography-button-font-size:var(--ha-font-size-l);--mdc-typography-button-font-family:var(--ha-font-family-body);--mdc-typography-button-font-weight:var(--ha-font-weight-medium)}:host .mdc-fab--extended{border-radius:var(--ha-button-border-radius,var(--ha-border-radius-pill))}:host .mdc-fab.mdc-fab--extended .ripple{border-radius:var(--ha-button-border-radius,var(--ha-border-radius-pill))}:host .mdc-fab--extended .mdc-fab__icon{margin-inline-start:-8px;margin-inline-end:12px;direction:var(--direction)}:disabled{--mdc-theme-secondary:var(--disabled-text-color);cursor:not-allowed!important}`)),"rtl"===l.G.document.dir?(0,s.AH)(h||(h=p`:host .mdc-fab--extended .mdc-fab__icon{direction:rtl}`)):(0,s.AH)(c||(c=p``))],g=(0,i.Cg)([(0,n.EM)("ha-fab")],g)},90248:function(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaIconButtonArrowPrev:function(){return u}});a(62953);var o=a(40445),r=a(96196),n=a(77845),s=a(63091),l=a(26300),d=t([l]);l=(d.then?(await d)():d)[0];let h,c=t=>t;const p="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",g="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class u extends r.WF{render(){var t;return(0,r.qy)(h||(h=c` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===s.G.document.dir?g:p}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)()],u.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)()],u.prototype,"href",void 0),(0,o.Cg)([(0,n.MZ)()],u.prototype,"target",void 0),(0,o.Cg)([(0,n.MZ)()],u.prototype,"rel",void 0),(0,o.Cg)([(0,n.MZ)()],u.prototype,"download",void 0),(0,o.Cg)([(0,n.wk)()],u.prototype,"_icon",void 0),u=(0,o.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],u),i()}catch(h){i(h)}})},26300:function(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaIconButton:function(){return v}});a(62953);var o=a(40445),r=a(96196),n=a(77845),s=a(32288),l=a(18350),d=(a(67094),t([l]));l=(d.then?(await d)():d)[0];let h,c,p,g,u=t=>t;class v extends r.WF{render(){return(0,r.qy)(h||(h=u` <ha-button appearance="plain" variant="neutral" aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}" .iconTag="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"> ${0} </ha-button> `),(0,s.J)(this.label),(0,s.J)(this.hideTitle?void 0:this.label),(0,s.J)(this.ariaHasPopup),this.disabled,this.path?"ha-svg-icon":"span",this.href,this.target,this.rel,this.download,this.path?(0,r.qy)(c||(c=u`<ha-svg-icon .path="${0}"></ha-svg-icon>`),this.path):(0,r.qy)(p||(p=u`<span><slot></slot></span>`)))}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}v.shadowRootOptions={mode:"open",delegatesFocus:!0},v.styles=(0,r.AH)(g||(g=u`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
        --ha-icon-button-padding-inline,
        --ha-space-2
      );--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1}@media (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`)),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)({type:String})],v.prototype,"path",void 0),(0,o.Cg)([(0,n.MZ)({type:String})],v.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],v.prototype,"ariaHasPopup",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],v.prototype,"hideTitle",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"selected",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"href",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"target",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"rel",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"download",void 0),v=(0,o.Cg)([(0,n.EM)("ha-icon-button")],v),i()}catch(h){i(h)}})},3449:function(t,e,a){a(62953);var i=a(40445),o=a(96196),r=a(77845);let n,s,l=t=>t;class d extends o.WF{render(){return(0,o.qy)(n||(n=l`<slot></slot>`))}constructor(...t){super(...t),this.disabled=!1}}d.styles=(0,o.AH)(s||(s=l`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:.75rem;padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px;letter-spacing:var(
        --mdc-typography-caption-letter-spacing,
        .0333333333em
      );line-height:normal}:host([disabled]){color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}`)),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),d=(0,i.Cg)([(0,r.EM)("ha-input-helper-text")],d)},28732:function(t,e,a){var i=a(40445),o=a(27686),r=a(7731),n=a(96196),s=a(77845);let l,d,h,c=t=>t;class p extends o.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[r.R,(0,n.AH)(l||(l=c`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,n.AH)(d||(d=c`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,n.AH)(h||(h=c``))]}}p=(0,i.Cg)([(0,s.EM)("ha-list-item")],p)},8630:function(t,e,a){var i=a(40445),o=a(70402),r=a(11081),n=a(77845);class s extends o.iY{}s.styles=r.R,s=(0,i.Cg)([(0,n.EM)("ha-list")],s)},2054:function(t,e,a){a.a(t,async function(t,e){try{a(16280),a(62953);var i=a(40445),o=a(96196),r=a(77845),n=a(1087),s=a(44249),l=a(26300),d=t([l]);l=(d.then?(await d)():d)[0];let h,c,p,g=t=>t;const u="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class v extends o.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return o.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,o.qy)(h||(h=g` <ha-icon-button .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),u,this._toggleMenu,t?(0,o.qy)(c||(c=g`<div class="dot"></div>`)):"")}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,a=t.has("narrow")?t.get("narrow"):this.narrow,i=!1===(null==e?void 0:e.kioskMode)&&(a||"always_hidden"===(null==e?void 0:e.dockedSidebar)),o=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&i===o||(this._show=o||this._alwaysVisible,o?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,s.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,n.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}v.styles=(0,o.AH)(p||(p=g`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`)),(0,i.Cg)([(0,r.MZ)({type:Boolean})],v.prototype,"narrow",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,i.Cg)([(0,r.wk)()],v.prototype,"_hasNotifications",void 0),(0,i.Cg)([(0,r.wk)()],v.prototype,"_show",void 0),v=(0,i.Cg)([(0,r.EM)("ha-menu-button")],v),e()}catch(h){e(h)}})},54276:function(t,e,a){a(62953);var i=a(40445),o=a(76482),r=a(91382),n=a(96245),s=a(96196),l=a(77845);let d;class h extends r.n{attach(t){super.attach(t),this.attachableTouchController.attach(t)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(t,e){null==t||t.removeEventListener("touchend",this._handleTouchEnd),null==e||e.addEventListener("touchend",this._handleTouchEnd)}constructor(...t){super(...t),this.attachableTouchController=new o.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}h.styles=[n.R,(0,s.AH)(d||(d=(t=>t)`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
          --ha-ripple-hover-color,
          var(--ha-ripple-color, var(--secondary-text-color))
        );--md-ripple-pressed-color:var(
          --ha-ripple-pressed-color,
          var(--ha-ripple-color, var(--secondary-text-color))
        )}`))],h=(0,i.Cg)([(0,l.EM)("ha-ripple")],h)},65829:function(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaSpinner:function(){return c}});var o=a(40445),r=a(55262),n=a(96196),s=a(77845),l=t([r]);r=(l.then?(await l)():l)[0];let d,h=t=>t;class c extends r.A{updated(t){if(super.updated(t),t.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[r.A.styles,(0,n.AH)(d||(d=h`:host{--indicator-color:var(
            --ha-spinner-indicator-color,
            var(--primary-color)
          );--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}(0,o.Cg)([(0,s.MZ)()],c.prototype,"size",void 0),c=(0,o.Cg)([(0,s.EM)("ha-spinner")],c),i()}catch(d){i(d)}})},67094:function(t,e,a){a.r(e),a.d(e,{HaSvgIcon:function(){return c}});var i=a(40445),o=a(96196),r=a(77845);let n,s,l,d,h=t=>t;class c extends o.WF{render(){return(0,o.JW)(n||(n=h` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,o.JW)(s||(s=h`<path class="primary-path" d="${0}"></path>`),this.path):o.s6,this.secondaryPath?(0,o.JW)(l||(l=h`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):o.s6)}}c.styles=(0,o.AH)(d||(d=h`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`)),(0,i.Cg)([(0,r.MZ)()],c.prototype,"path",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],c.prototype,"secondaryPath",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],c.prototype,"viewBox",void 0),c=(0,i.Cg)([(0,r.EM)("ha-svg-icon")],c)},43831:function(t,e,a){a(62953);var i=a(40445),o=a(96196),r=a(77845),n=a(32288);a(54276);let s,l,d=t=>t;class h extends o.WF{render(){return(0,o.qy)(s||(s=d` <div tabindex="0" role="tab" aria-selected="${0}" aria-label="${0}" @keydown="${0}"> <slot name="icon"></slot> <span class="name">${0}</span> <ha-ripple></ha-ripple> </div> `),this.active,(0,n.J)(this.name),this._handleKeyDown,this.name)}_handleKeyDown(t){"Enter"===t.key&&t.target.click()}constructor(...t){super(...t),this.active=!1,this.narrow=!1}}h.styles=(0,o.AH)(l||(l=d`div{padding:0 32px;display:flex;flex-direction:column;text-align:center;box-sizing:border-box;align-items:center;justify-content:center;width:100%;height:var(--header-height);cursor:pointer;position:relative;outline:0}:host(:not([narrow])) div{flex-direction:row;gap:var(--ha-space-2)}.name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}:host([active]){color:var(--primary-color)}:host(:not([narrow])[active]) div{border-bottom:2px solid var(--primary-color)}:host([narrow]){min-width:0;display:flex;justify-content:center;overflow:hidden}:host([narrow]) div{padding:0 4px}::slotted([slot=icon]){margin-bottom:var(--ha-space-1)}:host(:not([narrow])) ::slotted([slot=icon]){margin-bottom:0}div:focus-visible:before{position:absolute;display:block;content:"";inset:0;background-color:var(--secondary-text-color);opacity:.08}`)),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"active",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"narrow",void 0),(0,i.Cg)([(0,r.MZ)()],h.prototype,"name",void 0),h=(0,i.Cg)([(0,r.EM)("ha-tab")],h)},34127:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var i=a(40445),o=a(52630),r=a(96196),n=a(77845),s=t([o]);o=(s.then?(await s)():s)[0];let l,d=t=>t;class h extends o.A{static get styles(){return[o.A.styles,(0,r.AH)(l||(l=d`:host{--wa-tooltip-background-color:var(
            --ha-tooltip-background-color,
            var(--secondary-background-color)
          );--wa-tooltip-content-color:var(
            --ha-tooltip-text-color,
            var(--primary-text-color)
          );--wa-tooltip-font-family:var(
            --ha-tooltip-font-family,
            var(--ha-font-family-body)
          );--wa-tooltip-font-size:var(
            --ha-tooltip-font-size,
            var(--ha-font-size-s)
          );--wa-tooltip-font-weight:var(
            --ha-tooltip-font-weight,
            var(--ha-font-weight-normal)
          );--wa-tooltip-line-height:var(
            --ha-tooltip-line-height,
            var(--ha-line-height-condensed)
          );--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
            --ha-tooltip-border-radius,
            var(--ha-border-radius-sm)
          );--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}`))]}constructor(...t){super(...t),this.showDelay=150,this.hideDelay=150}}(0,i.Cg)([(0,n.MZ)({attribute:"show-delay",type:Number})],h.prototype,"showDelay",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"hide-delay",type:Number})],h.prototype,"hideDelay",void 0),h=(0,i.Cg)([(0,n.EM)("ha-tooltip")],h),e()}catch(l){e(l)}})},18885:function(t,e,a){a.d(e,{Td:function(){return i},iP:function(){return r},pz:function(){return o}});const i=(t,e)=>t.callWS({type:"config/core/update",...e}),o=t=>t.callWS({type:"config/core/detect"}),r=t=>t.callApi("POST","config/core/check_config")},44249:function(t,e,a){a.d(e,{V:function(){return i}});a(62953);const i=(t,e)=>{const a=new o,i=t.subscribeMessage(t=>e(a.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{i.then(t=>null==t?void 0:t())}};class o{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications={...this.notifications,...t.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},53812:function(t,e,a){a.d(e,{G5:function(){return n},Rz:function(){return d},TW:function(){return r},YC:function(){return o},Yx:function(){return s},kg:function(){return h}});var i=a(91926);const o=t=>t.callWS({type:"zone/list"}),r=(t,e)=>t.callWS(Object.assign({type:"zone/create"},e)),n=(t,e,a)=>t.callWS(Object.assign({type:"zone/update",zone_id:e},a)),s=(t,e)=>t.callWS({type:"zone/delete",zone_id:e});let l;const d=t=>{l=t,(0,i.o)("/config/zone/new")},h=()=>{const t=l;return l=void 0,t}},23296:function(t,e,a){a.a(t,async function(t,i){try{a.r(e);a(62953);var o=a(40445),r=a(96196),n=a(77845),s=a(91926),l=a(65829),d=a(90248),h=a(2054),c=a(14503),p=t([l,d,h]);[l,d,h]=p.then?(await p)():p;let g,u,v,m,f,b,y=t=>t;class x extends r.WF{render(){var t;return(0,r.qy)(g||(g=y` ${0} <div class="content"> <ha-spinner></ha-spinner> ${0} </div> `),this.noToolbar?"":(0,r.qy)(u||(u=y`<div class="toolbar"> ${0} </div>`),this.rootnav||null!==(t=history.state)&&void 0!==t&&t.root?(0,r.qy)(v||(v=y` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):(0,r.qy)(m||(m=y` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)),this.message?(0,r.qy)(f||(f=y`<div id="loading-text">${0}</div>`),this.message):r.s6)}_handleBack(){(0,s.O)()}static get styles(){return[c.RF,(0,r.AH)(b||(b=y`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto}.content{height:calc(100% - var(--header-height));display:flex;flex-direction:column;align-items:center;justify-content:center}#loading-text{max-width:350px;margin-top:16px}`))]}constructor(...t){super(...t),this.noToolbar=!1,this.rootnav=!1,this.narrow=!1}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-toolbar"})],x.prototype,"noToolbar",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],x.prototype,"rootnav",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],x.prototype,"narrow",void 0),(0,o.Cg)([(0,n.MZ)()],x.prototype,"message",void 0),x=(0,o.Cg)([(0,n.EM)("hass-loading-screen")],x),i()}catch(g){i(g)}})},40511:function(t,e,a){a.a(t,async function(t,e){try{a(18111),a(22489),a(20116),a(61701),a(3362),a(62953),a(3296),a(27208),a(48408),a(14603),a(47566),a(98721);var i=a(40445),o=a(96196),r=a(77845),n=a(94333),s=a(22786),l=a(63708),d=a(26218),h=a(76830),c=a(91926),p=a(90248),g=a(2054),u=(a(67094),a(43831),a(14503)),v=t([p,g]);[p,g]=v.then?(await v)():v;let m,f,b,y,x,w,_,k,z,C,$,M,Z=t=>t;const E=t=>t.endsWith("/")&&t.length>1?t.slice(0,-1):t;class H extends o.WF{willUpdate(t){if(t.has("route")){const t=`${this.route.prefix}${this.route.path}`;this._activeTab=this.tabs.find(e=>this._isActiveTabPath(e.path,t))}super.willUpdate(t)}render(){var t;const e=this._getTabs(this.tabs,this._activeTab,this.hass.config.components,this.hass.language,this.hass.userData,this.narrow,this.localizeFunc||this.hass.localize);return(0,o.qy)(m||(m=Z` <div class="toolbar ${0}"> <slot name="toolbar"> <div class="toolbar-content"> ${0} ${0} ${0} <div id="toolbar-icon"> <slot name="toolbar-icon"></slot> </div> </div> </slot> ${0} </div> <div class="container"> ${0} <div class="content ha-scrollbar" @scroll="${0}"> <slot></slot> ${0} </div> </div> <div id="fab"> <slot name="fab"></slot> </div> `),(0,n.H)({narrow:this.narrow}),this.mainPage||!this.backPath&&null!==(t=history.state)&&void 0!==t&&t.root?(0,o.qy)(f||(f=Z` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,o.qy)(b||(b=Z` <ha-icon-button-arrow-prev .href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,o.qy)(y||(y=Z` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.narrow||!this.showTabs?(0,o.qy)(x||(x=Z`<div class="main-title"> <slot name="header">${0}</slot> </div>`),this.showTabs?"":e[0]):"",this.showTabs&&!this.narrow?(0,o.qy)(w||(w=Z`<div id="tabbar">${0}</div>`),e):"",this.showTabs&&this.narrow?(0,o.qy)(_||(_=Z`<div id="tabbar" class="bottom-bar">${0}</div>`),e):"",this.pane?(0,o.qy)(k||(k=Z`<div class="pane"> <div class="shadow-container"></div> <div class="ha-scrollbar"> <slot name="pane"></slot> </div> </div>`)):o.s6,this._saveScrollPos,this.hasFab?(0,o.qy)(z||(z=Z`<div class="fab-bottom-space"></div>`)):o.s6)}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,c.O)()}_isActiveTabPath(t,e){try{const a=new URL(t,window.location.origin),i=new URL(e,window.location.origin),o=E(a.pathname),r=E(i.pathname);return!(r!==o&&!r.startsWith(`${o}/`))}catch(a){return e===t||e.startsWith(`${t}/`)}}async _tabClicked(t){const e=(0,h.d)(t);e&&await(0,c.o)(e,{replace:!0})}static get styles(){return[u.dp,(0,o.AH)(C||(C=Z`:host{display:block;height:100%;background-color:var(--primary-background-color)}:host([narrow]){width:100%;position:fixed}.container{display:flex;height:calc(100% - var(--header-height,0px) - var(--safe-area-inset-top,0px))}ha-menu-button{margin-right:24px;margin-inline-end:24px;margin-inline-start:initial}.toolbar{font-size:var(--ha-font-size-xl);height:calc(var(--header-height,0px) + var(--safe-area-inset-top,0px));padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right);background-color:var(--sidebar-background-color);font-weight:var(--ha-font-weight-normal);border-bottom:1px solid var(--divider-color);box-sizing:border-box}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{padding:8px 12px;display:flex;align-items:center;height:100%;box-sizing:border-box}:host([narrow]) .toolbar-content{padding:4px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}.bottom-bar a{width:25%}#tabbar{display:flex;font-size:var(--ha-font-size-m);overflow:hidden}#tabbar>a{overflow:hidden;max-width:45%}#tabbar.bottom-bar{position:absolute;bottom:0;left:0;padding:0 16px;box-sizing:border-box;background-color:var(--sidebar-background-color);border-top:1px solid var(--divider-color);justify-content:space-around;z-index:2;font-size:var(--ha-font-size-s);width:100%;padding-bottom:var(--safe-area-inset-bottom)}#tabbar:not(.bottom-bar){flex:1;justify-content:center}:host(:not([narrow])) #toolbar-icon{min-width:40px}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;flex-shrink:0;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{flex:1;max-height:var(--header-height);line-height:var(--ha-line-height-normal);color:var(--sidebar-text-color);margin-inline-start:var(--main-title-margin,var(--ha-space-6))}.narrow .main-title{margin-inline-start:var(--main-title-margin,var(--ha-space-2))}.content{position:relative;width:100%;margin-right:var(--safe-area-inset-right);margin-inline-end:var(--safe-area-inset-right);overflow:auto;-webkit-overflow-scrolling:touch}:host([narrow]) .content{margin-left:var(--safe-area-inset-left);margin-inline-start:var(--safe-area-inset-left)}:host([narrow][show-tabs]) .content{margin-bottom:calc(var(--header-height,0px) + var(--safe-area-inset-bottom,0px))}.content .fab-bottom-space{height:calc(64px + var(--safe-area-inset-bottom,0px))}:host([narrow][show-tabs]) .content .fab-bottom-space{height:calc(80px + var(--safe-area-inset-bottom,0px))}#fab{position:fixed;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2)}:host([narrow][show-tabs]) #fab{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:24px;right:24px;inset-inline-end:24px;inset-inline-start:initial}.pane{border-right:1px solid var(--divider-color);border-inline-end:1px solid var(--divider-color);border-inline-start:initial;box-sizing:border-box;display:flex;flex:0 0 var(--sidepane-width,250px);width:var(--sidepane-width,250px);flex-direction:column;position:relative}.pane .ha-scrollbar{flex:1}`))]}constructor(...t){super(...t),this.mainPage=!1,this.narrow=!1,this.isWide=!1,this.pane=!1,this.hasFab=!1,this.showTabs=!1,this._getTabs=(0,s.A)((t,e,a,i,r,n,s)=>{const d=t.filter(t=>(0,l.fW)(this.hass,t));if(d.length<2){if(this.showTabs=!1,1===d.length){const t=d[0];return[t.translationKey?s(t.translationKey):t.name]}return[""]}return this.showTabs=!0,d.map(t=>(0,o.qy)($||($=Z` <a href="${0}" @click="${0}"> <ha-tab .active="${0}" .narrow="${0}" .name="${0}"> ${0} </ha-tab> </a> `),t.path,this._tabClicked,t.path===(null==e?void 0:e.path),this.narrow,t.translationKey?s(t.translationKey):t.name,t.iconPath?(0,o.qy)(M||(M=Z`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),t.iconPath):""))})}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"localizeFunc",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"back-path"})],H.prototype,"backPath",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"backCallback",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"main-page"})],H.prototype,"mainPage",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"route",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"tabs",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],H.prototype,"narrow",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"is-wide"})],H.prototype,"isWide",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],H.prototype,"pane",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"has-fab"})],H.prototype,"hasFab",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"show-tabs",reflect:!0})],H.prototype,"showTabs",void 0),(0,i.Cg)([(0,r.wk)()],H.prototype,"_activeTab",void 0),(0,i.Cg)([(0,d.a)(".content")],H.prototype,"_savedScrollPos",void 0),(0,i.Cg)([(0,r.Ls)({passive:!0})],H.prototype,"_saveScrollPos",null),H=(0,i.Cg)([(0,r.EM)("hass-tabs-subpage")],H),e()}catch(m){e(m)}})},20820:function(t,e,a){a(62953);var i=a(40445),o=a(96196),r=a(77845),n=a(94333);let s,l,d=t=>t;class h extends o.WF{render(){return(0,o.qy)(s||(s=d` <div class="content ${0}"> <div class="header"><slot name="header"></slot></div> <div class="together layout ${0}"> <div class="intro"><slot name="introduction"></slot></div> <div class="panel flex-auto"><slot></slot></div> </div> </div> `),(0,n.H)({narrow:!this.isWide,"full-width":this.fullWidth}),(0,n.H)({narrow:!this.isWide,vertical:this.vertical||!this.isWide,horizontal:!this.vertical&&this.isWide}))}constructor(...t){super(...t),this.isWide=!1,this.vertical=!1,this.fullWidth=!1}}h.styles=(0,o.AH)(l||(l=d`:host{display:block}.content{padding:28px 20px 0;max-width:1040px;margin:0 auto}.layout{display:flex}.horizontal{flex-direction:row}.vertical{flex-direction:column}.flex-auto{flex:1 1 auto}.header{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);opacity:var(--dark-primary-opacity)}.together{margin-top:var(--config-section-content-together-margin-top,32px)}.intro{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal);width:100%;opacity:var(--dark-primary-opacity);font-size:var(--ha-font-size-m);padding-bottom:20px}.horizontal .intro{max-width:400px;margin-right:40px;margin-inline-end:40px;margin-inline-start:initial}.panel{margin-top:-24px}.panel ::slotted(*){margin-top:24px;display:block}.narrow.content{max-width:640px}.narrow .together{margin-top:var(--config-section-narrow-content-together-margin-top,var(--config-section-content-together-margin-top,20px))}.narrow .intro{padding-bottom:20px;margin-right:0;margin-inline-end:0;margin-inline-start:initial;max-width:500px}.full-width{padding:0}.full-width .layout{flex-direction:column}`)),(0,i.Cg)([(0,r.MZ)({attribute:"is-wide",type:Boolean})],h.prototype,"isWide",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],h.prototype,"vertical",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"full-width"})],h.prototype,"fullWidth",void 0),h=(0,i.Cg)([(0,r.EM)("ha-config-section")],h)},49492:function(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaConfigZone:function(){return N}});a(74423),a(26910),a(18111),a(22489),a(20116),a(61701),a(3362),a(27495),a(62953),a(48408),a(14603),a(47566),a(98721);var o=a(40445),r=a(96196),n=a(77845),s=a(22786),l=a(69093),d=a(77090),h=a(91926),c=a(52220),p=a(80880),g=a(18350),u=(a(76776),a(27661),a(26300)),v=(a(8630),a(28732),a(67094),a(34127)),m=a(99257),f=a(18885),b=a(59241),y=a(53812),x=a(65063),w=a(23296),_=a(40511),k=a(54706),z=(a(20820),a(25635)),C=a(59644),$=a(42952),M=t([g,u,v,m,w,_]);[g,u,v,m,w,_]=M.then?(await M)():M;let Z,E,H,T,P,L,A,q,W,S,I,B=t=>t;const j="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",O="M18.66,2C18.4,2 18.16,2.09 17.97,2.28L16.13,4.13L19.88,7.88L21.72,6.03C22.11,5.64 22.11,5 21.72,4.63L19.38,2.28C19.18,2.09 18.91,2 18.66,2M3.28,4L2,5.28L8.5,11.75L4,16.25V20H7.75L12.25,15.5L18.72,22L20,20.72L13.5,14.25L9.75,10.5L3.28,4M15.06,5.19L11.03,9.22L14.78,12.97L18.81,8.94L15.06,5.19Z",V="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class N extends((0,k.E)(r.WF)){hassSubscribe(){return[(0,b.Bz)(this.hass.connection,t=>{this._regEntities=t.map(t=>t.entity_id),this._filterStates()})]}render(){if(!this.hass||void 0===this._storageItems||void 0===this._stateItems)return(0,r.qy)(Z||(Z=B`<hass-loading-screen></hass-loading-screen>`));const t=this.hass,e=0===this._storageItems.length&&0===this._stateItems.length?(0,r.qy)(E||(E=B` <div class="empty"> ${0} <br> <ha-button size="small" @click="${0}"> ${0}</ha-button> </div> `),t.localize("ui.panel.config.zone.no_zones_created_yet"),this._createZone,t.localize("ui.panel.config.zone.create_zone")):(0,r.qy)(H||(H=B` <ha-list> ${0} ${0} </ha-list> `),this._storageItems.map(e=>(0,r.qy)(T||(T=B` <ha-list-item .entry="${0}" .id="${0}" graphic="icon" .hasMeta="${0}" @request-selected="${0}" .value="${0}" ?selected="${0}"> <ha-icon .icon="${0}" slot="graphic"></ha-icon> ${0} ${0} </ha-list-item> `),e,this.narrow?e.id:"",!this.narrow,this._itemClicked,e.id,this._activeEntry===e.id,e.icon,e.name,this.narrow?"":(0,r.qy)(P||(P=B` <div slot="meta"> <ha-icon-button .id="${0}" .entry="${0}" @click="${0}" .path="${0}" .label="${0}"></ha-icon-button> </div> `),e.id,e,this._openEditEntry,j,t.localize("ui.common.edit_item",{name:e.name})))),this._stateItems.map(e=>(0,r.qy)(L||(L=B` <ha-list-item graphic="icon" .id="${0}" .hasMeta="${0}" .value="${0}" @request-selected="${0}" ?selected="${0}" .noEdit="${0}"> <ha-icon .icon="${0}" slot="graphic"> </ha-icon> ${0} ${0} </ha-list-item> `),this.narrow?e.entity_id:"",!this.narrow||"zone.home"!==e.entity_id,e.entity_id,this._stateItemClicked,this._activeEntry===e.entity_id,"zone.home"!==e.entity_id||!this._canEditCore,e.attributes.icon,e.attributes.friendly_name||e.entity_id,this.narrow&&"zone.home"===e.entity_id&&!this._canEditCore?r.s6:(0,r.qy)(A||(A=B`<ha-icon-button .id="zone-${0}" .entityId="${0}" .noEdit="${0}" .path="${0}" .label="${0}" @click="${0}" slot="meta"></ha-icon-button> <ha-tooltip .for="zone-${0}" placement="left" .disabled="${0}" hoist> ${0} </ha-tooltip>`),(0,p.Y)(e.entity_id),e.entity_id,"zone.home"!==e.entity_id||!this._canEditCore,"zone.home"===e.entity_id&&this._canEditCore?j:O,t.localize("ui.common.edit_item",{name:t.config.location_name}),this._editHomeZone,(0,p.Y)(e.entity_id),"zone.home"===e.entity_id,t.localize("ui.panel.config.zone.configured_in_yaml")))));return(0,r.qy)(q||(q=B` <hass-tabs-subpage .hass="${0}" .narrow="${0}" .route="${0}" .backPath="${0}" .tabs="${0}" has-fab> ${0} ${0} <ha-fab slot="fab" .label="${0}" extended @click="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-fab> </hass-tabs-subpage> `),this.hass,this.narrow,this.route,this._searchParms.has("historyBack")?void 0:"/config",z.configSections.areas,this.narrow?(0,r.qy)(W||(W=B` <ha-config-section .isWide="${0}"> <span slot="introduction"> ${0} </span> <ha-card outlined>${0}</ha-card> </ha-config-section> `),this.isWide,t.localize("ui.panel.config.zone.introduction"),e):"",this.narrow?"":(0,r.qy)(S||(S=B` <div class="flex"> <ha-locations-editor .hass="${0}" .locations="${0}" @location-updated="${0}" @radius-updated="${0}" @marker-clicked="${0}"></ha-locations-editor> <div class="overflow">${0}</div> </div> `),this.hass,this._getZones(this._storageItems,this._stateItems),this._locationUpdated,this._radiusUpdated,this._markerClicked,e),t.localize("ui.panel.config.zone.create_zone"),this._createZone,V)}firstUpdated(t){var e;super.firstUpdated(t),this._canEditCore=Boolean(null===(e=this.hass.user)||void 0===e?void 0:e.is_admin)&&["storage","default"].includes(this.hass.config.config_source),this._fetchData(),"/new"===this.route.path&&((0,h.o)("/config/zone",{replace:!0}),this._createZone())}updated(){if(!this.route.path.startsWith("/edit/")||!this._stateItems||!this._storageItems)return;const t=this.route.path.slice(6);this._editZone(t),(0,h.o)("/config/zone",{replace:!0}),this.narrow||this._zoomZone(t)}willUpdate(t){super.updated(t);const e=t.get("hass");e&&this._stateItems&&this._getStates(e)}async _fetchData(){this._storageItems=(await(0,y.YC)(this.hass)).sort((t,e)=>(0,c.xL)(t.name,e.name,this.hass.locale.language)),this._getStates()}_getStates(t){let e=!1;const a=Object.values(this.hass.states).filter(a=>"zone"===(0,l.t)(a)&&((null==t?void 0:t.states[a.entity_id])!==a&&(e=!0),!this._regEntities.includes(a.entity_id)));e&&(this._stateItems=a)}_filterStates(){if(!this._stateItems)return;const t=this._stateItems.filter(t=>!this._regEntities.includes(t.entity_id));t.length!==this._stateItems.length&&(this._stateItems=t)}async _locationUpdated(t){if(this._activeEntry=t.detail.id,"zone.home"===t.detail.id&&this._canEditCore)return void(await(0,f.Td)(this.hass,{latitude:t.detail.location[0],longitude:t.detail.location[1]}));const e=this._storageItems.find(e=>e.id===t.detail.id);e&&this._updateEntry(e,{latitude:t.detail.location[0],longitude:t.detail.location[1]})}async _radiusUpdated(t){if(this._activeEntry=t.detail.id,"zone.home"===t.detail.id&&this._canEditCore)return void(await(0,f.Td)(this.hass,{radius:Math.round(t.detail.radius)}));const e=this._storageItems.find(e=>e.id===t.detail.id);e&&this._updateEntry(e,{radius:t.detail.radius})}_markerClicked(t){this._activeEntry=t.detail.id}_createZone(){this._openDialog()}_itemClicked(t){if(!(0,d.s)(t))return;if(this.narrow)return void this._openEditEntry(t);const e=t.currentTarget.value;this._zoomZone(e),this._activeEntry=e}_stateItemClicked(t){if(!(0,d.s)(t))return;const e=t.currentTarget.value;this.narrow&&"zone.home"===e?this._editHomeZone(t):(this._zoomZone(e),this._activeEntry=e)}async _zoomZone(t){var e;null===(e=this._map)||void 0===e||e.fitMarker(t)}async _editZone(t){var e;await this.updateComplete,null===(e=this.shadowRoot)||void 0===e||null===(e=e.querySelector(`[id="${t}"]`))||void 0===e||e.click()}_openEditEntry(t){const e=t.currentTarget.entry;this._openDialog(e),t.stopPropagation()}async _editHomeZone(t){t.currentTarget.noEdit?(0,x.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.zone.can_not_edit"),text:this.hass.localize("ui.panel.config.zone.configured_in_yaml")}):(0,C.k)(this,{updateEntry:t=>this._updateHomeZoneEntry(t)})}async _createEntry(t){var e,a;const i=await(0,y.TW)(this.hass,t);this._storageItems=this._storageItems.concat(i).sort((t,e)=>(0,c.xL)(t.name,e.name,this.hass.locale.language)),this.narrow||(this._activeEntry=i.id,await this.updateComplete,await(null===(e=this._map)||void 0===e?void 0:e.updateComplete),null===(a=this._map)||void 0===a||a.fitMarker(i.id))}async _updateHomeZoneEntry(t){await(0,f.Td)(this.hass,{latitude:t.latitude,longitude:t.longitude,radius:t.radius}),this._zoomZone("zone.home")}async _updateEntry(t,e,a=!1){var i,o;const r=await(0,y.G5)(this.hass,t.id,e);this._storageItems=this._storageItems.map(e=>e===t?r:e),!this.narrow&&a&&(this._activeEntry=t.id,await this.updateComplete,await(null===(i=this._map)||void 0===i?void 0:i.updateComplete),null===(o=this._map)||void 0===o||o.fitMarker(t.id))}async _removeEntry(t){if(!(await(0,x.dk)(this,{title:this.hass.localize("ui.panel.config.zone.confirm_delete"),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})))return!1;try{var e;if(await(0,y.Yx)(this.hass,t.id),this._storageItems=this._storageItems.filter(e=>e!==t),!this.narrow)null===(e=this._map)||void 0===e||e.fitMap();return!0}catch(a){return!1}}async _openDialog(t){(0,$.b)(this,{entry:t,createEntry:t=>this._createEntry(t),updateEntry:t?e=>this._updateEntry(t,e,!0):void 0,removeEntry:t?()=>this._removeEntry(t):void 0})}constructor(...t){super(...t),this.isWide=!1,this.narrow=!1,this._searchParms=new URLSearchParams(window.location.search),this._activeEntry="",this._canEditCore=!1,this._regEntities=[],this._getZones=(0,s.A)((t,e)=>{const a=getComputedStyle(this),i=a.getPropertyValue("--accent-color"),o=a.getPropertyValue("--secondary-text-color"),r=a.getPropertyValue("--primary-color"),n=e.map(t=>({id:t.entity_id,icon:t.attributes.icon,name:t.attributes.friendly_name||t.entity_id,latitude:t.attributes.latitude,longitude:t.attributes.longitude,radius:t.attributes.radius,radius_color:"zone.home"===t.entity_id?r:t.attributes.passive?o:i,location_editable:"zone.home"===t.entity_id&&this._canEditCore,radius_editable:"zone.home"===t.entity_id&&this._canEditCore}));return t.map(t=>Object.assign(Object.assign({},t),{},{radius_color:t.passive?o:i,location_editable:!0,radius_editable:!0})).concat(n)})}}N.styles=(0,r.AH)(I||(I=B`hass-loading-screen{--app-header-background-color:var(--sidebar-background-color);--app-header-text-color:var(--sidebar-text-color)}ha-list-item{--mdc-list-item-meta-size:48px}a{color:var(--primary-color)}ha-card{margin:16px auto;overflow:hidden}ha-icon,ha-icon-button:not([disabled]){color:var(--secondary-text-color)}ha-icon-button{--mdc-theme-text-disabled-on-light:var(--disabled-text-color)}.empty{text-align:center;padding:8px}.flex{display:flex;height:100%}.overflow{height:100%;overflow:auto}ha-locations-editor{flex-grow:1;height:100%}.flex ha-list{padding-bottom:64px}.flex .empty,.flex ha-list{border-left:1px solid var(--divider-color);width:250px;min-height:100%;box-sizing:border-box}ha-tooltip{display:block}`)),(0,o.Cg)([(0,n.MZ)({attribute:!1})],N.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"is-wide",type:Boolean})],N.prototype,"isWide",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],N.prototype,"narrow",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],N.prototype,"route",void 0),(0,o.Cg)([(0,n.wk)()],N.prototype,"_searchParms",void 0),(0,o.Cg)([(0,n.wk)()],N.prototype,"_storageItems",void 0),(0,o.Cg)([(0,n.wk)()],N.prototype,"_stateItems",void 0),(0,o.Cg)([(0,n.wk)()],N.prototype,"_activeEntry",void 0),(0,o.Cg)([(0,n.wk)()],N.prototype,"_canEditCore",void 0),(0,o.Cg)([(0,n.P)("ha-locations-editor")],N.prototype,"_map",void 0),N=(0,o.Cg)([(0,n.EM)("ha-config-zone")],N),i()}catch(Z){i(Z)}})},59644:function(t,e,a){a.d(e,{k:function(){return r}});a(3362),a(62953);var i=a(1087);const o=()=>Promise.all([a.e("91939"),a.e("2729")]).then(a.bind(a,21296)),r=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-home-zone-detail",dialogImport:o,dialogParams:e})}},42952:function(t,e,a){a.d(e,{b:function(){return r}});a(3362),a(62953);var i=a(1087);const o=()=>Promise.all([a.e("14320"),a.e("58117")]).then(a.bind(a,29508)),r=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-zone-detail",dialogImport:o,dialogParams:e})}},69235:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await a.e("71055").then(a.bind(a,52370))).default),e()}catch(i){e(i)}},1)},14503:function(t,e,a){a.d(e,{RF:function(){return p},dp:function(){return v},kO:function(){return u},nA:function(){return g},og:function(){return c}});var i=a(96196);let o,r,n,s,l,d,h=t=>t;const c=(0,i.AH)(o||(o=h`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`)),p=(0,i.AH)(r||(r=h`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease}@media (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${0} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`),c),g=(0,i.AH)(n||(n=h`
  ha-dialog,
  ha-adaptive-dialog {
    --mdc-dialog-min-width: 400px;
    --mdc-dialog-max-width: 600px;
    --mdc-dialog-max-width: min(600px, 95vw);
    --justify-action-buttons: space-between;
    --dialog-container-padding: var(--safe-area-inset-top, 0)
      var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0)
      var(--safe-area-inset-left, 0);
    --dialog-surface-padding: 0px;
  }

  ha-dialog .form,
  ha-adaptive-dialog .form {
    color: var(--primary-text-color);
  }

  a {
    color: var(--primary-color);
  }

  /* make dialog fullscreen on small screens */
  @media all and (max-width: 450px), all and (max-height: 500px) {
    ha-dialog,
    ha-adaptive-dialog {
      --mdc-dialog-min-width: 100vw;
      --mdc-dialog-max-width: 100vw;
      --mdc-dialog-min-height: 100vh;
      --mdc-dialog-min-height: 100svh;
      --mdc-dialog-max-height: 100vh;
      --mdc-dialog-max-height: 100svh;
      --dialog-container-padding: 0px;
      --dialog-surface-padding: var(--safe-area-inset-top, 0)
        var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0)
        var(--safe-area-inset-left, 0);
      --vertical-align-dialog: flex-end;
      --ha-dialog-border-radius: var(--ha-border-radius-square);
    ha-dialog,
    ha-adaptive-dialog {
     --mdc-dialog-min-width: 100vw;
     --mdc-dialog-max-width: 100vw;
     --mdc-dialog-min-height: 100vh;
     --mdc-dialog-min-height: 100svh;
     --mdc-dialog-max-height: 100vh;
     --mdc-dialog-max-height: 100svh;
     --dialog-container-padding: 0px;
     --dialog-surface-padding: var(--safe-area-inset-top, 0)
       var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0)
       var(--safe-area-inset-left, 0);
     --vertical-align-dialog: flex-end;
   }
   ha-dialog {
      --ha-dialog-border-radius: var(--ha-border-radius-square);
   }
  }
  .error {
    color: var(--error-color);
  }
`)),u=(0,i.AH)(s||(s=h`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--mdc-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    )}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`)),v=(0,i.AH)(l||(l=h`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`));(0,i.AH)(d||(d=h`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))}}]);
//# sourceMappingURL=56382.31205ef533835078.js.map