UNPKG

iobroker.lovelace

Version:

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

28 lines 43.5 kB
export const __rspack_esm_id=14771;export const __rspack_esm_ids=[14771];export const __webpack_modules__={72487(e,t,a){a.a(e,async function(e,o){try{a.d(t,{CA:()=>S,Mi:()=>T,Pm:()=>$,Wq:()=>w,Yq:()=>d,bl:()=>L,c2:()=>_,fr:()=>y,gu:()=>k,kz:()=>c,m9:()=>Z,sl:()=>u,ur:()=>E,zB:()=>m});a(18111),a(20116);var i=a(74487),r=a(22786),s=a(46927),n=a(8480),l=e([i,n]);[i,n]=l.then?(await l)():l;(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,n.wj)(e.time_zone,t)}));const d=(e,t,a)=>h(t,a.time_zone).format(e),h=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),c=(e,t,a)=>p(t,a.time_zone).format(e),p=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),m=(e,t,a)=>{const o=g(t,a.time_zone);if(t.date_format===s.ow.language||t.date_format===s.ow.system)return o.format(e);const i=o.formatToParts(e),r=i.find(e=>"literal"===e.type)?.value,n=i.find(e=>"day"===e.type)?.value,l=i.find(e=>"month"===e.type)?.value,d=i.find(e=>"year"===e.type)?.value,h=i[i.length-1];let c="literal"===h?.type?h?.value:"";"bg"===t.language&&t.date_format===s.ow.YMD&&(c="");return{[s.ow.DMY]:`${n}${r}${l}${r}${d}${c}`,[s.ow.MDY]:`${l}${r}${n}${r}${d}${c}`,[s.ow.YMD]:`${d}${r}${l}${r}${n}${c}`}[t.date_format]},g=(0,r.A)((e,t)=>{const a=e.date_format===s.ow.system?void 0:e.language;return e.date_format===s.ow.language||(e.date_format,s.ow.system),new Intl.DateTimeFormat(a,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})}),u=(e,t,a)=>f(t,a.time_zone).format(e),f=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short",timeZone:(0,n.wj)(e.time_zone,t)})),y=(e,t,a)=>v(t,a.time_zone).format(e),v=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),w=(e,t,a)=>b(t,a.time_zone).format(e),b=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",timeZone:(0,n.wj)(e.time_zone,t)})),_=(e,t,a)=>x(t,a.time_zone).format(e),x=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",timeZone:(0,n.wj)(e.time_zone,t)})),$=(e,t,a)=>C(t,a.time_zone).format(e),C=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),S=(e,t,a)=>z(t,a.time_zone).format(e),z=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",timeZone:(0,n.wj)(e.time_zone,t)})),k=(e,t,a)=>A(t,a.time_zone).format(e),A=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",timeZone:(0,n.wj)(e.time_zone,t)})),T=(e,t,a)=>M(t,a.time_zone).format(e),M=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),E=(e,t,a)=>I(t,a.time_zone).format(e),I=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",year:"numeric",timeZone:(0,n.wj)(e.time_zone,t)})),L=(e,t,a)=>{const o=(0,n.wj)(t.time_zone,a.time_zone);return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:o}).format(e)},Z=(e,t,a,o)=>`${L(e,a,o)}/${L(t,a,o)}`;o()}catch(e){o(e)}})},95747(e,t,a){a.a(e,async function(e,o){try{a.d(t,{CL:()=>w,GH:()=>x,Rl:()=>m,ZS:()=>y,aQ:()=>u,r6:()=>c,yg:()=>b});var i=a(74487),r=a(22786),s=a(72487),n=a(30162),l=a(8480),d=a(69543),h=e([i,l,s,n]);[i,l,s,n]=h.then?(await h)():h;const c=(e,t,a)=>p(t,a.time_zone).format(e),p=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,l.wj)(e.time_zone,t)})),m=e=>g().format(e),g=(0,r.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),u=(e,t,a)=>f(t,a.time_zone).format(e),f=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,l.wj)(e.time_zone,t)})),y=(e,t,a)=>v(t,a.time_zone).format(e),v=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,l.wj)(e.time_zone,t)})),w=(e,t,a)=>(new Date).getFullYear()===e.getFullYear()?y(e,t,a):u(e,t,a),b=(e,t,a)=>_(t,a.time_zone).format(e),_=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,l.wj)(e.time_zone,t)})),x=(e,t,a)=>`${(0,s.zB)(e,t,a)}, ${(0,n.fU)(e,t,a)}`;o()}catch(e){o(e)}})},30162(e,t,a){a.a(e,async function(e,o){try{a.d(t,{LW:()=>u,Xs:()=>m,fU:()=>d,ie:()=>c});var i=a(74487),r=a(22786),s=a(8480),n=a(69543),l=e([i,s]);[i,s]=l.then?(await l)():l;const d=(e,t,a)=>h(t,a.time_zone).format(e),h=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,n.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),c=(e,t,a)=>p(t,a.time_zone).format(e),p=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:(0,n.J)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,n.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),m=(e,t,a)=>g(t,a.time_zone).format(e),g=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",hour:(0,n.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,n.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),u=(e,t,a)=>f(t,a.time_zone).format(e),f=(0,r.A)((e,t)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,s.wj)(e.time_zone,t)}));o()}catch(e){o(e)}})},8480(e,t,a){a.a(e,async function(e,o){try{a.d(t,{fL:()=>h,n2:()=>c,wj:()=>p});var i=a(74487),r=a(29079),s=a(46927),n=e([i]);i=(n.then?(await n)():n)[0];const l=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,d=l&&("UTC"===l||"Etc/UTC"===l||l in r)?l:void 0,h=14881==a.j?void 0!==d:null,c=d??"UTC",p=(e,t)=>e===s.Wj.local&&d?c:t;o()}catch(e){o(e)}})},69543(e,t,a){a.d(t,{J:()=>r});a(74423);var o=a(22786),i=a(46927);const r=(0,o.A)(e=>{if(e.time_format===i.Hg.language||e.time_format===i.Hg.system){const t=e.time_format===i.Hg.language?e.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(t).includes("10")}return e.time_format===i.Hg.am_pm})},93421(e,t,a){a.d(t,{IW:()=>h,dH:()=>d,fI:()=>l});a(44114);var o=a(35211),i=a(22792),r=a(32172);const s=(e,t)=>{let a=e;for(const e of t){if(null==a)return;a=a[e]}return a},n=(e,t,a)=>{const i=(0,r.p)({transformer:function(e){return a.call(this,e)},watch:t?[t]:[]}),s=(0,o.Fg)({context:e,subscribe:!0});return(e,t)=>{i(e,t),s(e,t)}},l=e=>n(i.iN,e.entityIdPath[0],function(t){const a=s(this,e.entityIdPath);return"string"==typeof a?t?.[a]:void 0}),d=e=>n(i.X1,e.entityIdPath[0],function(t){const a=s(this,e.entityIdPath);return"string"==typeof a?t?.[a]:void 0}),h=()=>n(i.D5,void 0,({localize:e})=>e)},32172(e,t,a){a.d(t,{p:()=>o});a(18111),a(7588),a(45367),a(92731),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);function o(e){return(t,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const o=String(a),i=t;if(i._transformers){if(!i.hasOwnProperty("_transformers")){const e=i._transformers;i._transformers=new Map,e.forEach((e,t)=>i._transformers.set(t,e))}}else{i._transformers=new Map,i._watching=new Map;const e=i.willUpdate;i.willUpdate=function(t){e.call(this,t);const a=new Set;t.forEach((e,t)=>{const o=this._watching.get(t);void 0!==o&&o.forEach(e=>a.add(e))}),a.forEach(e=>{this[e]=this[`__original_${String(e)}`]})}}i._transformers.set(a,e.transformer),e.watch&&e.watch.forEach(e=>{let t=i._watching.get(e);t||(t=new Set,i._watching.set(e,t)),t.add(a)});const r=Object.getOwnPropertyDescriptor(t,a);let s;if(void 0===r)s={get(){return this[`__transform_${o}`]},set(e){const t=this[`__transform_${o}`],a=this._transformers.get(o);this[`__transform_${o}`]=a?a.call(this,e):e,this[`__original_${o}`]=e,this.requestUpdate(o,t)},configurable:!0,enumerable:!0};else{const e=r.set;s={...r,set(t){const a=this[`__transform_${o}`],i=this._transformers.get(o);this[`__transform_${o}`]=i?i.call(this,t):t,this[`__original_${o}`]=t,this.requestUpdate(o,a),e?.call(this,t)}}}Object.defineProperty(t,a,s)}}},63130(e,t,a){a.d(t,{l:()=>i});var o=a(50248);const i=async(e,t)=>{if(navigator.clipboard)try{return void await navigator.clipboard.writeText(e)}catch{}const a=t||(0,o.n)()?.getRootNode()||document.body,i=document.createElement("textarea");i.value=e,i.setAttribute("readonly",""),i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.opacity="0",a.appendChild(i),i.select(),document.execCommand("copy"),a.removeChild(i)}},14748(e,t,a){a.d(t,{G:()=>o});const o=(e,t,a)=>{let o;const i=async()=>{try{await t(e)}finally{o=setTimeout(()=>i(),a)}};return i(),()=>clearTimeout(o)}},64481(e,t,a){a.d(t,{D:()=>i,J:()=>s});a(64979);let o=!1;try{o="true"===window.localStorage.getItem("disableViewTransition")}catch{}const i=e=>{o=e},r=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},s=e=>{if(!document.startViewTransition||o)return e(!1),Promise.resolve();let t=!1;try{const a=document.startViewTransition(()=>{t=!0,e(!0)});return a.ready.catch(r),a.finished.catch(r)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),t?Promise.reject(a):(e(!1),Promise.resolve())}}},38962(e,t,a){a.a(e,async function(e,o){try{a.r(t);var i=a(62826),r=a(5124),s=a(22441),n=a(6412),l=a(93421),d=a(1087),h=a(26300),c=(a(67094),e([h]));h=(c.then?(await c)():c)[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",m={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 r.WF{render(){return r.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="${m[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,n.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?r.qy`<div class="title">${this.title}</div>`:r.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?r.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:r.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,d.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}g.styles=r.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,i.Cg)([(0,s.MZ)()],g.prototype,"title",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"alert-type"})],g.prototype,"alertType",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],g.prototype,"dismissable",void 0),(0,i.Cg)([(0,s.wk)(),(0,l.IW)()],g.prototype,"_localize",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],g.prototype,"narrow",void 0),g=(0,i.Cg)([(0,s.EM)("ha-alert")],g),o()}catch(e){o(e)}})},13513(e,t,a){var o=a(62826),i=a(5124),r=a(22441),s=a(36240);class n extends i.WF{render(){const e=(0,s.gN)((0,s.NN)((0,s.S8)(this.value,this.min,this.max),this.min,this.max));return i.JW` <svg> <g> <rect/> <rect width="${e}%"/> </g> </svg> `}constructor(...e){super(...e),this.min=0,this.max=100}}n.styles=i.AH`rect{height:100%}rect:first-child{width:100%;fill:var(--ha-bar-background-color,var(--secondary-background-color))}rect:last-child{fill:var(--ha-bar-primary-color,var(--primary-color))}svg{border-radius:var(--ha-bar-border-radius,var(--ha-border-radius-sm));height:12px;width:100%}`,(0,o.Cg)([(0,r.MZ)({type:Number})],n.prototype,"min",void 0),(0,o.Cg)([(0,r.MZ)({type:Number})],n.prototype,"max",void 0),(0,o.Cg)([(0,r.MZ)({type:Number})],n.prototype,"value",void 0),n=(0,o.Cg)([(0,r.EM)("ha-bar")],n)},93444(e,t,a){var o=a(62826),i=a(5124),r=a(22441);class s extends i.WF{render(){return i.qy` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `}static get styles(){return[i.AH`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}}s=(0,o.Cg)([(0,r.EM)("ha-dialog-footer")],s)},76538(e,t,a){var o=a(62826),i=a(5124),r=a(22441);class s extends i.WF{render(){const e=i.qy`<div class="header-title"> <slot name="title"></slot> </div>`,t=i.qy`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`;return i.qy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${"above"===this.subtitlePosition?i.qy`${t}${e}`:i.qy`${e}${t}`} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}static get styles(){return[i.AH`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`]}constructor(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,o.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],s.prototype,"subtitlePosition",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],s.prototype,"showBorder",void 0),s=(0,o.Cg)([(0,r.EM)("ha-dialog-header")],s)},72554(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(93900),r=a(35211),s=a(5124),n=a(22441),l=a(63672),d=a(1087),h=a(64481),c=a(22792),p=a(59992),m=a(14503),g=a(22348),u=(a(76538),a(26300)),f=e([i,u]);[i,u]=f.then?(await f)():f;const y="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";class v extends((0,p.V)(s.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(e){super.updated(e),e.has("open")&&(this._open=this.open)}render(){return s.qy` <wa-dialog .open="${this._open}" .lightDismiss="${!this.preventScrimClose}" without-header aria-labelledby="${(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0))}" aria-describedby="${(0,l.J)(this.ariaDescribedBy)}" @keydown="${this._handleKeyDown}" @wa-hide="${this._handleHide}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-after-hide="${this._handleAfterHide}"> ${this.withoutHeader?s.s6:s.qy`<slot name="header"> <ha-dialog-header .subtitlePosition="${this.headerSubtitlePosition}" .showBorder="${this._bodyScrolled}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${this._i18n?.localize?.("ui.common.close")??"Close"}" .path="${y}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?s.qy`<span slot="title" class="title" id="ha-dialog-title"> ${this.headerTitle} </span>`:s.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?s.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:s.qy`<slot name="headerSubtitle" slot="subtitle"></slot>`} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${this._handleBodyScroll}"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,h.J)(()=>{this._setFullscreen(e.detail)}):this._setFullscreen(e.detail)}_setFullscreen(e){this.toggleAttribute("fullscreen",e)}_handleBodyScroll(e){this._bodyScrolled=e.target.scrollTop>0}_handleKeyDown(e){"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)}_handleHide(e){const t=e.detail?.source===e.target.dialog;this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,m.dp,s.AH`wa-dialog{--full-width:var( --ha-dialog-width-full, min(95vw, var(--safe-width)) );--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var( --ha-dialog-surface-background, var(--card-background-color, var(--ha-color-surface-default)) );--wa-panel-border-radius:var( --ha-dialog-border-radius, var(--ha-border-radius-3xl) );max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var( --ha-dialog-header-title-font-size, var(--ha-font-size-2xl) );line-height:var( --ha-dialog-header-title-line-height, var(--ha-line-height-condensed) );font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}constructor(...e){super(...e),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{if(this._hassConfig?.auth.external&&(0,g.V)(this._hassConfig.auth.external)){const e=this.querySelector("[autofocus]");return void(null!==e&&(e.id||(e.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})))}this.querySelector("[autofocus]")?.focus()}))},this._handleAfterShow=e=>{e.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,o.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],v.prototype,"ariaLabelledBy",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],v.prototype,"ariaDescribedBy",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"open",void 0),(0,o.Cg)([(0,n.MZ)({reflect:!0})],v.prototype,"type",void 0),(0,o.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],v.prototype,"width",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],v.prototype,"preventScrimClose",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"header-title"})],v.prototype,"headerTitle",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],v.prototype,"headerSubtitle",void 0),(0,o.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],v.prototype,"headerSubtitlePosition",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],v.prototype,"flexContent",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],v.prototype,"withoutHeader",void 0),(0,o.Cg)([(0,n.wk)()],v.prototype,"_open",void 0),(0,o.Cg)([(0,n.P)(".body")],v.prototype,"bodyContainer",void 0),(0,o.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.D5,subscribe:!0})],v.prototype,"_i18n",void 0),(0,o.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],v.prototype,"_hassConfig",void 0),(0,o.Cg)([(0,n.wk)()],v.prototype,"_bodyScrolled",void 0),(0,o.Cg)([(0,n.Ls)({passive:!0})],v.prototype,"_handleBodyScroll",null),v=(0,o.Cg)([(0,n.EM)("ha-dialog")],v),t()}catch(e){t(e)}})},98(e,t,a){var o=a(62826),i=a(5124),r=a(22441),s=a(6412),n=a(36240);a(13513),a(8034);class l extends i.WF{render(){const e=(0,n.gN)(this.value);return i.qy` <ha-settings-row> <span slot="heading"> ${this.heading} </span> <div slot="description" .title="${this.tooltip??""}"> <span class="value"> <div>${e} %</div> </span> <ha-bar class="${(0,s.H)({"target-warning":e>50,"target-critical":e>85})}" .value="${this.value}"></ha-bar> </div> </ha-settings-row> `}}l.styles=i.AH`ha-settings-row{padding:0;height:54px;width:100%}ha-settings-row>div[slot=description]{white-space:normal;color:var(--secondary-text-color);display:flex;justify-content:space-between}ha-bar{--ha-bar-primary-color:var(--metric-bar-ok-color, var(--success-color))}.target-warning{--ha-bar-primary-color:var( --metric-bar-warning-color, var(--warning-color) )}.target-critical{--ha-bar-primary-color:var( --metric-bar-critical-color, var(--error-color) )}.value{width:48px;padding-right:4px;padding-inline-end:4px;padding-inline-start:initial;flex-shrink:0}.value>div{direction:ltr;text-align:var(--float-start)}`,(0,o.Cg)([(0,r.MZ)({type:Number})],l.prototype,"value",void 0),(0,o.Cg)([(0,r.MZ)({type:String})],l.prototype,"heading",void 0),(0,o.Cg)([(0,r.MZ)({type:String})],l.prototype,"tooltip",void 0),l=(0,o.Cg)([(0,r.EM)("ha-metric")],l)},8034(e,t,a){var o=a(62826),i=a(92070),r=a(5124),s=a(22441);class n extends r.WF{render(){const e=this._hasSlotController.test("description");return r.qy` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" part="heading" ?two-line="${!this.threeLine&&e}" ?three-line="${this.threeLine}"> <slot name="heading"></slot> ${e?r.qy`<span class="secondary"><slot name="description"></slot></span>`:r.s6} </div> </div> <div class="content"> <slot></slot> </div> `}constructor(...e){super(...e),this.narrow=!1,this.slim=!1,this.threeLine=!1,this.wrapHeading=!1,this.empty=!1,this._hasSlotController=new i.X(this,"description")}}n.styles=r.AH`:host{display:flex;padding:0 var(--ha-space-4);align-content:normal;align-self:auto;align-items:center}.body{padding-top:var(--settings-row-body-padding-top,var(--ha-space-2));padding-bottom:var(--settings-row-body-padding-bottom,var(--ha-space-2));padding-left:0;padding-inline-start:0;padding-right:var(--ha-space-4);padding-inline-end:var(--ha-space-4);overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:88px}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:var(--ha-space-1);font-family:var( --mdc-typography-body2-font-family, var(--mdc-typography-font-family, var(--ha-font-family-body)) );font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(72px - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;min-width:0;padding:var(--settings-row-content-padding-block,var(--ha-space-4)) 0}:host([empty]) .content{display:none}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:var(--ha-space-2)}::slotted(ha-switch){padding:var(--settings-row-switch-padding-block,var(--ha-space-4)) 0}.secondary{white-space:normal}.prefix-wrap{flex:var(--settings-row-prefix-flex,1);display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`,(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],n.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],n.prototype,"slim",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"three-line"})],n.prototype,"threeLine",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"wrap-heading",reflect:!0})],n.prototype,"wrapHeading",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],n.prototype,"empty",void 0),n=(0,o.Cg)([(0,s.EM)("ha-settings-row")],n)},65829(e,t,a){a.a(e,async function(e,o){try{a.r(t),a.d(t,{HaSpinner:()=>d});var i=a(62826),r=a(55262),s=a(5124),n=a(22441),l=e([r]);r=(l.then?(await l)():l)[0];class d extends r.A{updated(e){if(super.updated(e),e.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,s.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,i.Cg)([(0,n.MZ)()],d.prototype,"size",void 0),d=(0,i.Cg)([(0,n.EM)("ha-spinner")],d),o()}catch(e){o(e)}})},47351(e,t,a){a.d(t,{PS:()=>o,Tv:()=>s,VR:()=>i,lE:()=>n});a(74423),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);const o=e=>e.data,i=e=>"object"==typeof e?"object"==typeof e.body?e.body.message||"Unknown error, see supervisor logs":e.body||e.message||"Unknown error, see supervisor logs":e,r=new Set([502,503,504]),s=e=>!!(e&&e.status_code&&r.has(e.status_code))||!(!e||!e.message||!e.message.includes("ERR_CONNECTION_CLOSED")&&!e.message.includes("ERR_CONNECTION_RESET")),n=async(e,t)=>e({type:"supervisor/api",endpoint:`/${t}/stats`,method:"get"})},6892(e,t,a){a.d(t,{q:()=>r});var o=a(62384),i=a(47351);const r=async e=>(0,o.v)(e.config.version,2021,2,4)?e.callWS({type:"supervisor/api",endpoint:"/resolution/info",method:"get"}):(0,i.PS)(await e.callApi("GET","hassio/resolution/info"))},33212(e,t,a){a.d(t,{G:()=>o});const o=(e,t)=>{let a={};const o=e.connection.subscribeMessage(e=>"initial"===e.type?(a=e.data,void t(a)):"finish"===e.type?(o.then(e=>e()),void t(void 0)):(a={...a,[e.domain]:{...a[e.domain],info:{...a[e.domain].info,[e.key]:e.success?e.data:{error:!0,value:e.error.msg}}}},void t(a)),{type:"system_health/info"});return o}},59992(e,t,a){a.d(t,{V:()=>l});var o=a(62826),i=a(88696),r=a(5124),s=a(6412),n=a(22441);const l=e=>{class t extends e{get scrollableElement(){return t.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(e){super.firstUpdated?.(e),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(e){super.updated?.(e),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(e=!1){return r.qy` <div class="${(0,s.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled})}"></div> <div class="${(0,s.H)({"fade-bottom":!0,rounded:e,visible:this._contentScrollable})}"></div> `}static get styles(){const e=Object.getPrototypeOf(this);var t;return[...void 0===(t=e?.styles??[])?[]:Array.isArray(t)?t:[t],r.AH`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`]}_attachScrollableElement(){const e=this.scrollableElement;e!==this._scrollTarget&&(this._detachScrollableElement(),e&&(this._scrollTarget=e,e.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(e),this._updateScrollableState(e)))}_detachScrollableElement(){this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),this._resize.unobserve?.(this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(e){const t=parseFloat(getComputedStyle(e).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:o=0,scrollTop:i=0}=e;this._contentScrollable=a-o>i+t+this.scrollFadeSafeAreaPadding}constructor(...e){super(...e),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=e=>{const t=e.currentTarget;this._contentScrolled=(t.scrollTop??0)>this.scrollFadeThreshold,this._updateScrollableState(t)},this._resize=new i.P(this,{target:null,callback:e=>{const t=e[0]?.target;t&&this._updateScrollableState(t)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return t.DEFAULT_SCROLLABLE_ELEMENT=null,(0,o.Cg)([(0,n.wk)()],t.prototype,"_contentScrolled",void 0),(0,o.Cg)([(0,n.wk)()],t.prototype,"_contentScrollable",void 0),t}},2814(e,t,a){a.a(e,async function(e,o){try{a.r(t),a.d(t,{UNHEALTHY_REASON_URL:()=>k,UNSUPPORTED_REASON_URL:()=>z});a(44114),a(18111),a(61701);var i=a(62826),r=a(5124),s=a(22441),n=a(36312),l=a(95747),d=a(1087),h=a(63130),c=a(14748),p=a(38962),m=a(18350),g=a(72554),u=(a(93444),a(98),a(65829)),f=a(47351),y=a(6892),v=a(95350),w=a(33212),b=a(65063),_=a(14503),x=a(36918),$=a(81619),C=e([p,m,g,u,l]);[p,m,g,u,l]=C.then?(await C)():C;const S=(e,t)=>"homeassistant"===e?-1:"homeassistant"===t?1:e<t?-1:t<e?1:0,z={},k={privileged:"/more-info/unsupported/privileged"};class A extends r.WF{showDialog(){this._open=!0,this.hass.loadBackendTranslation("system_health"),this._subscribe()}closeDialog(){this._open=!1}_dialogClosed(){this._open=!1,this._unsubscribe(),(0,d.r)(this,"dialog-closed",{dialog:this.localName})}_subscribe(){(0,n.x)(this.hass.config,"system_health")&&(this._systemHealthSubscription=(0,w.G)(this.hass,e=>{e?this._systemInfo=e:this._systemHealthSubscription=void 0})),(0,n.x)(this.hass.config,"hassio")&&(this._hassIOSubscription=(0,c.G)(this.hass,async()=>{this._supervisorStats=await(0,f.lE)(this.hass.callWS,"supervisor"),this._coreStats=await(0,f.lE)(this.hass.callWS,"core")},1e4),(0,y.q)(this.hass).then(e=>{this._resolutionInfo=e}))}_unsubscribe(){this._systemHealthSubscription?.then(e=>e()),this._systemHealthSubscription=void 0,this._hassIOSubscription?.(),this._hassIOSubscription=void 0,this._systemInfo=void 0,this._resolutionInfo=void 0,this._coreStats=void 0,this._supervisorStats=void 0}render(){if(!this._open)return r.s6;const e=this._getSections();return r.qy` <ha-dialog .open="${this._open}" header-title="${this.hass.localize("ui.panel.config.repairs.system_information")}" @closed="${this._dialogClosed}"> <div> ${this._resolutionInfo?r.qy`${this._resolutionInfo.unhealthy.length?r.qy`<ha-alert alert-type="error"> ${this.hass.localize("ui.dialogs.unhealthy.title")} <ha-button appearance="plain" size="small" variant="danger" slot="action" @click="${this._unhealthyDialog}"> ${this.hass.localize("ui.panel.config.common.learn_more")} </ha-button></ha-alert>`:""} ${this._resolutionInfo.unsupported.length?r.qy`<ha-alert alert-type="warning"> ${this.hass.localize("ui.dialogs.unsupported.title")} <ha-button appearance="plain" size="small" variant="warning" slot="action" @click="${this._unsupportedDialog}"> ${this.hass.localize("ui.panel.config.common.learn_more")} </ha-button> </ha-alert>`:""} `:""} <div>${e}</div> ${this._coreStats||this._supervisorStats?r.qy` <div> ${this._coreStats?r.qy` <h3> ${this.hass.localize("ui.panel.config.system_health.core_stats")} </h3> <ha-metric .heading="${this.hass.localize("ui.panel.config.system_health.cpu_usage")}" .value="${this._coreStats.cpu_percent}"></ha-metric> <ha-metric .heading="${this.hass.localize("ui.panel.config.system_health.ram_usage")}" .value="${this._coreStats.memory_percent}"></ha-metric> `:""} ${this._supervisorStats?r.qy` <h3> ${this.hass.localize("ui.panel.config.system_health.supervisor_stats")} </h3> <ha-metric .heading="${this.hass.localize("ui.panel.config.system_health.cpu_usage")}" .value="${this._supervisorStats.cpu_percent}"></ha-metric> <ha-metric .heading="${this.hass.localize("ui.panel.config.system_health.ram_usage")}" .value="${this._supervisorStats.memory_percent}"></ha-metric> `:""} </div> `:""} </div> <ha-dialog-footer slot="footer"> <ha-button slot="primaryAction" @click="${this._copyInfo}"> ${this.hass.localize("ui.panel.config.repairs.copy")} </ha-button> </ha-dialog-footer> </ha-dialog> `}async _unsupportedDialog(){await(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.unsupported.title"),text:r.qy`${this.hass.localize("ui.dialogs.unsupported.description")} <br><br> <ul> ${this._resolutionInfo.unsupported.map(e=>r.qy` <li> <a href="${(0,x.o)(this.hass,z[e]||`/more-info/unsupported/${e}`)}" target="_blank" rel="noreferrer"> ${this.hass.localize(`ui.dialogs.unsupported.reasons.${e}`)||e} </a> </li> `)} </ul>`})}async _unhealthyDialog(){await(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.unhealthy.title"),text:r.qy`${this.hass.localize("ui.dialogs.unhealthy.description")} <br><br> <ul> ${this._resolutionInfo.unhealthy.map(e=>r.qy` <li> <a href="${(0,x.o)(this.hass,k[e]||`/more-info/unhealthy/${e}`)}" target="_blank" rel="noreferrer"> ${this.hass.localize(`ui.dialogs.unhealthy.reasons.${e}`)||e} </a> </li> `)} </ul>`})}_getSections(){const e=[];if(this._systemInfo){const t=Object.keys(this._systemInfo).sort(S);for(const a of t){const t=this._systemInfo[a],o=[];for(const e of Object.keys(t.info)){let i;if(t.info[e]&&"object"==typeof t.info[e]){const a=t.info[e];"pending"===a.type?i=r.qy` <ha-spinner size="small"></ha-spinner> `:"failed"===a.type?i=r.qy` <span class="error">${a.error}</span>${a.more_info?r.qy` – <a href="${a.more_info}" target="_blank" rel="noreferrer noopener"> ${this.hass.localize("ui.panel.config.info.system_health.more_info")} </a> `:""} `:"date"===a.type&&(i=(0,l.r6)(new Date(a.value),this.hass.locale,this.hass.config))}else i=t.info[e];o.push(r.qy` <tr> <td> ${this.hass.localize(`component.${a}.system_health.info.${e}`)||e} </td> <td>${i}</td> </tr> `)}"homeassistant"!==a&&e.push(r.qy` <div class="card-header"> <h3>${(0,v.p$)(this.hass.localize,a)}</h3> ${t.manage_url?r.qy` <ha-button appearance="plain" size="small" class="manage" href="${t.manage_url}"> ${this.hass.localize("ui.panel.config.info.system_health.manage")} </ha-button> `:""} </div> `),e.push(r.qy` <table> ${o} </table> `)}}else e.push(r.qy` <div class="loading-container"> <ha-spinner></ha-spinner> </div> `);return e}async _copyInfo(){let e;const t=[];for(const a of Object.keys(this._systemInfo).sort(S)){const o=this._systemInfo[a];let i=!0;const r=[""+("homeassistant"!==a?`<details><summary>${(0,v.p$)(this.hass.localize,a)}</summary>\n`:"")];for(const e of Object.keys(o.info)){let t;if(o.info[e]&&"object"==typeof o.info[e]){const a=o.info[e];"pending"===a.type?t="pending":"failed"===a.type?t=`failed to load: ${a.error}`:"date"===a.type&&(t=(0,l.r6)(new Date(a.value),this.hass.locale,this.hass.config))}else t=o.info[e];i?(r.push(`${e} | ${t}\n-- | --`),i=!1):r.push(`${e} | ${t}`)}"homeassistant"===a?e=r.join("\n"):(t.push(r.join("\n")),"homeassistant"!==a&&t.push("</details>"))}await(0,h.l)(`## System Information\n${e}\n\n${t.join("\n\n")}`),(0,$.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")})}constructor(...e){super(...e),this._open=!1}}A.styles=[_.nA,r.AH`ha-alert{margin-bottom:16px;display:block}table{width:100%}td:first-child{width:45%}td:last-child{direction:ltr}.loading-container{display:flex;align-items:center;justify-content:center}.card-header{justify-content:space-between;display:flex;align-items:center}.error{color:var(--error-color)}`],(0,i.Cg)([(0,s.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,i.Cg)([(0,s.wk)()],A.prototype,"_systemInfo",void 0),(0,i.Cg)([(0,s.wk)()],A.prototype,"_resolutionInfo",void 0),(0,i.Cg)([(0,s.wk)()],A.prototype,"_supervisorStats",void 0),(0,i.Cg)([(0,s.wk)()],A.prototype,"_coreStats",void 0),(0,i.Cg)([(0,s.wk)()],A.prototype,"_open",void 0),A=(0,i.Cg)([(0,s.EM)("dialog-system-information")],A),o()}catch(e){o(e)}})},36240(e,t,a){a.d(t,{NN:()=>i,S8:()=>o,gN:()=>r});const o=(e,t,a)=>isNaN(e)||isNaN(t)||isNaN(a)?0:e>a?a:e<t?t:e,i=(e,t,a)=>100*(e-t)/(a-t),r=e=>Math.round(10*e)/10},36918(e,t,a){a.d(t,{o:()=>o});const o=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},22348(e,t,a){a.d(t,{V:()=>i});var o=a(37177);const i=e=>!!e&&o.n},37177(e,t,a){a.d(t,{n:()=>o});const o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}};