iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
4 lines • 33.3 kB
JavaScript
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[32659],{36356:function(t,e,i){i.d(e,{q:function(){return n}});class n{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(){var t;this._scrollContainer=null===(t=this._host.renderRoot)||void 0===t?void 0:t.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=null==i||i,t.addController(this)}}},95747:function(t,e,i){i.a(t,async function(t,n){try{i.d(e,{CL:function(){return b},GH:function(){return C},Rl:function(){return f},ZS:function(){return _},aQ:function(){return m},r6:function(){return h},yg:function(){return v}});var s=i(74487),o=i(22786),r=i(72487),a=i(30162),c=i(8480),l=i(69543),u=t([s,c,r,a]);[s,c,r,a]=u.then?(await u)():u;const h=(t,e,i)=>d(e,i.time_zone).format(t),d=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),f=t=>p().format(t),p=(0,o.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),m=(t,e,i)=>g(e,i.time_zone).format(t),g=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),_=(t,e,i)=>y(e,i.time_zone).format(t),y=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),b=(t,e,i)=>(new Date).getFullYear()===t.getFullYear()?_(t,e,i):m(t,e,i),v=(t,e,i)=>w(e,i.time_zone).format(t),w=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),C=(t,e,i)=>`${(0,r.zB)(t,e,i)}, ${(0,a.fU)(t,e,i)}`;n()}catch(h){n(h)}})},8480:function(t,e,i){i.a(t,async function(t,n){try{i.d(e,{fL:function(){return f},n2:function(){return p},wj:function(){return m}});var s,o,r,a=i(74487),c=i(29079),l=i(46927),u=t([a]);a=(u.then?(await u)():u)[0];const h=null===(s=Intl.DateTimeFormat)||void 0===s||null===(o=(r=s.call(Intl)).resolvedOptions)||void 0===o?void 0:o.call(r).timeZone,d=h&&("UTC"===h||"Etc/UTC"===h||h in c)?h:void 0,f=14881==i.j?void 0!==d:null,p=null!=d?d:"UTC",m=(t,e)=>t===l.Wj.local&&d?p:e;n()}catch(h){n(h)}})},93421:function(t,e,i){i.d(e,{IW:function(){return u},dH:function(){return l},fI:function(){return c}});i(44114),i(62953);var n=i(35211),s=i(22792),o=i(32172);const r=(t,e)=>{let i=t;for(const n of e){if(null==i)return;i=i[n]}return i},a=(t,e,i)=>{const s=(0,o.p)({transformer:function(t){return i.call(this,t)},watch:e?[e]:[]}),r=(0,n.Fg)({context:t,subscribe:!0});return(t,e)=>{s(t,e),r(t,e)}},c=t=>a(s.iN,t.entityIdPath[0],function(e){const i=r(this,t.entityIdPath);return"string"==typeof i?null==e?void 0:e[i]:void 0}),l=t=>a(s.X1,t.entityIdPath[0],function(e){const i=r(this,t.entityIdPath);return"string"==typeof i?null==e?void 0:e[i]:void 0}),u=()=>a(s.D5,void 0,({localize:t})=>t)},93905:function(t,e,i){i.d(e,{I:function(){return o}});i(16280),i(44114),i(18111),i(7588),i(69112),i(33110);class n{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(n){}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 s={};function o(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const o=t.storage||"localStorage";let r;o&&o in s?r=s[o]:(r=new n(window[o]),s[o]=r);const a=t.key||String(i);r.addFromStorage(a);const c=!1!==t.subscribe?t=>r.subscribeChanges(a,(e,n)=>{t.requestUpdate(i,e)}):void 0,l=()=>r.hasKey(a)?t.deserializer?t.deserializer(r.getValue(a)):r.getValue(a):void 0,u=(e,n)=>{let s;t.state&&(s=l()),r.setValue(a,t.serializer?t.serializer(n):n),t.state&&e.requestUpdate(i,s)},h=e.performUpdate;if(e.performUpdate=function(){this.__initialized=!0,h.call(this)},t.subscribe){const t=e.connectedCallback,i=e.disconnectedCallback;e.connectedCallback=function(){t.call(this);const e=this;e.__unbsubLocalStorage||(e.__unbsubLocalStorage=null==c?void 0:c(this))},e.disconnectedCallback=function(){var t;i.call(this);const e=this;null===(t=e.__unbsubLocalStorage)||void 0===t||t.call(e),e.__unbsubLocalStorage=void 0}}const d=Object.getOwnPropertyDescriptor(e,i);let f;if(void 0===d)f={get(){return l()},set(t){(this.__initialized||void 0===l())&&u(this,t)},configurable:!0,enumerable:!0};else{const t=d.set;f=Object.assign(Object.assign({},d),{},{get(){return l()},set(e){(this.__initialized||void 0===l())&&u(this,e),null==t||t.call(this,e)}})}Object.defineProperty(e,i,f)}}},32172:function(t,e,i){i.d(e,{p:function(){return n}});i(16280),i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);function n(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const n=String(i),s=e;if(s._transformers){if(!s.hasOwnProperty("_transformers")){const t=s._transformers;s._transformers=new Map,t.forEach((t,e)=>s._transformers.set(e,t))}}else{s._transformers=new Map,s._watching=new Map;const t=s.willUpdate;s.willUpdate=function(e){t.call(this,e);const i=new Set;e.forEach((t,e)=>{const n=this._watching.get(e);void 0!==n&&n.forEach(t=>i.add(t))}),i.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}s._transformers.set(i,t.transformer),t.watch&&t.watch.forEach(t=>{let e=s._watching.get(t);e||(e=new Set,s._watching.set(t,e)),e.add(i)});const o=Object.getOwnPropertyDescriptor(e,i);let r;if(void 0===o)r={get(){return this[`__transform_${n}`]},set(t){const e=this[`__transform_${n}`],i=this._transformers.get(n);this[`__transform_${n}`]=i?i.call(this,t):t,this[`__original_${n}`]=t,this.requestUpdate(n,e)},configurable:!0,enumerable:!0};else{const t=o.set;r=Object.assign(Object.assign({},o),{},{set(e){const i=this[`__transform_${n}`],s=this._transformers.get(n);this[`__transform_${n}`]=s?s.call(this,e):e,this[`__original_${n}`]=e,this.requestUpdate(n,i),null==t||t.call(this,e)}})}Object.defineProperty(e,i,r)}}},68348:function(t,e,i){i.d(e,{u:function(){return n}});i(18111),i(13579);const n=t=>{var e,i;if(t.some(t=>"tagName"in t&&("HA-MENU"===t.tagName||"HA-CODE-EDITOR"===t.tagName)))return!1;const n=t[0];if("TEXTAREA"===n.tagName||"HA-SELECT"===(null===(e=n.parentElement)||void 0===e?void 0:e.tagName)||"HA-DROPDOWN"===(null===(i=n.parentElement)||void 0===i?void 0:i.tagName))return!1;if("INPUT"!==n.tagName)return!0;switch(n.type){case"button":case"checkbox":case"hidden":case"radio":case"range":return!0;default:return!1}}},76830:function(t,e,i){i.d(e,{d:function(){return n}});i(18111),i(20116);const n=(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 n=i.href;if(!n||-1!==n.indexOf("mailto:"))return;const s=window.location,o=s.origin||s.protocol+"//"+s.host;return n.startsWith(o)&&(n=n.slice(o.length),"#"!==n)?(e&&t.preventDefault(),n):void 0}},17451:function(t,e,i){i.d(e,{j:function(){return n}});const n=(t,e,i)=>(void 0!==i&&(i=!!i),t.hasAttribute(e)?!!i||(t.removeAttribute(e),!1):!1!==i&&(t.setAttribute(e,""),!0))},19459:function(t,e,i){i.d(e,{b:function(){return n}});i(45367),i(92731),i(84864),i(57465),i(27495),i(69479),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const n=(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 s,o;if(Array.isArray(t)){if(o=t.length,o!==e.length)return!1;for(s=o;0!==s--;)if(!n(t[s],e[s],i))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(s of t.entries())if(!e.has(s[0]))return!1;for(s of t.entries())if(!n(s[1],e.get(s[0]),i))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(s of t.entries())if(!e.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(o=t.length,o!==e.length)return!1;for(s=o;0!==s--;)if(t[s]!==e[s])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(o=r.length,o!==Object.keys(e).length)return!1;for(s=o;0!==s--;)if(!Object.prototype.hasOwnProperty.call(e,r[s]))return!1;for(s=o;0!==s--;){const o=r[s];if(!n(t[o],e[o],i))return!1}if(null!=i&&i.compareSymbols){const s=Object.getOwnPropertySymbols(t),o=Object.getOwnPropertySymbols(e);if(s.length!==o.length)return!1;for(const r of s){if(!Object.prototype.hasOwnProperty.call(e,r))return!1;if(!n(t[r],e[r],i))return!1}}return!0}return t!=t&&e!=e}},64481:function(t,e,i){i.d(e,{D:function(){return s},J:function(){return r}});i(16280),i(3362),i(55815),i(64979),i(79739);let n=!1;try{n="true"===window.localStorage.getItem("disableViewTransition")}catch(a){}const s=t=>{n=t},o=t=>{if(!(t=>(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name)(t))throw t},r=t=>{if(!document.startViewTransition||n)return t(!1),Promise.resolve();let e=!1;try{const i=document.startViewTransition(()=>{e=!0,t(!0)});return i.ready.catch(o),i.finished.catch(o)}catch(i){return console.warn("View transition failed, falling back to direct execution.",i),e?Promise.reject(i):(t(!1),Promise.resolve())}}},38962:function(t,e,i){i.a(t,async function(t,n){try{i.r(e);i(62953);var s=i(40445),o=i(5124),r=i(67576),a=i(6412),c=i(93421),l=i(1087),u=i(26300),h=(i(67094),t([u]));u=(h.then?(await h)():h)[0];let d,f,p,m,g=t=>t;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",y={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 b extends o.WF{render(){var t;return(0,o.qy)(d||(d=g` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,a.H)({[this.alertType]:!0}),this.title?"":"no-title",y[this.alertType],(0,a.H)({content:!0,narrow:this.narrow}),this.title?(0,o.qy)(f||(f=g`<div class="title">${0}</div>`),this.title):o.s6,this.dismissable?(0,o.qy)(p||(p=g`<ha-icon-button @click="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(t=this._localize)||void 0===t?void 0:t.call(this,"ui.common.dismiss_alert"),_):o.s6)}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}b.styles=(0,o.AH)(m||(m=g`.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,s.Cg)([(0,r.MZ)()],b.prototype,"title",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"alert-type"})],b.prototype,"alertType",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],b.prototype,"dismissable",void 0),(0,s.Cg)([(0,r.wk)(),(0,c.IW)()],b.prototype,"_localize",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],b.prototype,"narrow",void 0),b=(0,s.Cg)([(0,r.EM)("ha-alert")],b),n()}catch(d){n(d)}})},90248:function(t,e,i){i.a(t,async function(t,n){try{i.r(e),i.d(e,{HaIconButtonArrowPrev:function(){return p}});i(62953);var s=i(40445),o=i(5124),r=i(67576),a=i(63091),c=i(26300),l=t([c]);c=(l.then?(await l)():l)[0];let u,h=t=>t;const d="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",f="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class p extends o.WF{render(){var t;return(0,o.qy)(u||(u=h` <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"===a.G.document.dir?f:d}}(0,s.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"label",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"href",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"target",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"rel",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"download",void 0),(0,s.Cg)([(0,r.wk)()],p.prototype,"_icon",void 0),p=(0,s.Cg)([(0,r.EM)("ha-icon-button-arrow-prev")],p),n()}catch(u){n(u)}})},65829:function(t,e,i){i.a(t,async function(t,n){try{i.r(e),i.d(e,{HaSpinner:function(){return h}});var s=i(40445),o=i(55262),r=i(5124),a=i(67576),c=t([o]);o=(c.then?(await c)():c)[0];let l,u=t=>t;class h extends o.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[o.A.styles,(0,r.AH)(l||(l=u`: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,s.Cg)([(0,a.MZ)()],h.prototype,"size",void 0),h=(0,s.Cg)([(0,a.EM)("ha-spinner")],h),n()}catch(l){n(l)}})},82e3:function(t,e,i){i.d(e,{D5:function(){return n},Fy:function(){return r},Gk:function(){return l},Hg:function(){return s},Y_:function(){return u},ds:function(){return c},e0:function(){return o},ec:function(){return a}});i(74423),i(18111),i(61701),i(33110),i(3362);const n=14881==i.j?`${location.protocol}//${location.host}`:null,s=t=>t.map(t=>{if("string"!==t.type)return t;switch(t.name){case"username":return Object.assign(Object.assign({},t),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},t),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},t),{},{autocomplete:"one-time-code",autofocus:!0});default:return t}}),o=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),r=async(t,e,i,n)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:i,password:n}),a=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:i}),c=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:i}),l=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:i}),u=(t,e,i)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:i})},71606:function(t,e,i){i.d(e,{f:function(){return s},o:function(){return n}});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const n=new Set(["automation","script","scene","group"]),s=(t,e,i)=>t.callWS({type:"search/related",item_type:e,item_id:i})},28669:function(t,e,i){i.d(e,{TK:function(){return a},_2:function(){return l},eR:function(){return s},hG:function(){return c},hU:function(){return o},kg:function(){return r},wj:function(){return n},xg:function(){return u}});i(44114),i(18111),i(61701),i(3362),i(42762);const n="system-admin",s="system-users",o=async t=>t.callWS({type:"config/auth/list"}),r=async(t,e,i,n)=>t.callWS({type:"config/auth/create",name:e,group_ids:i,local_only:n}),a=async(t,e,i)=>t.callWS(Object.assign(Object.assign({},i),{},{type:"config/auth/update",user_id:e})),c=async(t,e)=>t.callWS({type:"config/auth/delete",user_id:e}),l=t=>t?t.trim().split(" ").slice(0,3).map(t=>t.substring(0,1)).join(""):"?",u=(t,e,i)=>{const n=[],s=e=>t.localize(`ui.panel.config.users.${e}`);return e.is_owner&&n.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",s("is_owner")]),i&&e.system_generated&&n.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",s("is_system")]),e.local_only&&n.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",s("is_local")]),e.is_active||n.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",s("is_not_active")]),n}},15251:function(t,e,i){i.a(t,async function(t,n){try{i.r(e),i.d(e,{DialogStatisticsFix:function(){return $}});i(3362),i(62953);var s=i(40445),o=i(5124),r=i(67576),a=i(1087),c=i(18350),l=(i(93444),i(72554)),u=i(65829),h=i(23528),d=i(14503),f=i(36918),p=i(33963),m=t([c,l,u,h,p]);[c,l,u,h,p]=m.then?(await m)():m;let g,_,y,b,v,w,C,x=t=>t;class $ extends o.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,a.r)(this,"dialog-closed",{dialog:this.localName})}render(){if(!this._params)return o.s6;const t=this._params.issue;return(0,o.qy)(g||(g=x` <ha-dialog .open="${0}" header-title="${0}" @closed="${0}"> <p> ${0}<br><br> ${0} ${0} </p> <ha-dialog-footer slot="footer"> ${0} </ha-dialog-footer> </ha-dialog> `),this._open,this.hass.localize(`ui.panel.config.developer-tools.tabs.statistics.fix_issue.${t.type}.title`),this._dialogClosed,this.hass.localize(`ui.panel.config.developer-tools.tabs.statistics.fix_issue.${t.type}.info_text_1`,Object.assign({name:(0,h.$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}`)}:{})),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?(0,o.qy)(_||(_=x`<br><br> ${0}`),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?(0,o.qy)(y||(y=x`<br><br> <a href="${0}" target="_blank" rel="noreferrer noopener"> ${0}</a>`),(0,f.o)(this.hass,"/integrations/recorder/#configure-filter"),this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.entity_not_recorded.info_text_3_link")):"entity_no_longer_recorded"===t.type?(0,o.qy)(b||(b=x`<a href="${0}" target="_blank" rel="noreferrer noopener"> ${0}</a><br><br> ${0}`),(0,f.o)(this.hass,"/integrations/recorder/#configure-filter"),this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.entity_no_longer_recorded.info_text_3_link"),this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.entity_no_longer_recorded.info_text_4")):"state_class_removed"===t.type?(0,o.qy)(v||(v=x`<ul> <li> ${0} </li> <li> ${0} <a href="https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics" target="_blank" rel="noreferrer noopener"> ${0}</a> </li> <li> ${0} </li> </ul> ${0}`),this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_3"),this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_4"),this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_4_link"),this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_5"),this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.state_class_removed.info_text_6",{statistic_id:t.data.statistic_id})):o.s6,"entity_not_recorded"!==t.type?(0,o.qy)(w||(w=x`<ha-button appearance="plain" slot="secondaryAction" @click="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" appearance="filled" @click="${0}" variant="danger" .disabled="${0}" .loading="${0}"> ${0} </ha-button>`),this._cancel,this.hass.localize("ui.common.close"),this._clearStatistics,this._clearing,this._clearing,this.hass.localize("ui.common.delete")):(0,o.qy)(C||(C=x`<ha-button slot="primaryAction" @click="${0}"> ${0} </ha-button>`),this._cancel,this.hass.localize("ui.common.ok")))}_cancel(){var t;null===(t=this._params)||void 0===t||t.cancelCallback(),this.closeDialog()}async _clearStatistics(){this._clearing=!0;try{await(0,h.$3)(this.hass,[this._params.issue.data.statistic_id])}catch(e){await(0,p.showAlertDialog)(this,{title:"timeout"===e.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"===e.code?this.hass.localize("ui.panel.config.developer-tools.tabs.statistics.fix_issue.clearing_timeout_text"):e.message})}finally{var t;this._clearing=!1,null===(t=this._params)||void 0===t||t.fixedCallback(),this.closeDialog()}}static get styles(){return[d.RF,d.nA]}constructor(...t){super(...t),this._open=!1,this._clearing=!1}}(0,s.Cg)([(0,r.MZ)({attribute:!1})],$.prototype,"hass",void 0),(0,s.Cg)([(0,r.wk)()],$.prototype,"_params",void 0),(0,s.Cg)([(0,r.wk)()],$.prototype,"_open",void 0),(0,s.Cg)([(0,r.wk)()],$.prototype,"_clearing",void 0),$=(0,s.Cg)([(0,r.EM)("dialog-statistics-fix")],$),n()}catch(g){n(g)}})},34128:function(t,e,i){i.d(e,{G9:function(){return r},Ni:function(){return o},Ue:function(){return u},Vd:function(){return h},gh:function(){return d}});i(16280),i(74423),i(3362),i(62953);var n=i(1087),s=i(45291);const o=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}),a=(t,e)=>{const i=document.createElement(t);return i.setConfig(e),i},c=(t,e,n)=>"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(98470),i.e(99788),i.e(66283),i.e(82134),i.e(45981),i.e(26092),i.e(39005),i.e(34310),i.e(59704),i.e(25322),i.e(55392),i.e(89747),i.e(71572),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(57693),i.e(38260)]).then(i.bind(i,50655)),customElements.whenDefined("hui-error-badge").then(()=>{customElements.upgrade(e),e.setConfig(t)})),e})(r(e,n)):"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(98470),i.e(99788),i.e(66283),i.e(82134),i.e(45981),i.e(26092),i.e(39005),i.e(34310),i.e(59704),i.e(25322),i.e(55392),i.e(89747),i.e(71572),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(57693),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,n)):o({type:"error",message:e}),l=t=>(0,s.c8)(t)?(0,s.Iu)(t):void 0,u=(t,e,i,n,s,o)=>{try{return h(t,e,i,n,s,o)}catch(r){return console.error(t,e.type,r),c(t,r.message,e)}},h=(t,e,i,s,o,r)=>{if(!e||"object"!=typeof e)throw new Error("Config is not an object");if(!(e.type||r||o&&"entity"in e))throw new Error("No card type configured");const u=e.type?l(e.type):void 0;if(u)return((t,e,i)=>{if(customElements.get(e))return a(e,i);const s=c(t,`Custom element doesn't exist: ${e}.`,i);if(!e.includes("-"))return s;s.style.display="None";const o=window.setTimeout(()=>{s.style.display=""},2e3);return customElements.whenDefined(e).then(()=>{clearTimeout(o),(0,n.r)(s,"ll-rebuild")}),s})(t,u,e);let h;if(o&&!e.type&&e.entity){h=`${o[e.entity.split(".",1)[0]]||o._domain_not_found}-entity`}else h=e.type||r;if(void 0===h)throw new Error("No type specified");const d=`hui-${h}-${t}`;if(s&&h in s)return s[h](),((t,e)=>{if(customElements.get(t))return a(t,e);const i=document.createElement(t);return customElements.whenDefined(t).then(()=>{try{customElements.upgrade(i),(0,n.r)(i,"ll-upgrade"),i.setConfig(e)}catch(t){(0,n.r)(i,"ll-rebuild")}}),i})(d,e);if(i&&i.has(h))return a(d,e);throw new Error(`Unknown type encountered: ${h}`)},d=async(t,e,i,n)=>{const s=l(t);if(s){const t=customElements.get(s);if(t)return t;if(!s.includes("-"))throw new Error(`Custom element not found: ${s}`);return new Promise((t,e)=>{setTimeout(()=>e(new Error(`Custom element not found: ${s}`)),2e3),customElements.whenDefined(s).then(()=>t(customElements.get(s)))})}const o=`hui-${t}-${e}`,r=customElements.get(o);if(i&&i.has(t))return r;if(n&&t in n)return r||n[t]().then(()=>customElements.get(o));throw new Error(`Unknown type: ${t}`)}},94225:function(t,e,i){i.a(t,async function(t,n){try{i.d(e,{T:function(){return b},t:function(){return v}});i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var s=i(99799),o=i(29003),r=i(92055),a=i(19396),c=i(74323),l=i(51199),u=i(43721),h=i(65509),d=i(21659),f=i(82525),p=i(34128),m=t([s,o,r,a,c,l,u,h,d,f]);[s,o,r,a,c,l,u,h,d,f]=m.then?(await m)():m;const g=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),_={"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(24617),i.e(55328)]).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":()=>Promise.all([i.e(21209),i.e(7004)]).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))},y={_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,p.Ue)("row",t,g,_,y,void 0),v=t=>(0,p.gh)(t,"row",g,_);n()}catch(g){n(g)}})}}]);