/*! For license information please see 43846.0373381ec91174bb.js.LICENSE.txt */
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["43846"],{63708:function(t,a,e){e.d(a,{fW:function(){return r}});e(18111),e(13579);var o=e(44537),i=e(36312);const r=(t,a)=>(l(a)||n(t,a))&&!h(t,a)&&s(t,a),n=(t,a)=>!a.component||(0,o.e)(a.component).some(a=>(0,i.x)(t,a)),s=(t,a)=>!a.not_component||!(0,o.e)(a.not_component).some(a=>(0,i.x)(t,a)),l=t=>t.core,h=(t,a)=>(t=>t.advancedOnly)(a)&&!(t=>{var a;return null===(a=t.userData)||void 0===a?void 0:a.showAdvanced})(t)},26218:function(t,a,e){e.d(a,{a:function(){return i}});e(16280);const o=(0,e(77796).n)(t=>{history.replaceState({scrollPosition:t},"")},300);function i(t){return(a,e)=>{if("object"==typeof e)throw new Error("This decorator does not support this compilation type.");const i=a.connectedCallback;a.connectedCallback=function(){i.call(this);const a=this[e];a&&this.updateComplete.then(()=>{const e=this.renderRoot.querySelector(t);e&&setTimeout(()=>{e.scrollTop=a},0)})};const r=Object.getOwnPropertyDescriptor(a,e);let n;if(void 0===r)n={get(){var t;return this[`__${String(e)}`]||(null===(t=history.state)||void 0===t?void 0:t.scrollPosition)},set(t){o(t),this[`__${String(e)}`]=t},configurable:!0,enumerable:!0};else{const t=r.set;n=Object.assign(Object.assign({},r),{},{set(a){o(a),this[`__${String(e)}`]=a,null==t||t.call(this,a)}})}Object.defineProperty(a,e,n)}}},76830:function(t,a,e){e.d(a,{d:function(){return o}});e(18111),e(20116);const o=(t,a=!0)=>{if(t.defaultPrevented||0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey)return;const e=t.composedPath().find(t=>"A"===t.tagName);if(!e||e.target||e.hasAttribute("download")||"external"===e.getAttribute("rel"))return;let o=e.href;if(!o||-1!==o.indexOf("mailto:"))return;const i=window.location,r=i.origin||i.protocol+"//"+i.host;return o.startsWith(r)&&(o=o.slice(r.length),"#"!==o)?(a&&t.preventDefault(),o):void 0}},69093:function(t,a,e){e.d(a,{t:function(){return i}});var o=e(71727);const i=t=>(0,o.m)(t.entity_id)},77796:function(t,a,e){e.d(a,{n:function(){return o}});e(62953);const o=(t,a,e=!0,o=!0)=>{let i,r=0;const n=(...n)=>{const s=()=>{r=!1===e?0:Date.now(),i=void 0,t(...n)},l=Date.now();r||!1!==e||(r=l);const h=a-(l-r);h<=0||h>a?(i&&(clearTimeout(i),i=void 0),r=l,t(...n)):i||!1===o||(i=window.setTimeout(s,h))};return n.cancel=()=>{clearTimeout(i),i=void 0,r=0},n}},76776:function(t,a,e){e(62953);var o=e(40445),i=e(96196),r=e(77845);let n,s,l,h=t=>t;class d extends i.WF{render(){return(0,i.qy)(n||(n=h` ${0} <slot></slot> `),this.header?(0,i.qy)(s||(s=h`<h1 class="card-header">${0}</h1>`),this.header):i.s6)}constructor(...t){super(...t),this.raised=!1}}d.styles=(0,i.AH)(l||(l=h`: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,o.Cg)([(0,r.MZ)()],d.prototype,"header",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"raised",void 0),d=(0,o.Cg)([(0,r.EM)("ha-card")],d)},27661:function(t,a,e){var o=e(40445),i=e(51978),r=e(94743),n=e(77845),s=e(96196),l=e(63091);let h,d,c,p=t=>t;class g extends i.n{firstUpdated(t){super.firstUpdated(t),this.style.setProperty("--mdc-theme-secondary","var(--primary-color)")}}g.styles=[r.R,(0,s.AH)(h||(h=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)(d||(d=p`:host .mdc-fab--extended .mdc-fab__icon{direction:rtl}`)):(0,s.AH)(c||(c=p``))],g=(0,o.Cg)([(0,n.EM)("ha-fab")],g)},90248:function(t,a,e){e.a(t,async function(t,o){try{e.r(a),e.d(a,{HaIconButtonArrowPrev:function(){return u}});e(62953);var i=e(40445),r=e(96196),n=e(77845),s=e(63091),l=e(26300),h=t([l]);l=(h.then?(await h)():h)[0];let d,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)(d||(d=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,i.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)()],u.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)()],u.prototype,"href",void 0),(0,i.Cg)([(0,n.MZ)()],u.prototype,"target",void 0),(0,i.Cg)([(0,n.MZ)()],u.prototype,"rel",void 0),(0,i.Cg)([(0,n.MZ)()],u.prototype,"download",void 0),(0,i.Cg)([(0,n.wk)()],u.prototype,"_icon",void 0),u=(0,i.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],u),o()}catch(d){o(d)}})},26300:function(t,a,e){e.a(t,async function(t,o){try{e.r(a),e.d(a,{HaIconButton:function(){return v}});e(62953);var i=e(40445),r=e(96196),n=e(77845),s=e(32288),l=e(18350),h=(e(67094),t([l]));l=(h.then?(await h)():h)[0];let d,c,p,g,u=t=>t;class v extends r.WF{render(){return(0,r.qy)(d||(d=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,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)({type:String})],v.prototype,"path",void 0),(0,i.Cg)([(0,n.MZ)({type:String})],v.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],v.prototype,"ariaHasPopup",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],v.prototype,"hideTitle",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"selected",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"href",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"target",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"rel",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"download",void 0),v=(0,i.Cg)([(0,n.EM)("ha-icon-button")],v),o()}catch(d){o(d)}})},28732:function(t,a,e){var o=e(40445),i=e(27686),r=e(7731),n=e(96196),s=e(77845);let l,h,d,c=t=>t;class p extends i.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)(h||(h=c`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,n.AH)(d||(d=c``))]}}p=(0,o.Cg)([(0,s.EM)("ha-list-item")],p)},8630:function(t,a,e){var o=e(40445),i=e(70402),r=e(11081),n=e(77845);class s extends i.iY{}s.styles=r.R,s=(0,o.Cg)([(0,n.EM)("ha-list")],s)},2054:function(t,a,e){e.a(t,async function(t,a){try{e(16280),e(62953);var o=e(40445),i=e(96196),r=e(77845),n=e(1087),s=e(44249),l=e(26300),h=t([l]);l=(h.then?(await h)():h)[0];let d,c,p,g=t=>t;const u="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class v extends i.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 i.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,i.qy)(d||(d=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,i.qy)(c||(c=g`<div class="dot"></div>`)):"")}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const a=t.has("hass")?t.get("hass"):this.hass,e=t.has("narrow")?t.get("narrow"):this.narrow,o=!1===(null==a?void 0:a.kioskMode)&&(e||"always_hidden"===(null==a?void 0:a.dockedSidebar)),i=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&o===i||(this._show=i||this._alwaysVisible,i?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,i.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,o.Cg)([(0,r.MZ)({type:Boolean})],v.prototype,"narrow",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,o.Cg)([(0,r.wk)()],v.prototype,"_hasNotifications",void 0),(0,o.Cg)([(0,r.wk)()],v.prototype,"_show",void 0),v=(0,o.Cg)([(0,r.EM)("ha-menu-button")],v),a()}catch(d){a(d)}})},54276:function(t,a,e){e(62953);var o=e(40445),i=e(76482),r=e(91382),n=e(96245),s=e(96196),l=e(77845);let h;class d 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,a){null==t||t.removeEventListener("touchend",this._handleTouchEnd),null==a||a.addEventListener("touchend",this._handleTouchEnd)}constructor(...t){super(...t),this.attachableTouchController=new i.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}d.styles=[n.R,(0,s.AH)(h||(h=(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))
        )}`))],d=(0,o.Cg)([(0,l.EM)("ha-ripple")],d)},65829:function(t,a,e){e.a(t,async function(t,o){try{e.r(a),e.d(a,{HaSpinner:function(){return c}});var i=e(40445),r=e(55262),n=e(96196),s=e(77845),l=t([r]);r=(l.then?(await l)():l)[0];let h,d=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)(h||(h=d`: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,i.Cg)([(0,s.MZ)()],c.prototype,"size",void 0),c=(0,i.Cg)([(0,s.EM)("ha-spinner")],c),o()}catch(h){o(h)}})},67094:function(t,a,e){e.r(a),e.d(a,{HaSvgIcon:function(){return c}});var o=e(40445),i=e(96196),r=e(77845);let n,s,l,h,d=t=>t;class c extends i.WF{render(){return(0,i.JW)(n||(n=d` <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,i.JW)(s||(s=d`<path class="primary-path" d="${0}"></path>`),this.path):i.s6,this.secondaryPath?(0,i.JW)(l||(l=d`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):i.s6)}}c.styles=(0,i.AH)(h||(h=d`: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,o.Cg)([(0,r.MZ)()],c.prototype,"path",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],c.prototype,"secondaryPath",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],c.prototype,"viewBox",void 0),c=(0,o.Cg)([(0,r.EM)("ha-svg-icon")],c)},43831:function(t,a,e){e(62953);var o=e(40445),i=e(96196),r=e(77845),n=e(32288);e(54276);let s,l,h=t=>t;class d extends i.WF{render(){return(0,i.qy)(s||(s=h` <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}}d.styles=(0,i.AH)(l||(l=h`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,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"active",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"narrow",void 0),(0,o.Cg)([(0,r.MZ)()],d.prototype,"name",void 0),d=(0,o.Cg)([(0,r.EM)("ha-tab")],d)},83119:function(t,a,e){var o=e(40445),i=e(96196),r=e(77845),n=e(94333),s=e(29485),l=e(28669);let h,d,c,p=t=>t;class g extends i.WF{render(){if(!this.person)return i.s6;const t=this.person.picture;if(t)return(0,i.qy)(h||(h=p`<div style="${0}" class="picture"></div>`),(0,s.W)({backgroundImage:`url(${this.hass.hassUrl(t)})`}));const a=(0,l._2)(this.person.name);return(0,i.qy)(d||(d=p`<div class="initials ${0}"> ${0} </div>`),(0,n.H)({long:a.length>2}),a)}}g.styles=(0,i.AH)(c||(c=p`:host{width:40px;height:40px;display:block}.picture{width:100%;height:100%;background-size:cover;border-radius:var(--ha-border-radius-circle)}.initials{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;width:100%;height:100%;border-radius:var(--ha-border-radius-circle);background-color:var(--light-primary-color);text-decoration:none;color:var(--text-light-primary-color,var(--primary-text-color));overflow:hidden;font-size:var(--person-badge-font-size, var(--ha-font-size-m))}.initials.long{font-size:var(--ha-person-badge-font-size-long, var(--ha-font-size-s))}`)),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"person",void 0),g=(0,o.Cg)([(0,r.EM)("ha-person-badge")],g)},44249:function(t,a,e){e.d(a,{V:function(){return o}});e(62953);const o=(t,a)=>{const e=new i,o=t.subscribeMessage(t=>a(e.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{o.then(t=>null==t?void 0:t())}};class i{processMessage(t){if("removed"===t.type)for(const a of Object.keys(t.notifications))delete this.notifications[a];else this.notifications={...this.notifications,...t.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},85547:function(t,a,e){e.d(a,{Fj:function(){return i},Gu:function(){return r},H2:function(){return s},xA:function(){return h},xs:function(){return n}});e(18111),e(20116);var o=e(69093);const i=t=>t.callWS({type:"person/list"}),r=(t,a)=>t.callWS(Object.assign({type:"person/create"},a)),n=(t,a,e)=>t.callWS(Object.assign({type:"person/update",person_id:a},e)),s=(t,a)=>t.callWS({type:"person/delete",person_id:a}),l={},h=t=>{var a;if(null===(a=t.user)||void 0===a||!a.id)return;const e=l[t.user.id];if(e){const a=t.states[e];if(a&&a.attributes.user_id===t.user.id)return a}const i=Object.values(t.states).find(a=>a.attributes.user_id===t.user.id&&"person"===(0,o.t)(a));return i&&(l[t.user.id]=i.entity_id),i}},28669:function(t,a,e){e.d(a,{TK:function(){return s},_2:function(){return h},eR:function(){return i},hG:function(){return l},hU:function(){return r},kg:function(){return n},wj:function(){return o},xg:function(){return d}});e(44114),e(18111),e(61701),e(3362),e(42762);const o="system-admin",i="system-users",r=async t=>t.callWS({type:"config/auth/list"}),n=async(t,a,e,o)=>t.callWS({type:"config/auth/create",name:a,group_ids:e,local_only:o}),s=async(t,a,e)=>t.callWS(Object.assign(Object.assign({},e),{},{type:"config/auth/update",user_id:a})),l=async(t,a)=>t.callWS({type:"config/auth/delete",user_id:a}),h=t=>t?t.trim().split(" ").slice(0,3).map(t=>t.substring(0,1)).join(""):"?",d=(t,a,e)=>{const o=[],i=a=>t.localize(`ui.panel.config.users.${a}`);return a.is_owner&&o.push(["M12 2C6.47 2 2 6.5 2 12C2 17.5 6.5 22 12 22S22 17.5 22 12 17.5 2 12 2M12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4S20 7.58 20 12C20 16.42 16.42 20 12 20M8 14L7 8L10 10L12 7L14 10L17 8L16 14H8M8.56 16C8.22 16 8 15.78 8 15.44V15H16V15.44C16 15.78 15.78 16 15.44 16H8.56Z",i("is_owner")]),e&&a.system_generated&&o.push(["M11,7H15V9H11V11H13A2,2 0 0,1 15,13V15A2,2 0 0,1 13,17H9V15H13V13H11A2,2 0 0,1 9,11V9A2,2 0 0,1 11,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z",i("is_system")]),a.local_only&&o.push(["M12 20C7.6 20 4 16.4 4 12S7.6 4 12 4 20 7.6 20 12 16.4 20 12 20M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M11 14H13V17H16V12H18L12 7L6 12H8V17H11V14",i("is_local")]),a.is_active||o.push(["M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",i("is_not_active")]),o}},23296:function(t,a,e){e.a(t,async function(t,o){try{e.r(a);e(62953);var i=e(40445),r=e(96196),n=e(77845),s=e(91926),l=e(65829),h=e(90248),d=e(2054),c=e(14503),p=t([l,h,d]);[l,h,d]=p.then?(await p)():p;let g,u,v,f,m,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)(f||(f=y` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)),this.message?(0,r.qy)(m||(m=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,i.Cg)([(0,n.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-toolbar"})],x.prototype,"noToolbar",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],x.prototype,"rootnav",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],x.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)()],x.prototype,"message",void 0),x=(0,i.Cg)([(0,n.EM)("hass-loading-screen")],x),o()}catch(g){o(g)}})},40511:function(t,a,e){e.a(t,async function(t,a){try{e(18111),e(22489),e(20116),e(61701),e(3362),e(62953),e(3296),e(27208),e(48408),e(14603),e(47566),e(98721);var o=e(40445),i=e(96196),r=e(77845),n=e(94333),s=e(22786),l=e(63708),h=e(26218),d=e(76830),c=e(91926),p=e(90248),g=e(2054),u=(e(67094),e(43831),e(14503)),v=t([p,g]);[p,g]=v.then?(await v)():v;let f,m,b,y,x,w,_,k,C,$,M,z,H=t=>t;const Z=t=>t.endsWith("/")&&t.length>1?t.slice(0,-1):t;class A extends i.WF{willUpdate(t){if(t.has("route")){const t=`${this.route.prefix}${this.route.path}`;this._activeTab=this.tabs.find(a=>this._isActiveTabPath(a.path,t))}super.willUpdate(t)}render(){var t;const a=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,i.qy)(f||(f=H` <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,i.qy)(m||(m=H` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,i.qy)(b||(b=H` <ha-icon-button-arrow-prev .href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,i.qy)(y||(y=H` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.narrow||!this.showTabs?(0,i.qy)(x||(x=H`<div class="main-title"> <slot name="header">${0}</slot> </div>`),this.showTabs?"":a[0]):"",this.showTabs&&!this.narrow?(0,i.qy)(w||(w=H`<div id="tabbar">${0}</div>`),a):"",this.showTabs&&this.narrow?(0,i.qy)(_||(_=H`<div id="tabbar" class="bottom-bar">${0}</div>`),a):"",this.pane?(0,i.qy)(k||(k=H`<div class="pane"> <div class="shadow-container"></div> <div class="ha-scrollbar"> <slot name="pane"></slot> </div> </div>`)):i.s6,this._saveScrollPos,this.hasFab?(0,i.qy)(C||(C=H`<div class="fab-bottom-space"></div>`)):i.s6)}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,c.O)()}_isActiveTabPath(t,a){try{const e=new URL(t,window.location.origin),o=new URL(a,window.location.origin),i=Z(e.pathname),r=Z(o.pathname);return!(r!==i&&!r.startsWith(`${i}/`))}catch(e){return a===t||a.startsWith(`${t}/`)}}async _tabClicked(t){const a=(0,d.d)(t);a&&await(0,c.o)(a,{replace:!0})}static get styles(){return[u.dp,(0,i.AH)($||($=H`: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,a,e,o,r,n,s)=>{const h=t.filter(t=>(0,l.fW)(this.hass,t));if(h.length<2){if(this.showTabs=!1,1===h.length){const t=h[0];return[t.translationKey?s(t.translationKey):t.name]}return[""]}return this.showTabs=!0,h.map(t=>(0,i.qy)(M||(M=H` <a href="${0}" @click="${0}"> <ha-tab .active="${0}" .narrow="${0}" .name="${0}"> ${0} </ha-tab> </a> `),t.path,this._tabClicked,t.path===(null==a?void 0:a.path),this.narrow,t.translationKey?s(t.translationKey):t.name,t.iconPath?(0,i.qy)(z||(z=H`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),t.iconPath):""))})}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"localizeFunc",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"back-path"})],A.prototype,"backPath",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"backCallback",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"main-page"})],A.prototype,"mainPage",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"route",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"tabs",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],A.prototype,"narrow",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"is-wide"})],A.prototype,"isWide",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],A.prototype,"pane",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"has-fab"})],A.prototype,"hasFab",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"show-tabs",reflect:!0})],A.prototype,"showTabs",void 0),(0,o.Cg)([(0,r.wk)()],A.prototype,"_activeTab",void 0),(0,o.Cg)([(0,h.a)(".content")],A.prototype,"_savedScrollPos",void 0),(0,o.Cg)([(0,r.Ls)({passive:!0})],A.prototype,"_saveScrollPos",null),A=(0,o.Cg)([(0,r.EM)("hass-tabs-subpage")],A),a()}catch(f){a(f)}})},20820:function(t,a,e){e(62953);var o=e(40445),i=e(96196),r=e(77845),n=e(94333);let s,l,h=t=>t;class d extends i.WF{render(){return(0,i.qy)(s||(s=h` <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}}d.styles=(0,i.AH)(l||(l=h`: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,o.Cg)([(0,r.MZ)({attribute:"is-wide",type:Boolean})],d.prototype,"isWide",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],d.prototype,"vertical",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"full-width"})],d.prototype,"fullWidth",void 0),d=(0,o.Cg)([(0,r.EM)("ha-config-section")],d)},84742:function(t,a,e){e.a(t,async function(t,o){try{e.r(a),e.d(a,{HaConfigPerson:function(){return H}});e(74423),e(26910),e(18111),e(22489),e(20116),e(61701),e(3362),e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698),e(62953);var i=e(40445),r=e(96196),n=e(77845),s=e(52220),l=e(18350),h=(e(76776),e(27661),e(8630),e(28732),e(67094),e(83119),e(85547)),d=e(28669),c=e(65063),p=e(23296),g=e(40511),u=e(36918),v=(e(20820),e(25635)),f=e(58142),m=t([l,p,g]);[l,p,g]=m.then?(await m)():m;let b,y,x,w,_,k,C,$,M=t=>t;const z="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class H extends r.WF{render(){if(!this.hass||void 0===this._storageItems||void 0===this._configItems)return(0,r.qy)(b||(b=M` <hass-loading-screen></hass-loading-screen> `));const t=this.hass;return(0,r.qy)(y||(y=M` <hass-tabs-subpage .hass="${0}" .narrow="${0}" .route="${0}" back-path="/config" .tabs="${0}" has-fab> <ha-config-section .isWide="${0}"> <span slot="header">${0}</span> <span slot="introduction"> <p>${0}</p> ${0} <a href="${0}" target="_blank" rel="noreferrer"> ${0} </a> </span> <ha-card outlined class="storage"> <ha-list> ${0} </ha-list> ${0} </ha-card> ${0} </ha-config-section> <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,v.configSections.persons,this.isWide,t.localize("ui.panel.config.person.caption"),t.localize("ui.panel.config.person.introduction"),this._configItems.length>0?(0,r.qy)(x||(x=M` <p> ${0} </p> `),t.localize("ui.panel.config.person.note_about_persons_configured_in_yaml")):"",(0,u.o)(this.hass,"/integrations/person/"),this.hass.localize("ui.panel.config.person.learn_more"),this._storageItems.map(t=>(0,r.qy)(w||(w=M` <ha-list-item graphic="avatar" @click="${0}" .entry="${0}"> <ha-person-badge .hass="${0}" .person="${0}" slot="graphic"></ha-person-badge> <span>${0}</span> </ha-list-item> `),this._openEditEntry,t,this.hass,t,t.name)),0===this._storageItems.length?(0,r.qy)(_||(_=M` <div class="empty"> ${0} <ha-button @click="${0}" appearance="filled" size="small"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0}</ha-button> </div> `),t.localize("ui.panel.config.person.no_persons_created_yet"),this._createPerson,z,t.localize("ui.panel.config.person.create_person")):r.s6,this._configItems.length>0?(0,r.qy)(k||(k=M` <ha-card outlined header="Configuration.yaml persons"> <ha-list> ${0} </ha-list> </ha-card> `),this._configItems.map(t=>(0,r.qy)(C||(C=M` <ha-list-item graphic="avatar"> <ha-person-badge .hass="${0}" .person="${0}" slot="graphic"></ha-person-badge> <span>${0}</span> </ha-list-item> `),this.hass,t,t.name))):r.s6,t.localize("ui.panel.config.person.add_person"),this._createPerson,z)}firstUpdated(t){super.firstUpdated(t),this._fetchData(),(0,f.T)()}async _fetchData(){this._usersLoad=(0,d.hU)(this.hass);const t=await(0,h.Fj)(this.hass);this._storageItems=t.storage.sort((t,a)=>(0,s.xL)(t.name,a.name,this.hass.locale.language)),this._configItems=t.config.sort((t,a)=>(0,s.xL)(t.name,a.name,this.hass.locale.language)),this._openDialogIfPersonSpecifiedInRoute()}_openDialogIfPersonSpecifiedInRoute(){if(!this.route.path.includes("/edit/"))return;const t=this.route.path.split("/edit/"),a=t.length>1?t[1]:null;if(!a)return;const e=this._storageItems.find(t=>t.id===a);var o,i;e?this._openDialog(e):(0,c.showAlertDialog)(this,{title:null===(o=this.hass)||void 0===o?void 0:o.localize("ui.panel.config.person.person_not_found_title"),text:null===(i=this.hass)||void 0===i?void 0:i.localize("ui.panel.config.person.person_not_found")})}_createPerson(){this._openDialog()}_openEditEntry(t){const a=t.currentTarget.entry;this._openDialog(a)}_allowedUsers(t,a){const e=new Set;for(const i of[this._configItems,this._storageItems])for(const t of i)t.user_id&&e.add(t.user_id);const o=a?a.user_id:void 0;return t.filter(t=>t.id===o||!e.has(t.id))}async _openDialog(t){const a=await this._usersLoad;(0,f.o)(this,{entry:t,users:this._allowedUsers(a,t),createEntry:async t=>{const a=await(0,h.Gu)(this.hass,t);this._storageItems=this._storageItems.concat(a).sort((t,a)=>(0,s.xL)(t.name,a.name,this.hass.locale.language))},updateEntry:async a=>{const e=await(0,h.xs)(this.hass,t.id,a);this._storageItems=this._storageItems.map(a=>a===t?e:a)},removeEntry:async()=>{if(!(await(0,c.dk)(this,{title:this.hass.localize("ui.panel.config.person.confirm_delete_title",{name:t.name}),text:this.hass.localize("ui.panel.config.person.confirm_delete_text"),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})))return!1;try{return await(0,h.H2)(this.hass,t.id),this._storageItems=this._storageItems.filter(a=>a!==t),!0}catch(a){return!1}},refreshUsers:()=>{this._usersLoad=(0,d.hU)(this.hass)}})}constructor(...t){super(...t),this.isWide=!1,this.narrow=!1}}H.styles=(0,r.AH)($||($=M`a{color:var(--primary-color)}ha-card{max-width:600px;margin:16px auto;overflow:hidden}.empty{padding:8px;display:flex;align-items:center;justify-content:space-around}ha-list:has(+ .empty){display:none}`)),(0,i.Cg)([(0,n.MZ)({attribute:!1})],H.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"is-wide",type:Boolean})],H.prototype,"isWide",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],H.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],H.prototype,"route",void 0),(0,i.Cg)([(0,n.wk)()],H.prototype,"_storageItems",void 0),(0,i.Cg)([(0,n.wk)()],H.prototype,"_configItems",void 0),H=(0,i.Cg)([(0,n.EM)("ha-config-person")],H),o()}catch(b){o(b)}})},58142:function(t,a,e){e.d(a,{T:function(){return i},o:function(){return r}});e(3362),e(62953);var o=e(1087);const i=()=>Promise.all([e.e("62066"),e.e("31065"),e.e("30628"),e.e("92769"),e.e("62453"),e.e("96919"),e.e("52981"),e.e("53292"),e.e("23642"),e.e("78398"),e.e("39005"),e.e("8851"),e.e("1535"),e.e("99038"),e.e("60322")]).then(e.bind(e,33256)),r=(t,a)=>{(0,o.r)(t,"show-dialog",{dialogTag:"dialog-person-detail",dialogImport:i,dialogParams:a})}},14503:function(t,a,e){e.d(a,{RF:function(){return p},dp:function(){return v},kO:function(){return u},nA:function(){return g},og:function(){return c}});var o=e(96196);let i,r,n,s,l,h,d=t=>t;const c=(0,o.AH)(i||(i=d`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,o.AH)(r||(r=d`: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,o.AH)(n||(n=d`
  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,o.AH)(s||(s=d`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,o.AH)(l||(l=d`.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,o.AH)(h||(h=d`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))},36918:function(t,a,e){e.d(a,{o:function(){return o}});e(74423);const o=(t,a)=>`https://${t.config.version.includes("b")?"rc":t.config.version.includes("dev")?"next":"www"}.home-assistant.io${a}`},35370:function(t,a,e){var o=e(26198);t.exports=function(t,a,e){for(var i=0,r=arguments.length>2?e:o(a),n=new t(r);r>i;)n[i]=a[i++];return n}},77957:function(t,a,e){var o=e(76080),i=e(79504),r=e(47055),n=e(48981),s=e(56969),l=e(26198),h=e(2360),d=e(35370),c=Array,p=i([].push);t.exports=function(t,a,e,i){for(var g,u,v,f=n(t),m=r(f),b=o(a,e),y=h(null),x=l(m),w=0;x>w;w++)v=m[w],(u=s(b(v,w,f)))in y?p(y[u],v):y[u]=[v];if(i&&(g=i(f))!==c)for(u in y)y[u]=d(g,y[u]);return y}},46058:function(t,a,e){var o=e(46518),i=e(77957),r=e(6469);o({target:"Array",proto:!0},{group:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),r("group")},29485:function(t,a,e){e.d(a,{W:function(){return s}});e(16280),e(74423),e(72712),e(18111),e(18237),e(27495),e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698),e(25440),e(62953);var o=e(5055),i=e(42017);const r="important",n=" !"+r,s=(0,i.u$)(class extends i.WL{render(t){return Object.keys(t).reduce((a,e)=>{const o=t[e];return null==o?a:a+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(t,[a]){const{style:e}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(a)),this.render(a);for(const o of this.ft)null==a[o]&&(this.ft.delete(o),o.includes("-")?e.removeProperty(o):e[o]=null);for(const o in a){const t=a[o];if(null!=t){this.ft.add(o);const a="string"==typeof t&&t.endsWith(n);o.includes("-")||a?e.setProperty(o,a?t.slice(0,-11):t,a?r:""):e[o]=t}}return o.c0}constructor(t){var a;if(super(t),t.type!==i.OA.ATTRIBUTE||"style"!==t.name||(null===(a=t.strings)||void 0===a?void 0:a.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}})}}]);
//# sourceMappingURL=43846.0373381ec91174bb.js.map