UNPKG

iobroker.lovelace

Version:

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

25 lines 45.9 kB
export const __rspack_esm_id=3361;export const __rspack_esm_ids=[3361];export const __webpack_modules__={36356(t,e,i){i.d(e,{q:()=>o});class o{get enabled(){return this._enabled}set enabled(t){t!==this._enabled&&(this._enabled=t,this._enabled?this._attach():this._detach(),this._host.requestUpdate())}hostUpdated(){this.enabled&&!this._scrollContainer&&this._attach()}hostDisconnected(){this._detach()}_attach(){this._scrollContainer=this._host.renderRoot?.querySelector(this._selector),this._scrollContainer&&this._scrollContainer.addEventListener("mousedown",this._mouseDown)}_detach(){window.removeEventListener("mousemove",this._mouseMove),window.removeEventListener("mouseup",this._mouseUp),this._scrollContainer&&(this._scrollContainer.removeEventListener("mousedown",this._mouseDown),this._scrollContainer=void 0),this.scrolled=!1,this.scrolling=!1,this.mouseIsDown=!1,this.scrollStartX=0,this.scrollLeft=0}constructor(t,{selector:e,enabled:i}){this.mouseIsDown=!1,this.scrolled=!1,this.scrolling=!1,this.scrollStartX=0,this.scrollLeft=0,this._enabled=!0,this._mouseDown=t=>{const e=this._scrollContainer;e&&(this.scrollStartX=t.pageX-e.offsetLeft,this.scrollLeft=e.scrollLeft,this.mouseIsDown=!0,this.scrolled=!1,window.addEventListener("mousemove",this._mouseMove),window.addEventListener("mouseup",this._mouseUp,{once:!0}))},this._mouseUp=()=>{this.mouseIsDown=!1,this.scrolling=!1,this._host.requestUpdate(),window.removeEventListener("mousemove",this._mouseMove)},this._mouseMove=t=>{if(!this.mouseIsDown)return;const e=this._scrollContainer;if(!e)return;const i=t.pageX-e.offsetLeft-this.scrollStartX;this.scrolled||(this.scrolled=Math.abs(i)>1,this.scrolling=this.scrolled,this._host.requestUpdate()),e.scrollLeft=this.scrollLeft-i},this._selector=e,this._host=t,this.enabled=i??!0,t.addController(this)}}},95747(t,e,i){i.a(t,async function(t,o){try{i.d(e,{CL:()=>b,GH:()=>C,Rl:()=>u,ZS:()=>f,aQ:()=>m,r6:()=>d,yg:()=>v});var a=i(74487),s=i(22786),r=i(72487),n=i(30162),l=i(8480),c=i(69543),h=t([a,l,r,n]);[a,l,r,n]=h.then?(await h)():h;const d=(t,e,i)=>p(e,i.time_zone).format(t),p=(0,s.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),u=t=>g().format(t),g=(0,s.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),m=(t,e,i)=>y(e,i.time_zone).format(t),y=(0,s.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),f=(t,e,i)=>_(e,i.time_zone).format(t),_=(0,s.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),b=(t,e,i)=>(new Date).getFullYear()===t.getFullYear()?f(t,e,i):m(t,e,i),v=(t,e,i)=>w(e,i.time_zone).format(t),w=(0,s.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),C=(t,e,i)=>`${(0,r.zB)(t,e,i)}, ${(0,n.fU)(t,e,i)}`;o()}catch(t){o(t)}})},8480(t,e,i){i.a(t,async function(t,o){try{i.d(e,{fL:()=>h,n2:()=>d,wj:()=>p});var a=i(74487),s=i(29079),r=i(46927),n=t([a]);a=(n.then?(await n)():n)[0];const l=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,c=l&&("UTC"===l||"Etc/UTC"===l||l in s)?l:void 0,h=14881==i.j?void 0!==c:null,d=c??"UTC",p=(t,e)=>t===r.Wj.local&&c?d:e;o()}catch(t){o(t)}})},93421(t,e,i){i.d(e,{IW:()=>h,dH:()=>c,fI:()=>l});i(44114);var o=i(35211),a=i(22792),s=i(32172);const r=(t,e)=>{let i=t;for(const t of e){if(null==i)return;i=i[t]}return i},n=(t,e,i)=>{const a=(0,s.p)({transformer:function(t){return i.call(this,t)},watch:e?[e]:[]}),r=(0,o.Fg)({context:t,subscribe:!0});return(t,e)=>{a(t,e),r(t,e)}},l=t=>n(a.iN,t.entityIdPath[0],function(e){const i=r(this,t.entityIdPath);return"string"==typeof i?e?.[i]:void 0}),c=t=>n(a.X1,t.entityIdPath[0],function(e){const i=r(this,t.entityIdPath);return"string"==typeof i?e?.[i]:void 0}),h=()=>n(a.D5,void 0,({localize:t})=>t)},93905(t,e,i){i.d(e,{I:()=>s});i(44114),i(18111),i(7588),i(69112),i(33110);class o{addFromStorage(t){if(!this._storage[t]){const e=this.storage.getItem(t);e&&(this._storage[t]=JSON.parse(e))}}subscribeChanges(t,e){return this._listeners[t]?this._listeners[t].push(e):this._listeners[t]=[e],()=>{this.unsubscribeChanges(t,e)}}unsubscribeChanges(t,e){if(!(t in this._listeners))return;const i=this._listeners[t].indexOf(e);-1!==i&&this._listeners[t].splice(i,1)}hasKey(t){return t in this._storage}getValue(t){return this._storage[t]}setValue(t,e){const i=this._storage[t];this._storage[t]=e;try{void 0===e?this.storage.removeItem(t):this.storage.setItem(t,JSON.stringify(e))}catch(t){}finally{this._listeners[t]&&this._listeners[t].forEach(t=>t(i,e))}}constructor(t=window.localStorage){this._storage={},this._listeners={},this.storage=t,this.storage===window.localStorage&&window.addEventListener("storage",t=>{t.key&&this.hasKey(t.key)&&(this._storage[t.key]=t.newValue?JSON.parse(t.newValue):t.newValue,this._listeners[t.key]&&this._listeners[t.key].forEach(e=>e(t.oldValue?JSON.parse(t.oldValue):t.oldValue,this._storage[t.key])))})}}const a={};function s(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const s=t.storage||"localStorage";let r;s&&s in a?r=a[s]:(r=new o(window[s]),a[s]=r);const n=t.key||String(i);r.addFromStorage(n);const l=!1!==t.subscribe?t=>r.subscribeChanges(n,(e,o)=>{t.requestUpdate(i,e)}):void 0,c=()=>r.hasKey(n)?t.deserializer?t.deserializer(r.getValue(n)):r.getValue(n):void 0,h=(e,o)=>{let a;t.state&&(a=c()),r.setValue(n,t.serializer?t.serializer(o):o),t.state&&e.requestUpdate(i,a)},d=e.performUpdate;if(e.performUpdate=function(){this.__initialized=!0,d.call(this)},t.subscribe){const t=e.connectedCallback,i=e.disconnectedCallback;e.connectedCallback=function(){t.call(this);const e=this;e.__unbsubLocalStorage||(e.__unbsubLocalStorage=l?.(this))},e.disconnectedCallback=function(){i.call(this);this.__unbsubLocalStorage?.(),this.__unbsubLocalStorage=void 0}}const p=Object.getOwnPropertyDescriptor(e,i);let u;if(void 0===p)u={get:()=>c(),set(t){(this.__initialized||void 0===c())&&h(this,t)},configurable:!0,enumerable:!0};else{const t=p.set;u={...p,get:()=>c(),set(e){(this.__initialized||void 0===c())&&h(this,e),t?.call(this,e)}}}Object.defineProperty(e,i,u)}}},32172(t,e,i){i.d(e,{p:()=>o});i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);function o(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const o=String(i),a=e;if(a._transformers){if(!a.hasOwnProperty("_transformers")){const t=a._transformers;a._transformers=new Map,t.forEach((t,e)=>a._transformers.set(e,t))}}else{a._transformers=new Map,a._watching=new Map;const t=a.willUpdate;a.willUpdate=function(e){t.call(this,e);const i=new Set;e.forEach((t,e)=>{const o=this._watching.get(e);void 0!==o&&o.forEach(t=>i.add(t))}),i.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}a._transformers.set(i,t.transformer),t.watch&&t.watch.forEach(t=>{let e=a._watching.get(t);e||(e=new Set,a._watching.set(t,e)),e.add(i)});const s=Object.getOwnPropertyDescriptor(e,i);let r;if(void 0===s)r={get(){return this[`__transform_${o}`]},set(t){const e=this[`__transform_${o}`],i=this._transformers.get(o);this[`__transform_${o}`]=i?i.call(this,t):t,this[`__original_${o}`]=t,this.requestUpdate(o,e)},configurable:!0,enumerable:!0};else{const t=s.set;r={...s,set(e){const i=this[`__transform_${o}`],a=this._transformers.get(o);this[`__transform_${o}`]=a?a.call(this,e):e,this[`__original_${o}`]=e,this.requestUpdate(o,i),t?.call(this,e)}}}Object.defineProperty(e,i,r)}}},68348(t,e,i){i.d(e,{u:()=>o});i(18111),i(13579);const o=t=>{if(t.some(t=>"tagName"in t&&("HA-MENU"===t.tagName||"HA-CODE-EDITOR"===t.tagName)))return!1;const e=t[0];if("TEXTAREA"===e.tagName||"HA-SELECT"===e.parentElement?.tagName||"HA-DROPDOWN"===e.parentElement?.tagName)return!1;if("INPUT"!==e.tagName)return!0;switch(e.type){case"button":case"checkbox":case"hidden":case"radio":case"range":return!0;default:return!1}}},76830(t,e,i){i.d(e,{d:()=>o});i(18111),i(20116);const o=(t,e=!0)=>{if(t.defaultPrevented||0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey)return;const i=t.composedPath().find(t=>"A"===t.tagName);if(!i||i.target||i.hasAttribute("download")||"external"===i.getAttribute("rel"))return;let o=i.href;if(!o||-1!==o.indexOf("mailto:"))return;const a=window.location,s=a.origin||a.protocol+"//"+a.host;return o.startsWith(s)&&(o=o.slice(s.length),"#"!==o)?(e&&t.preventDefault(),o):void 0}},57237(t,e,i){i.d(e,{d:()=>o});const o=t=>t.stopPropagation()},17451(t,e,i){i.d(e,{j:()=>o});const o=(t,e,i)=>(void 0!==i&&(i=!!i),t.hasAttribute(e)?!!i||(t.removeAttribute(e),!1):!1!==i&&(t.setAttribute(e,""),!0))},19459(t,e,i){i.d(e,{b:()=>o});i(45367),i(92731),i(69479),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);const o=(t,e,i)=>{if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let a,s;if(Array.isArray(t)){if(s=t.length,s!==e.length)return!1;for(a=s;0!==a--;)if(!o(t[a],e[a],i))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a of t.entries())if(!e.has(a[0]))return!1;for(a of t.entries())if(!o(a[1],e.get(a[0]),i))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a of t.entries())if(!e.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(s=t.length,s!==e.length)return!1;for(a=s;0!==a--;)if(t[a]!==e[a])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const r=Object.keys(t);if(s=r.length,s!==Object.keys(e).length)return!1;for(a=s;0!==a--;)if(!Object.prototype.hasOwnProperty.call(e,r[a]))return!1;for(a=s;0!==a--;){const s=r[a];if(!o(t[s],e[s],i))return!1}if(i?.compareSymbols){const a=Object.getOwnPropertySymbols(t),s=Object.getOwnPropertySymbols(e);if(a.length!==s.length)return!1;for(const s of a){if(!Object.prototype.hasOwnProperty.call(e,s))return!1;if(!o(t[s],e[s],i))return!1}}return!0}return t!=t&&e!=e}},64481(t,e,i){i.d(e,{D:()=>a,J:()=>r});i(64979);let o=!1;try{o="true"===window.localStorage.getItem("disableViewTransition")}catch{}const a=t=>{o=t},s=t=>{if(!(t=>(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name)(t))throw t},r=t=>{if(!document.startViewTransition||o)return t(!1),Promise.resolve();let e=!1;try{const i=document.startViewTransition(()=>{e=!0,t(!0)});return i.ready.catch(s),i.finished.catch(s)}catch(i){return console.warn("View transition failed, falling back to direct execution.",i),e?Promise.reject(i):(t(!1),Promise.resolve())}}},38962(t,e,i){i.a(t,async function(t,o){try{i.r(e);var a=i(62826),s=i(5124),r=i(22441),n=i(6412),l=i(93421),c=i(1087),h=i(26300),d=(i(67094),t([h]));h=(d.then?(await d)():d)[0];const p="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",u={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class g extends s.WF{render(){return s.qy` <div class="issue-type ${(0,n.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${u[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,n.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?s.qy`<div class="title">${this.title}</div>`:s.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?s.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:s.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,c.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}g.styles=s.AH`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`,(0,a.Cg)([(0,r.MZ)()],g.prototype,"title",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"alert-type"})],g.prototype,"alertType",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"dismissable",void 0),(0,a.Cg)([(0,r.wk)(),(0,l.IW)()],g.prototype,"_localize",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"narrow",void 0),g=(0,a.Cg)([(0,r.EM)("ha-alert")],g),o()}catch(t){o(t)}})},90248(t,e,i){i.a(t,async function(t,o){try{i.r(e),i.d(e,{HaIconButtonArrowPrev:()=>p});var a=i(62826),s=i(5124),r=i(22441),n=i(63091),l=i(26300),c=t([l]);l=(c.then?(await c)():c)[0];const h="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",d="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class p extends s.WF{render(){return s.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"></ha-icon-button> `}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===n.G.document.dir?d:h}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"href",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"target",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"rel",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"download",void 0),(0,a.Cg)([(0,r.wk)()],p.prototype,"_icon",void 0),p=(0,a.Cg)([(0,r.EM)("ha-icon-button-arrow-prev")],p),o()}catch(t){o(t)}})},65829(t,e,i){i.a(t,async function(t,o){try{i.r(e),i.d(e,{HaSpinner:()=>c});var a=i(62826),s=i(55262),r=i(5124),n=i(22441),l=t([s]);s=(l.then?(await l)():l)[0];class c extends s.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[s.A.styles,r.AH`: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,a.Cg)([(0,n.MZ)()],c.prototype,"size",void 0),c=(0,a.Cg)([(0,n.EM)("ha-spinner")],c),o()}catch(t){o(t)}})},34127(t,e,i){i.a(t,async function(t,e){try{var o=i(62826),a=i(52630),s=i(5124),r=i(22441),n=t([a]);a=(n.then?(await n)():n)[0];class l extends a.A{static get styles(){return[a.A.styles,s.AH`:host{--wa-tooltip-background-color:var( --ha-tooltip-background-color, var(--ha-color-surface-default) );--wa-tooltip-content-color:var( --ha-tooltip-text-color, var(--primary-text-color) );--wa-tooltip-font-family:var( --ha-tooltip-font-family, var(--ha-font-family-body) );--wa-tooltip-font-size:var( --ha-tooltip-font-size, var(--ha-font-size-m) );--wa-tooltip-font-weight:var( --ha-tooltip-font-weight, var(--ha-font-weight-medium) );--wa-tooltip-line-height:var( --ha-tooltip-line-height, var(--ha-line-height-condensed) );--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var( --ha-tooltip-border-radius, var(--ha-border-radius-md) );--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`]}constructor(...t){super(...t),this.showDelay=350,this.hideDelay=150}}(0,o.Cg)([(0,r.MZ)({attribute:"show-delay",type:Number})],l.prototype,"showDelay",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"hide-delay",type:Number})],l.prototype,"hideDelay",void 0),l=(0,o.Cg)([(0,r.EM)("ha-tooltip")],l),e()}catch(t){e(t)}})},91485(t,e,i){i.a(t,async function(t,o){try{i.d(e,{U:()=>w});var a=i(62826),s=(i(86137),i(30006)),r=i(92070),n=i(35211),l=i(5124),c=i(22441),h=i(6412),d=i(63672),p=i(57237),u=i(22792),g=i(26300),m=(i(67094),i(34127)),y=i(53305),f=t([s,g,m]);[s,g,m]=f.then?(await f)():f;const _="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",b="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",v="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z";class w extends((0,y.w)(l.WF)){get _formControl(){return this._input}showPicker(){this._input?.showPicker()}stepUp(){this._input?.stepUp()}stepDown(){this._input?.stepDown()}async firstUpdated(t){super.firstUpdated(t),this.insetLabel||(await(this._input?.updateComplete),this._syncStartSlotWidth())}render(){const t=!this.label&&this._hasSlotController.test("label"),e=!this.hint&&this._hasSlotController.test("hint"),i=this._hasSlotController.test("start");return l.qy` <wa-input .type="${this.type}" .value="${this.value??null}" .withClear="${this.withClear}" .placeholder="${this.placeholder}" .readonly="${this.readonly}" .passwordToggle="${this.passwordToggle}" .passwordVisible="${this.passwordVisible}" .withoutSpinButtons="${this.withoutSpinButtons}" .required="${this.required}" .pattern="${this.pattern}" .minlength="${this.minlength}" .maxlength="${this.maxlength}" .min="${this.min}" .max="${this.max}" .step="${this.step}" .autocapitalize="${this.autocapitalize||void 0}" .autocorrect="${this.autocorrect?"on":"off"}" .autocomplete="${this.autocomplete}" .autofocus="${this.autofocus}" .enterkeyhint="${this.enterkeyhint||void 0}" .spellcheck="${this.spellcheck}" .inputmode="${this.inputmode||void 0}" .name="${this.name}" .disabled="${this.disabled}" class="${(0,h.H)({input:!0,invalid:this.invalid||this._invalid,"label-raised":void 0!==this.value&&""!==this.value||this.label&&this.placeholder||i&&this.insetLabel,"no-label":!this.label,"hint-hidden":!(this.hint||e||this.required||this._invalid||this.invalid)})}" @input="${this._handleInput}" @change="${this._handleChange}" @blur="${this._handleBlur}" @wa-invalid="${this._handleInvalid}" exportparts="base:wa-base, hint:wa-hint, input:wa-input"> ${this.label||t?l.qy`<slot name="label" slot="label">${this.label?this._renderLabel(this.label,this.required):l.s6}</slot>`:l.s6} <slot name="start" slot="start" @slotchange="${this._syncStartSlotWidth}"> ${this.renderStartDefault()} </slot> <slot name="end" slot="end"> ${this.renderEndDefault()} </slot> <slot name="clear-button" slot="clear-button"> <ha-icon-button @click="${this._handleClearClick}" .label="${this.i18n?.localize?.("ui.components.input.clear")||"Clear"}" .path="${_}"></ha-icon-button> </slot> <slot name="password-toggle-button" slot="password-toggle-button"> <ha-icon-button @keydown="${p.d}" @click="${this._handlePasswordToggle}" .label="${this.i18n?.localize?.("ui.components.input."+(this.passwordVisible?"hide_password":"show_password"))||(this.passwordVisible?"Hide password":"Show password")}" .path="${this.passwordVisible?v:b}"></ha-icon-button> </slot> <div slot="hint" class="${(0,h.H)({error:this.invalid||this._invalid})}" role="${(0,d.J)(this.invalid||this._invalid?"alert":void 0)}" aria-live="polite"> ${this._invalid||this.invalid?this.validationMessage||this._input?.validationMessage:this.hint||(e?l.qy`<slot name="hint"></slot>`:l.s6)} </div> </wa-input> `}renderStartDefault(){return l.s6}renderEndDefault(){return l.s6}_handleClearClick(){this._input?.clear()}_handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}constructor(...t){super(...t),this.appearance="material",this.type="text",this.withClear=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.withoutSpinButtons=!1,this.autocorrect=!1,this.insetLabel=!1,this._hasSlotController=new r.X(this,"label","hint","input","start"),this._syncStartSlotWidth=()=>{const t=this._input?.shadowRoot?.querySelector('[part~="start"]'),e=t?.offsetWidth??0;e>0&&!this.insetLabel?(this.style.setProperty("--start-slot-width",`calc(${e}px + var(--ha-space-1))`),this.style.setProperty("--input-padding-inline-start","var(--ha-space-1)")):(this.style.removeProperty("--start-slot-width"),this.style.removeProperty("--input-padding-inline-start"))}}}w.styles=[y.N,l.AH`:host{display:flex;align-items:flex-start;padding-top:var(--ha-input-padding-top);padding-bottom:var(--ha-input-padding-bottom,var(--ha-space-2));text-align:var(--ha-input-text-align,start)}:host([appearance=outlined]){padding-bottom:var(--ha-input-padding-bottom)}wa-input::part(label){padding-inline-start:calc(var(--start-slot-width,0px) + var(--ha-space-4));padding-inline-end:var(--ha-space-4);padding-top:var(--ha-space-5)}:host([appearance=material]:focus-within) wa-input::part(label){color:var(--primary-color)}:host(:focus-within) wa-input::part(label),:host([type=date]) wa-input::part(label),wa-input.label-raised::part(label){padding-top:var(--ha-space-3);font-size:var(--ha-font-size-xs)}wa-input::part(base){height:56px;padding:0 var(--ha-space-4)}:host([appearance=outlined]) wa-input.no-label::part(base){height:32px;padding:0 var(--ha-space-2)}:host([appearance=outlined]) wa-input::part(base){border:1px solid var(--ha-color-border-neutral-quiet);background-color:var(--card-background-color);border-radius:var(--ha-border-radius-md);transition:border-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]) ::part(base)::after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:var(--ha-color-border-neutral-loud);transition:height var(--wa-transition-normal) ease-in-out,background-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]:focus-within) wa-input::part(base)::after{height:2px;background-color:var(--primary-color)}:host([appearance=material]) wa-input.invalid:not([disabled])::part(base)::after,:host([appearance=material]:focus-within) wa-input.invalid::part(base)::after{background-color:var(--ha-color-border-danger-normal)}wa-input::part(input){padding-top:var(--ha-space-3);padding-inline-start:var(--input-padding-inline-start,0)}wa-input.no-label::part(input){padding-top:0}:host([type=color]) wa-input::part(input){padding-top:var(--ha-space-6);padding-bottom:2px;cursor:pointer}:host([type=color]) wa-input.no-label::part(input){padding:var(--ha-space-2)}:host([type=color]) wa-input.no-label::part(base){padding:0}wa-input::part(input)::placeholder{color:var(--ha-color-neutral-60)}wa-input::part(base):hover{background-color:var(--ha-color-form-background-hover)}:host([appearance=outlined]) wa-input::part(base):hover{border-color:var(--ha-color-border-neutral-normal)}:host([appearance=outlined]:focus-within) wa-input::part(base){border-color:var(--primary-color)}wa-input:disabled::part(base){background-color:var(--ha-color-form-background-disabled)}wa-input:disabled::part(label){opacity:.5}wa-input::part(end){color:var(--ha-color-text-secondary)}ha-icon-button{display:flex;align-items:center;color:var(--ha-color-text-secondary)}:host([appearance=outlined]) wa-input.no-label{--ha-icon-button-size:24px;--mdc-icon-size:18px}`],(0,a.Cg)([(0,c.MZ)({reflect:!0})],w.prototype,"appearance",void 0),(0,a.Cg)([(0,c.MZ)({reflect:!0})],w.prototype,"type",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,attribute:"with-clear"})],w.prototype,"withClear",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,attribute:"password-toggle"})],w.prototype,"passwordToggle",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,attribute:"password-visible"})],w.prototype,"passwordVisible",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,attribute:"without-spin-buttons"})],w.prototype,"withoutSpinButtons",void 0),(0,a.Cg)([(0,c.MZ)()],w.prototype,"pattern",void 0),(0,a.Cg)([(0,c.MZ)()],w.prototype,"min",void 0),(0,a.Cg)([(0,c.MZ)()],w.prototype,"max",void 0),(0,a.Cg)([(0,c.MZ)()],w.prototype,"step",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean})],w.prototype,"autocorrect",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,attribute:"inset-label"})],w.prototype,"insetLabel",void 0),(0,a.Cg)([(0,c.P)("wa-input")],w.prototype,"_input",void 0),(0,a.Cg)([(0,c.wk)(),(0,n.Fg)({context:u.D5,subscribe:!0})],w.prototype,"i18n",void 0),w=(0,a.Cg)([(0,c.EM)("ha-input")],w),o()}catch(t){o(t)}})},53305(t,e,i){i.d(e,{w:()=>l,N:()=>c});var o=i(62826),a=i(5124),s=i(22441),r=i(22786);i(74423);const n=Boolean(globalThis.ElementInternals)&&globalThis.HTMLElement?.prototype.attachInternals?.toString().includes("[native code]"),l=t=>{class e extends t{get _formControl(){throw new Error("_formControl getter must be implemented by subclass")}select(){this._formControl?.select()}setSelectionRange(t,e,i){this._formControl?.setSelectionRange(t,e,i)}setRangeText(t,e,i,o){this._formControl?.setRangeText(t,e,i,o)}checkValidity(){return!n||(this._formControl?.checkValidity()??!0)}reportValidity(){const t=this.checkValidity();return this._invalid=!t,t}_handleInput(){this.value=this._formControl?.value??void 0,this._invalid&&this._formControl?.checkValidity()&&(this._invalid=!1)}_handleChange(){this.value=this._formControl?.value??void 0}_handleBlur(){this.autoValidate&&(this._invalid=!this._formControl?.checkValidity())}_handleInvalid(){this._invalid=!0}constructor(...t){super(...t),this.label="",this.hint="",this.placeholder="",this.readonly=!1,this.required=!1,this.autocapitalize="",this.autofocus=!1,this.spellcheck=!0,this.inputmode="",this.enterkeyhint="",this.disabled=!1,this.validationMessage="",this.autoValidate=!1,this.invalid=!1,this._invalid=!1,this._requiredMarkerCSSVar="--ha-input-required-marker",this._renderLabel=(0,r.A)((t,e)=>{if(!e)return t;let i=getComputedStyle(this).getPropertyValue(this._requiredMarkerCSSVar);return i||(i="*"),i.startsWith('"')&&i.endsWith('"')&&(i=i.slice(1,-1)),i?`${t}${i}`:t})}}return e.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,o.Cg)([(0,s.MZ)()],e.prototype,"value",void 0),(0,o.Cg)([(0,s.MZ)()],e.prototype,"label",void 0),(0,o.Cg)([(0,s.MZ)()],e.prototype,"hint",void 0),(0,o.Cg)([(0,s.MZ)()],e.prototype,"placeholder",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],e.prototype,"readonly",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],e.prototype,"required",void 0),(0,o.Cg)([(0,s.MZ)({type:Number})],e.prototype,"minlength",void 0),(0,o.Cg)([(0,s.MZ)({type:Number})],e.prototype,"maxlength",void 0),(0,o.Cg)([(0,s.MZ)()],e.prototype,"autocapitalize",void 0),(0,o.Cg)([(0,s.MZ)()],e.prototype,"autocomplete",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],e.prototype,"autofocus",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],e.prototype,"spellcheck",void 0),(0,o.Cg)([(0,s.MZ)()],e.prototype,"inputmode",void 0),(0,o.Cg)([(0,s.MZ)()],e.prototype,"enterkeyhint",void 0),(0,o.Cg)([(0,s.MZ)()],e.prototype,"name",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],e.prototype,"disabled",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"validation-message"})],e.prototype,"validationMessage",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"auto-validate"})],e.prototype,"autoValidate",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],e.prototype,"invalid",void 0),(0,o.Cg)([(0,s.wk)()],e.prototype,"_invalid",void 0),e},c=a.AH`.input{flex:1;min-width:0;--wa-transition-fast:var(--wa-transition-normal);position:relative}.input::part(label){position:absolute;top:0;font-weight:var(--ha-font-weight-normal);font-family:var(--ha-font-family-body);transition:all var(--wa-transition-normal) ease-in-out;color:var(--secondary-text-color);line-height:var(--ha-line-height-condensed);z-index:1;pointer-events:none;font-size:var(--ha-font-size-m)}.input.invalid:not([disabled])::part(label),:host(:focus-within) .input.invalid::part(label){color:var(--ha-color-fill-danger-loud-resting)}.input::part(base){background-color:var(--ha-color-form-background);border-top-left-radius:var(--ha-border-radius-sm);border-top-right-radius:var(--ha-border-radius-sm);border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square);border:none;position:relative;transition:background-color var(--wa-transition-normal) ease-in-out}:host(:focus-within) .input::part(base){outline:0}.input::part(hint){min-height:var(--ha-space-5);margin-block-start:0;margin-inline-start:var(--ha-space-3);font-size:var(--ha-font-size-s);display:flex;align-items:center;color:var(--ha-color-text-secondary)}.input.hint-hidden::part(hint){height:0;min-height:0}.error{color:var(--ha-color-on-danger-quiet)}`},82e3(t,e,i){i.d(e,{D5:()=>o,Fy:()=>r,Gk:()=>c,Hg:()=>a,Y_:()=>h,ds:()=>l,e0:()=>s,ec:()=>n});i(74423),i(18111),i(61701),i(33110);const o=14881==i.j?`${location.protocol}//${location.host}`:null,a=t=>t.map(t=>{if("string"!==t.type)return t;switch(t.name){case"username":return{...t,autocomplete:"username",autofocus:!0};case"password":return{...t,autocomplete:"current-password"};case"code":return{...t,autocomplete:"one-time-code",autofocus:!0};default:return t}}),s=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),r=async(t,e,i,o)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:i,password:o}),n=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:i}),l=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:i}),c=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:i}),h=(t,e,i)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:i})},71606(t,e,i){i.d(e,{f:()=>a,o:()=>o});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);const o=new Set(["automation","script","scene","group"]),a=(t,e,i)=>t.callWS({type:"search/related",item_type:e,item_id:i})},28669(t,e,i){i.d(e,{TK:()=>n,_2:()=>c,eR:()=>a,hG:()=>l,hU:()=>s,kg:()=>r,wj:()=>o,xg:()=>h});i(44114),i(18111),i(61701);const o="system-admin",a="system-users",s=async t=>t.callWS({type:"config/auth/list"}),r=async(t,e,i,o)=>t.callWS({type:"config/auth/create",name:e,group_ids:i,local_only:o}),n=async(t,e,i)=>t.callWS({...i,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,i)=>{const o=[],a=e=>t.localize(`ui.panel.config.users.${e}`);return e.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",a("is_owner")]),i&&e.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",a("is_system")]),e.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",a("is_local")]),e.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",a("is_not_active")]),o}},15251(t,e,i){i.a(t,async function(t,o){try{i.r(e),i.d(e,{DialogStatisticsFix:()=>y});var a=i(62826),s=i(5124),r=i(22441),n=i(1087),l=i(18350),c=(i(93444),i(72554)),h=i(65829),d=i(23528),p=i(14503),u=i(36918),g=i(33963),m=t([l,c,h,g]);[l,c,h,g]=m.then?(await m)():m;class y extends s.WF{showDialog(t){this._params=t,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,this._clearing=!1,this._open=!1,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}render(){if(!this._params)return s.s6;const t=this._params.issue;return s.qy` <ha-dialog .open="${this._open}" header-title="${this.hass.localize(`ui.panel.config.developer-tools.tabs.statistics.fix_issue.${t.type}.title`)}" @closed="${this._dialogClosed}"> <p> ${this.hass.localize(`ui.panel.config.developer-tools.tabs.statistics.fix_issue.${t.type}.info_text_1`,{name:(0,d.$O)(this.hass,t.data.statistic_id,void 0),statistic_id:t.data.statistic_id,..."mean_type_changed"===t.type?{metadata_mean_type:this.hass.localize(`ui.panel.config.developer-tools.tabs.statistics.mean_type.${t.data.metadata_mean_type}`),state_mean_type:this.hass.localize(`ui.panel.config.developer-tools.tabs.statistics.mean_type.${t.data.state_mean_type}`)}:{}})}<br><br> ${this.hass.localize(`ui.panel.config.developer-tools.tabs.statistics.fix_issue.${t.type}.info_text_2`,{statistic_id:t.data.statistic_id})} ${"mean_type_changed"===t.type?s.qy`<br><br> ${this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.mean_type_changed.info_text_3",{statistic_id:t.data.statistic_id})}`:"entity_not_recorded"===t.type?s.qy`<br><br> <a href="${(0,u.o)(this.hass,"/integrations/recorder/#configure-filter")}" target="_blank" rel="noreferrer noopener"> ${this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.entity_not_recorded.info_text_3_link")}</a>`:"entity_no_longer_recorded"===t.type?s.qy`<a href="${(0,u.o)(this.hass,"/integrations/recorder/#configure-filter")}" target="_blank" rel="noreferrer noopener"> ${this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.entity_no_longer_recorded.info_text_3_link")}</a><br><br> ${this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.entity_no_longer_recorded.info_text_4")}`:"state_class_removed"===t.type?s.qy`<ul> <li> ${this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_3")} </li> <li> ${this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_4")} <a href="https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics" target="_blank" rel="noreferrer noopener"> ${this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_4_link")}</a> </li> <li> ${this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_5")} </li> </ul> ${this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_6",{statistic_id:t.data.statistic_id})}`:s.s6} </p> <ha-dialog-footer slot="footer"> ${"entity_not_recorded"!==t.type?s.qy`<ha-button appearance="plain" slot="secondaryAction" @click="${this._cancel}"> ${this.hass.localize("ui.common.close")} </ha-button> <ha-button slot="primaryAction" appearance="filled" @click="${this._clearStatistics}" variant="danger" .disabled="${this._clearing}" .loading="${this._clearing}"> ${this.hass.localize("ui.common.delete")} </ha-button>`:s.qy`<ha-button slot="primaryAction" @click="${this._cancel}"> ${this.hass.localize("ui.common.ok")} </ha-button>`} </ha-dialog-footer> </ha-dialog> `}_cancel(){this._params?.cancelCallback(),this.closeDialog()}async _clearStatistics(){this._clearing=!0;try{await(0,d.$3)(this.hass,[this._params.issue.data.statistic_id])}catch(t){await(0,g.showAlertDialog)(this,{title:"timeout"===t.code?this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.clearing_timeout_title"):this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.clearing_failed"),text:"timeout"===t.code?this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.clearing_timeout_text"):t.message})}finally{this._clearing=!1,this._params?.fixedCallback(),this.closeDialog()}}static get styles(){return[p.RF,p.nA]}constructor(...t){super(...t),this._open=!1,this._clearing=!1}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,a.Cg)([(0,r.wk)()],y.prototype,"_params",void 0),(0,a.Cg)([(0,r.wk)()],y.prototype,"_open",void 0),(0,a.Cg)([(0,r.wk)()],y.prototype,"_clearing",void 0),y=(0,a.Cg)([(0,r.EM)("dialog-statistics-fix")],y),o()}catch(t){o(t)}})},34128(t,e,i){i.d(e,{G9:()=>r,Ni:()=>s,Ue:()=>h,Vd:()=>d,gh:()=>p});i(74423);var o=i(1087),a=i(45291);const s=t=>{const e=document.createElement("hui-error-card");return customElements.get("hui-error-card")?e.setConfig(t):(Promise.resolve().then(i.bind(i,4397)),customElements.whenDefined("hui-error-card").then(()=>{customElements.upgrade(e),e.setConfig(t)})),e},r=(t,e)=>({type:"error",error:t,origConfig:e}),n=(t,e)=>{const i=document.createElement(t);return i.setConfig(e),i},l=(t,e,o)=>"badge"===t?(t=>{const e=document.createElement("hui-error-badge");return customElements.get("hui-error-badge")?e.setConfig(t):(Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(58416),i.e(99788),i.e(22398),i.e(82134),i.e(26092),i.e(34310),i.e(59704),i.e(25322),i.e(90790),i.e(89747),i.e(59532),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(12009),i.e(66990),i.e(3025),i.e(38108),i.e(66006),i.e(38260)]).then(i.bind(i,50655)),customElements.whenDefined("hui-error-badge").then(()=>{customElements.upgrade(e),e.setConfig(t)})),e})(r(e,o)):"heading-badge"===t?(t=>{const e=document.createElement("hui-error-heading-badge");return customElements.get("hui-error-heading-badge")?e.setConfig(t):(Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(58416),i.e(99788),i.e(22398),i.e(82134),i.e(26092),i.e(34310),i.e(59704),i.e(25322),i.e(90790),i.e(89747),i.e(59532),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(12009),i.e(66990),i.e(3025),i.e(38108),i.e(66006),i.e(21614)]).then(i.bind(i,13469)),customElements.whenDefined("hui-error-heading-badge").then(()=>{customElements.upgrade(e),e.setConfig(t)})),e})(((t,e)=>({type:"error",error:t,origConfig:e}))(e,o)):s({type:"error",message:e}),c=t=>(0,a.c8)(t)?(0,a.Iu)(t):void 0,h=(t,e,i,o,a,s)=>{try{return d(t,e,i,o,a,s)}catch(i){return console.error(t,e.type,i),l(t,i.message,e)}},d=(t,e,i,a,s,r)=>{if(!e||"object"!=typeof e)throw new Error("Config is not an object");if(!(e.type||r||s&&"entity"in e))throw new Error("No card type configured");const h=e.type?c(e.type):void 0;if(h)return((t,e,i)=>{if(customElements.get(e))return n(e,i);const a=l(t,`Custom element doesn't exist: ${e}.`,i);if(!e.includes("-"))return a;a.style.display="None";const s=window.setTimeout(()=>{a.style.display=""},2e3);return customElements.whenDefined(e).then(()=>{clearTimeout(s),(0,o.r)(a,"ll-rebuild")}),a})(t,h,e);let d;if(s&&!e.type&&e.entity){d=`${s[e.entity.split(".",1)[0]]||s._domain_not_found}-entity`}else d=e.type||r;if(void 0===d)throw new Error("No type specified");const p=`hui-${d}-${t}`;if(a&&d in a)return a[d](),((t,e)=>{if(customElements.get(t))return n(t,e);const i=document.createElement(t);return customElements.whenDefined(t).then(()=>{try{customElements.upgrade(i),(0,o.r)(i,"ll-upgrade"),i.setConfig(e)}catch(t){(0,o.r)(i,"ll-rebuild")}}),i})(p,e);if(i&&i.has(d))return n(p,e);throw new Error(`Unknown type encountered: ${d}`)},p=async(t,e,i,o)=>{const a=c(t);if(a){const t=customElements.get(a);if(t)return t;if(!a.includes("-"))throw new Error(`Custom element not found: ${a}`);return new Promise((t,e)=>{setTimeout(()=>e(new Error(`Custom element not found: ${a}`)),2e3),customElements.whenDefined(a).then(()=>t(customElements.get(a)))})}const s=`hui-${t}-${e}`,r=customElements.get(s);if(i&&i.has(t))return r;if(o&&t in o)return r||o[t]().then(()=>customElements.get(s));throw new Error(`Unknown type: ${t}`)}},94225(t,e,i){i.a(t,async function(t,o){try{i.d(e,{T:()=>b,t:()=>v});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(99799),s=i(29003),r=i(92055),n=i(19396),l=i(74323),c=i(51199),h=i(43721),d=i(65509),p=i(21659),u=i(82525),g=i(34128),m=t([a,s,r,n,l,c,h,d,p,u]);[a,s,r,n,l,c,h,d,p,u]=m.then?(await m)():m;const y=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),f={"button-entity":()=>i.e(26846).then(i.bind(i,21869)),"climate-entity":()=>i.e(56995).then(i.bind(i,2798)),"cover-entity":()=>i.e(41243).then(i.bind(i,79734)),"date-entity":()=>i.e(17418).then(i.bind(i,75473)),"datetime-entity":()=>Promise.all([i.e(99194),i.e(81767)]).then(i.bind(i,69690)),"event-entity":()=>Promise.resolve().then(i.bind(i,99799)),"group-entity":()=>i.e(68827).then(i.bind(i,53110)),"input-button-entity":()=>i.e(19825).then(i.bind(i,46472)),"humidifier-entity":()=>i.e(378).then(i.bind(i,53537)),"input-datetime-entity":()=>i.e(71748).then(i.bind(i,1391)),"input-number-entity":()=>i.e(17600).then(i.bind(i,58723)),"input-select-entity":()=>i.e(44325).then(i.bind(i,54596)),"input-text-entity":()=>i.e(8086).then(i.bind(i,51765)),"lock-entity":()=>i.e(28245).then(i.bind(i,49748)),"number-entity":()=>i.e(71523).then(i.bind(i,57198)),"select-entity":()=>i.e(9374).then(i.bind(i,78157)),"text-entity":()=>i.e(67973).then(i.bind(i,58212)),"time-entity":()=>i.e(61331).then(i.bind(i,87550)),"timer-entity":()=>i.e(94097).then(i.bind(i,6344)),"update-entity":()=>i.e(80275).then(i.bind(i,38238)),"valve-entity":()=>i.e(96654).then(i.bind(i,46493)),conditional:()=>Promise.all([i.e(67218),i.e(77563),i.e(78490)]).then(i.bind(i,80725)),"weather-entity":()=>Promise.all([i.e(12009),i.e(77547)]).then(i.bind(i,80395)),divider:()=>i.e(45249).then(i.bind(i,38584)),section:()=>i.e(51255).then(i.bind(i,39082)),weblink:()=>i.e(69148).then(i.bind(i,65751)),cast:()=>i.e(10405).then(i.bind(i,96612)),buttons:()=>i.e(50777).then(i.bind(i,65728)),attribute:()=>Promise.resolve().then(i.bind(i,65509)),text:()=>i.e(95421).then(i.bind(i,3980))},_={_domain_not_found:"simple",alert:"toggle",automation:"toggle",button:"button",climate:"climate",cover:"cover",date:"date",datetime:"datetime",event:"event",fan:"toggle",group:"group",humidifier:"humidifier",input_boolean:"toggle",input_button:"input-button",input_datetime:"input-datetime",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",number:"number",remote:"toggle",scene:"scene",script:"script",select:"select",sensor:"sensor",siren:"toggle",switch:"toggle",text:"text",time:"time",timer:"timer",update:"update",vacuum:"toggle",valve:"valve",water_heater:"climate",weather:"weather"},b=t=>(0,g.Ue)("row",t,y,f,_,void 0),v=t=>(0,g.gh)(t,"row",y,f);o()}catch(t){o(t)}})}};