iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
43 lines • 49.5 kB
JavaScript
/*! For license information please see 55372.5eaa32cc7c069c74.js.LICENSE.txt */
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[55372],{12451:function(t,e,o){o.d(e,{O:function(){return r},i:function(){return i.is}});var a=o(5124),i=o(12130);class r extends a.WF{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}},12130:function(t,e,o){o.d(e,{SE:function(){return c},U9:function(){return l},hP:function(){return a},is:function(){return i}});o(44114);const a=t=>t.nodeType===Node.ELEMENT_NODE;function i(t){return{addClass:e=>{t.classList.add(e)},removeClass:e=>{t.classList.remove(e)},hasClass:e=>t.classList.contains(e)}}let r=!1;const n=()=>{},s={get passive(){return r=!0,!1}};document.addEventListener("x",n,s),document.removeEventListener("x",n);const l=(t=window.document)=>{let e=t.activeElement;const o=[];if(!e)return o;for(;e&&(o.push(e),e.shadowRoot);)e=e.shadowRoot.activeElement;return o},c=t=>{const e=l();if(!e.length)return!1;const o=e[e.length-1],a=new Event("check-if-focused",{bubbles:!0,composed:!0});let i=[];const r=t=>{i=t.composedPath()};return document.body.addEventListener("check-if-focused",r),o.dispatchEvent(a),document.body.removeEventListener("check-if-focused",r),-1!==i.indexOf(t)}},63708:function(t,e,o){o.d(e,{fW:function(){return r}});o(18111),o(13579);var a=o(44537),i=o(36312);const r=(t,e)=>(l(e)||n(t,e))&&s(t,e),n=(t,e)=>!e.component||(0,a.e)(e.component).some(e=>(0,i.x)(t.config,e)),s=(t,e)=>!e.not_component||!(0,a.e)(e.not_component).some(e=>(0,i.x)(t.config,e)),l=t=>t.core},26218:function(t,e,o){o.d(e,{a:function(){return i}});o(16280);const a=(0,o(77796).n)(t=>{history.replaceState({scrollPosition:t},"")},300);function i(t){return(e,o)=>{if("object"==typeof o)throw new Error("This decorator does not support this compilation type.");const i=e.connectedCallback;e.connectedCallback=function(){i.call(this);const e=this[o];e&&this.updateComplete.then(()=>{const o=this.renderRoot.querySelector(t);o&&setTimeout(()=>{o.scrollTop=e},0)})};const r=Object.getOwnPropertyDescriptor(e,o);let n;if(void 0===r)n={get(){var t;return this[`__${String(o)}`]||(null===(t=history.state)||void 0===t?void 0:t.scrollPosition)},set(t){a(t),this[`__${String(o)}`]=t},configurable:!0,enumerable:!0};else{const t=r.set;n=Object.assign(Object.assign({},r),{},{set(e){a(e),this[`__${String(o)}`]=e,null==t||t.call(this,e)}})}Object.defineProperty(e,o,n)}}},76830:function(t,e,o){o.d(e,{d:function(){return a}});o(18111),o(20116);const a=(t,e=!0)=>{if(t.defaultPrevented||0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey)return;const o=t.composedPath().find(t=>"A"===t.tagName);if(!o||o.target||o.hasAttribute("download")||"external"===o.getAttribute("rel"))return;let a=o.href;if(!a||-1!==a.indexOf("mailto:"))return;const i=window.location,r=i.origin||i.protocol+"//"+i.host;return a.startsWith(r)&&(a=a.slice(r.length),"#"!==a)?(e&&t.preventDefault(),a):void 0}},69093:function(t,e,o){o.d(e,{t:function(){return i}});var a=o(71727);const i=t=>(0,a.m)(t.entity_id)},77796:function(t,e,o){o.d(e,{n:function(){return a}});o(62953);const a=(t,e,o=!0,a=!0)=>{let i,r=0;const n=(...n)=>{const s=()=>{r=!1===o?0:Date.now(),i=void 0,t(...n)},l=Date.now();r||!1!==o||(r=l);const c=e-(l-r);c<=0||c>e?(i&&(clearTimeout(i),i=void 0),r=l,t(...n)):i||!1===a||(i=window.setTimeout(s,c))};return n.cancel=()=>{clearTimeout(i),i=void 0,r=0},n}},76776:function(t,e,o){o(62953);var a=o(40445),i=o(5124),r=o(67576);let n,s,l,c=t=>t;class h extends i.WF{render(){return(0,i.qy)(n||(n=c` ${0} <slot></slot> `),this.header?(0,i.qy)(s||(s=c`<h1 class="card-header">${0}</h1>`),this.header):i.s6)}constructor(...t){super(...t),this.raised=!1}}h.styles=(0,i.AH)(l||(l=c`: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,a.Cg)([(0,r.MZ)()],h.prototype,"header",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"raised",void 0),h=(0,a.Cg)([(0,r.EM)("ha-card")],h)},90248:function(t,e,o){o.a(t,async function(t,a){try{o.r(e),o.d(e,{HaIconButtonArrowPrev:function(){return g}});o(62953);var i=o(40445),r=o(5124),n=o(67576),s=o(63091),l=o(26300),c=t([l]);l=(c.then?(await c)():c)[0];let h,d=t=>t;const p="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",u="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class g extends r.WF{render(){var t;return(0,r.qy)(h||(h=d` <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?u:p}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)()],g.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)()],g.prototype,"href",void 0),(0,i.Cg)([(0,n.MZ)()],g.prototype,"target",void 0),(0,i.Cg)([(0,n.MZ)()],g.prototype,"rel",void 0),(0,i.Cg)([(0,n.MZ)()],g.prototype,"download",void 0),(0,i.Cg)([(0,n.wk)()],g.prototype,"_icon",void 0),g=(0,i.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],g),a()}catch(h){a(h)}})},26300:function(t,e,o){o.a(t,async function(t,a){try{o.r(e),o.d(e,{HaIconButton:function(){return v}});o(62953);var i=o(40445),r=o(5124),n=o(67576),s=o(63672),l=o(18350),c=(o(67094),t([l]));l=(c.then?(await c)():c)[0];let h,d,p,u,g=t=>t;class v extends r.WF{render(){return(0,r.qy)(h||(h=g` <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)(d||(d=g`<ha-svg-icon aria-hidden="true" .path="${0}"></ha-svg-icon>`),this.path):(0,r.qy)(p||(p=g`<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)(u||(u=g`: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} (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),a()}catch(h){a(h)}})},28732:function(t,e,o){var a=o(40445),i=o(27686),r=o(7731),n=o(5124),s=o(67576);let l,c,h,d=t=>t;class p extends i.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[r.R,(0,n.AH)(l||(l=d`: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)(c||(c=d`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,n.AH)(h||(h=d``))]}}p=(0,a.Cg)([(0,s.EM)("ha-list-item")],p)},8630:function(t,e,o){var a=o(40445),i=o(68618),r=o(11081),n=o(67576);class s extends i.iY{}s.styles=r.R,s=(0,a.Cg)([(0,n.EM)("ha-list")],s)},2054:function(t,e,o){o.a(t,async function(t,e){try{o(16280),o(62953);var a=o(40445),i=o(5124),r=o(67576),n=o(1087),s=o(44249),l=o(26300),c=t([l]);l=(c.then?(await c)():c)[0];let h,d,p,u=t=>t;const g="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)(h||(h=u` <ha-icon-button .label="${0}" .path="${0}" ="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),g,this._toggleMenu,t?(0,i.qy)(d||(d=u`<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,o=t.has("narrow")?t.get("narrow"):this.narrow,a=!1===(null==e?void 0:e.kioskMode)&&(o||"always_hidden"===(null==e?void 0:e.dockedSidebar)),i=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&a===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=u`: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,a.Cg)([(0,r.MZ)({type:Boolean})],v.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,a.Cg)([(0,r.wk)()],v.prototype,"_hasNotifications",void 0),(0,a.Cg)([(0,r.wk)()],v.prototype,"_show",void 0),v=(0,a.Cg)([(0,r.EM)("ha-menu-button")],v),e()}catch(h){e(h)}})},54276:function(t,e,o){o(62953);var a=o(40445),i=o(76482),r=o(91382),n=o(96245),s=o(5124),l=o(67576);let c;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 i.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}h.styles=[n.R,(0,s.AH)(c||(c=(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,a.Cg)([(0,l.EM)("ha-ripple")],h)},65829:function(t,e,o){o.a(t,async function(t,a){try{o.r(e),o.d(e,{HaSpinner:function(){return d}});var i=o(40445),r=o(55262),n=o(5124),s=o(67576),l=t([r]);r=(l.then?(await l)():l)[0];let c,h=t=>t;class d 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)(c||(c=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,i.Cg)([(0,s.MZ)()],d.prototype,"size",void 0),d=(0,i.Cg)([(0,s.EM)("ha-spinner")],d),a()}catch(c){a(c)}})},67094:function(t,e,o){o.r(e),o.d(e,{HaSvgIcon:function(){return d}});var a=o(40445),i=o(5124),r=o(67576);let n,s,l,c,h=t=>t;class d extends i.WF{render(){return(0,i.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,i.JW)(s||(s=h`<path class="primary-path" d="${0}"></path>`),this.path):i.s6,this.secondaryPath?(0,i.JW)(l||(l=h`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):i.s6)}}d.styles=(0,i.AH)(c||(c=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,a.Cg)([(0,r.MZ)()],d.prototype,"path",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"secondaryPath",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"viewBox",void 0),d=(0,a.Cg)([(0,r.EM)("ha-svg-icon")],d)},43831:function(t,e,o){o(62953);var a=o(40445),i=o(5124),r=o(67576),n=o(63672);o(54276);let s,l,c=t=>t;class h extends i.WF{render(){return(0,i.qy)(s||(s=c` <div tabindex="0" role="tab" aria-selected="${0}" aria-label="${0}" ="${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,i.AH)(l||(l=c`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,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"active",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)()],h.prototype,"name",void 0),h=(0,a.Cg)([(0,r.EM)("ha-tab")],h)},83119:function(t,e,o){var a=o(40445),i=o(5124),r=o(67576),n=o(6412),s=o(89784),l=o(28669);let c,h,d,p=t=>t;class u extends i.WF{render(){if(!this.person)return i.s6;const t=this.person.picture;if(t)return(0,i.qy)(c||(c=p`<div style="${0}" class="picture"></div>`),(0,s.W)({backgroundImage:`url(${this.hass.hassUrl(t)})`}));const e=(0,l._2)(this.person.name);return(0,i.qy)(h||(h=p`<div class="initials ${0}"> ${0} </div>`),(0,n.H)({long:e.length>2}),e)}}u.styles=(0,i.AH)(d||(d=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,a.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"person",void 0),u=(0,a.Cg)([(0,r.EM)("ha-person-badge")],u)},44249:function(t,e,o){o.d(e,{V:function(){return a}});o(62953);const a=(t,e)=>{const o=new i,a=t.subscribeMessage(t=>e(o.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{a.then(t=>null==t?void 0:t())}};class i{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications=Object.assign(Object.assign({},this.notifications),t.notifications);return Object.values(this.notifications)}constructor(){this.notifications={}}}},85547:function(t,e,o){o.d(e,{Fj:function(){return i},Gu:function(){return r},H2:function(){return s},xA:function(){return c},xs:function(){return n}});o(18111),o(20116);var a=o(69093);const i=t=>t.callWS({type:"person/list"}),r=(t,e)=>t.callWS(Object.assign({type:"person/create"},e)),n=(t,e,o)=>t.callWS(Object.assign({type:"person/update",person_id:e},o)),s=(t,e)=>t.callWS({type:"person/delete",person_id:e}),l={},c=t=>{var e;if(null===(e=t.user)||void 0===e||!e.id)return;const o=l[t.user.id];if(o){const e=t.states[o];if(e&&e.attributes.user_id===t.user.id)return e}const i=Object.values(t.states).find(e=>e.attributes.user_id===t.user.id&&"person"===(0,a.t)(e));return i&&(l[t.user.id]=i.entity_id),i}},28669:function(t,e,o){o.d(e,{TK:function(){return s},_2:function(){return c},eR:function(){return i},hG:function(){return l},hU:function(){return r},kg:function(){return n},wj:function(){return a},xg:function(){return h}});o(44114),o(18111),o(61701),o(3362),o(42762);const a="system-admin",i="system-users",r=async t=>t.callWS({type:"config/auth/list"}),n=async(t,e,o,a)=>t.callWS({type:"config/auth/create",name:e,group_ids:o,local_only:a}),s=async(t,e,o)=>t.callWS(Object.assign(Object.assign({},o),{},{type:"config/auth/update",user_id:e})),l=async(t,e)=>t.callWS({type:"config/auth/delete",user_id:e}),c=t=>t?t.trim().split(" ").slice(0,3).map(t=>t.substring(0,1)).join(""):"?",h=(t,e,o)=>{const a=[],i=e=>t.localize(`ui.panel.config.users.${e}`);return e.is_owner&&a.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")]),o&&e.system_generated&&a.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")]),e.local_only&&a.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")]),e.is_active||a.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")]),a}},23296:function(t,e,o){o.a(t,async function(t,a){try{o.r(e);o(62953);var i=o(40445),r=o(5124),n=o(67576),s=o(91926),l=o(65829),c=o(90248),h=o(2054),d=o(14503),p=t([l,c,h]);[l,c,h]=p.then?(await p)():p;let u,g,v,f,m,b,y=t=>t;class x extends r.WF{render(){var t;return(0,r.qy)(u||(u=y` ${0} <div class="content"> <ha-spinner></ha-spinner> ${0} </div> `),this.noToolbar?"":(0,r.qy)(g||(g=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}" ="${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.OE)()}static get styles(){return[d.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} (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),a()}catch(u){a(u)}})},40511:function(t,e,o){o.a(t,async function(t,e){try{o(18111),o(22489),o(20116),o(61701),o(3362),o(62953),o(3296),o(27208),o(48408),o(14603),o(47566),o(98721);var a=o(40445),i=o(5124),r=o(67576),n=o(6412),s=o(22786),l=o(63708),c=o(26218),h=o(76830),d=o(91926),p=o(90248),u=o(2054),g=(o(67094),o(43831),o(14503)),v=t([p,u]);[p,u]=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(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,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" ="${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}" ="${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?"":e[0]):"",this.showTabs&&!this.narrow?(0,i.qy)(w||(w=H`<div id="tabbar">${0}</div>`),e):"",this.showTabs&&this.narrow?(0,i.qy)(_||(_=H`<div id="tabbar" class="bottom-bar">${0}</div>`),e):"",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}focusContentScroller(){this._content&&(this._content.style.outline="none",this._content.focus({preventScroll:!0}))}_backTapped(){this.backCallback?this.backCallback():(0,d.OE)()}_isActiveTabPath(t,e){try{const o=new URL(t,window.location.origin),a=new URL(e,window.location.origin),i=Z(o.pathname),r=Z(a.pathname);return!(r!==i&&!r.startsWith(`${i}/`))}catch(o){return e===t||e.startsWith(`${t}/`)}}async _tabClicked(t){const e=(0,h.d)(t);e&&await(0,d.oo)(e,{replace:!0})}static get styles(){return[g.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{min-width:0;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);--ha-button-box-shadow:var(--ha-box-shadow-l)}: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,o,a,r,n,s)=>{const c=t.filter(t=>(0,l.fW)(this.hass,t));if(c.length<2){if(this.showTabs=!1,1===c.length){const t=c[0];return[t.translationKey?s(t.translationKey):t.name]}return[""]}return this.showTabs=!0,c.map(t=>(0,i.qy)(M||(M=H` <a href="${0}" ="${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,i.qy)(z||(z=H`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),t.iconPath):""))})}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"localizeFunc",void 0),(0,a.Cg)([(0,r.MZ)({type:String,attribute:"back-path"})],A.prototype,"backPath",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"backCallback",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"main-page"})],A.prototype,"mainPage",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"route",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"tabs",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],A.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"is-wide"})],A.prototype,"isWide",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],A.prototype,"pane",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"has-fab"})],A.prototype,"hasFab",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"show-tabs",reflect:!0})],A.prototype,"showTabs",void 0),(0,a.Cg)([(0,r.wk)()],A.prototype,"_activeTab",void 0),(0,a.Cg)([(0,r.P)(".content")],A.prototype,"_content",void 0),(0,a.Cg)([(0,c.a)(".content")],A.prototype,"_savedScrollPos",void 0),(0,a.Cg)([(0,r.Ls)({passive:!0})],A.prototype,"_saveScrollPos",null),A=(0,a.Cg)([(0,r.EM)("hass-tabs-subpage")],A),e()}catch(f){e(f)}})},20820:function(t,e,o){o(62953);var a=o(40445),i=o(5124),r=o(67576),n=o(6412);let s,l,c=t=>t;class h extends i.WF{render(){return(0,i.qy)(s||(s=c` <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,i.AH)(l||(l=c`: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,a.Cg)([(0,r.MZ)({attribute:"is-wide",type:Boolean})],h.prototype,"isWide",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],h.prototype,"vertical",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"full-width"})],h.prototype,"fullWidth",void 0),h=(0,a.Cg)([(0,r.EM)("ha-config-section")],h)},84742:function(t,e,o){o.a(t,async function(t,a){try{o.r(e),o.d(e,{HaConfigPerson:function(){return H}});o(74423),o(26910),o(18111),o(22489),o(20116),o(61701),o(3362),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953);var i=o(40445),r=o(5124),n=o(67576),s=o(52220),l=o(18350),c=(o(76776),o(8630),o(28732),o(67094),o(83119),o(85547)),h=o(28669),d=o(65063),p=o(23296),u=o(40511),g=o(36918),v=(o(20820),o(25635)),f=o(58142),m=t([l,p,u]);[l,p,u]=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-button slot="fab" size="large" ="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> </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,g.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" ="${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 ="${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,this._createPerson,z,t.localize("ui.panel.config.person.add_person"))}firstUpdated(t){super.firstUpdated(t),this._fetchData(),(0,f.T)()}async _fetchData(){this._usersLoad=(0,h.hU)(this.hass);const t=await(0,c.Fj)(this.hass);this._storageItems=t.storage.sort((t,e)=>(0,s.xL)(t.name,e.name,this.hass.locale.language)),this._configItems=t.config.sort((t,e)=>(0,s.xL)(t.name,e.name,this.hass.locale.language)),this._openDialogIfPersonSpecifiedInRoute()}_openDialogIfPersonSpecifiedInRoute(){if(!this.route.path.includes("/edit/"))return;const t=this.route.path.split("/edit/"),e=t.length>1?t[1]:null;if(!e)return;const o=this._storageItems.find(t=>t.id===e);var a,i;o?this._openDialog(o):(0,d.showAlertDialog)(this,{title:null===(a=this.hass)||void 0===a?void 0:a.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 e=t.currentTarget.entry;this._openDialog(e)}_allowedUsers(t,e){const o=new Set;for(const i of[this._configItems,this._storageItems])for(const t of i)t.user_id&&o.add(t.user_id);const a=e?e.user_id:void 0;return t.filter(t=>t.id===a||!o.has(t.id))}async _openDialog(t){const e=await this._usersLoad;(0,f.o)(this,{entry:t,users:this._allowedUsers(e,t),createEntry:async t=>{const e=await(0,c.Gu)(this.hass,t);this._storageItems=this._storageItems.concat(e).sort((t,e)=>(0,s.xL)(t.name,e.name,this.hass.locale.language))},updateEntry:async e=>{const o=await(0,c.xs)(this.hass,t.id,e);this._storageItems=this._storageItems.map(e=>e===t?o:e)},removeEntry:async()=>{if(!(await(0,d.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,c.H2)(this.hass,t.id),this._storageItems=this._storageItems.filter(e=>e!==t),!0}catch(e){return!1}},refreshUsers:()=>{this._usersLoad=(0,h.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),a()}catch(b){a(b)}})},58142:function(t,e,o){o.d(e,{T:function(){return i},o:function(){return r}});o(3362),o(62953);var a=o(1087);const i=()=>Promise.all([o.e(72850),o.e(39763),o.e(32450),o.e(7305),o.e(92769),o.e(3283),o.e(59979),o.e(27671),o.e(17388),o.e(62574),o.e(26092),o.e(39005),o.e(8851),o.e(82209),o.e(1535),o.e(33887),o.e(80850)]).then(o.bind(o,33256)),r=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-person-detail",dialogImport:i,dialogParams:e})}},14503:function(t,e,o){o.d(e,{RF:function(){return p},dp:function(){return v},kO:function(){return g},nA:function(){return u},og:function(){return d}});var a=o(5124);let i,r,n,s,l,c,h=t=>t;const d=(0,a.AH)(i||(i=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,a.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} (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}`),d),u=(0,a.AH)(n||(n=h`ha-adaptive-dialog,ha-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-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)} all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-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)}`)),g=(0,a.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
)
)} 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,a.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,a.AH)(c||(c=h`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))},36918:function(t,e,o){o.d(e,{o:function(){return a}});const a=(t,e)=>`https://www.iobroker.net/#${t.language&&t.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},35370:function(t,e,o){var a=o(26198);t.exports=function(t,e,o){for(var i=0,r=arguments.length>2?o:a(e),n=new t(r);r>i;)n[i]=e[i++];return n}},77957:function(t,e,o){var a=o(76080),i=o(79504),r=o(47055),n=o(48981),s=o(56969),l=o(26198),c=o(2360),h=o(35370),d=Array,p=i([].push);t.exports=function(t,e,o,i){for(var u,g,v,f=n(t),m=r(f),b=a(e,o),y=c(null),x=l(m),w=0;x>w;w++)v=m[w],(g=s(b(v,w,f)))in y?p(y[g],v):y[g]=[v];if(i&&(u=i(f))!==d)for(g in y)y[g]=h(u,y[g]);return y}},46058:function(t,e,o){var a=o(46518),i=o(77957),r=o(6469);a({target:"Array",proto:!0},{group:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),r("group")},89784:function(t,e,o){o.d(e,{W:function(){return s}});o(16280),o(74423),o(72712),o(18111),o(18237),o(27495),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(25440),o(62953);var a=o(5055),i=o(42017);const r="important",n=" !"+r,s=(0,i.u$)(class extends i.WL{render(t){return Object.keys(t).reduce((e,o)=>{const a=t[o];return null==a?e:e+`${o=o.includes("-")?o:o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${a};`},"")}update(t,[e]){const{style:o}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const a of this.ft)null==e[a]&&(this.ft.delete(a),a.includes("-")?o.removeProperty(a):o[a]=null);for(const a in e){const t=e[a];if(null!=t){this.ft.add(a);const e="string"==typeof t&&t.endsWith(n);a.includes("-")||e?o.setProperty(a,e?t.slice(0,-11):t,e?r:""):o[a]=t}}return a.c0}constructor(t){var e;if(super(t),t.type!==i.OA.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}})}}]);