Files
haos_config/custom_components/hacs/hacs_frontend/frontend_latest/6356.b594bbddcd4f4e11.js
2026-01-30 23:31:00 -06:00

3 lines
17 KiB
JavaScript

/*! For license information please see 6356.b594bbddcd4f4e11.js.LICENSE.txt */
export const ids=["6356"];export const modules={13766:function(t,i,e){e.a(t,(async function(t,i){try{var s=e(44249),a=(e(92745),e(39527),e(99790),e(41360),e(87319),e(57243)),n=e(50778),r=e(27486),d=e(24785),c=e(11297),o=e(32770),l=e(76500),u=e(26205),h=(e(69484),e(10508),e(21881)),p=e(59848),v=t([h]);h=(v.then?(await v)():v)[0];(0,s.Z)([(0,n.Mo)("ha-statistic-picker")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"statistic-types"})],key:"statisticTypes",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"allow-custom-entity"})],key:"allowCustomEntity",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1,type:Array})],key:"statisticIds",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"include-statistics-unit-of-measurement"})],key:"includeStatisticsUnitOfMeasurement",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-unit-class"})],key:"includeUnitClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-device-class"})],key:"includeDeviceClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"entities-only"})],key:"entitiesOnly",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"exclude-statistics"})],key:"excludeStatistics",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"helpMissingEntityUrl",value:()=>"/more-info/statistics/"},{kind:"field",decorators:[(0,n.SB)()],key:"_opened",value:void 0},{kind:"field",decorators:[(0,n.IO)("ha-combo-box",!0)],key:"comboBox",value:void 0},{kind:"field",key:"_init",value:()=>!1},{kind:"field",key:"_statistics",value:()=>[]},{kind:"field",decorators:[(0,n.SB)()],key:"_filteredItems",value(){}},{kind:"field",key:"_rowRenderer",value(){return t=>a.dy`<mwc-list-item graphic="avatar" twoline> ${t.state?a.dy`<state-badge slot="graphic" .stateObj="${t.state}" .hass="${this.hass}"></state-badge>`:""} <span>${t.name}</span> <span slot="secondary">${""===t.id||"__missing"===t.id?a.dy`<a target="_blank" rel="noopener noreferrer" href="${(0,u.R)(this.hass,this.helpMissingEntityUrl)}">${this.hass.localize("ui.components.statistic-picker.learn_more")}</a>`:t.id}</span> </mwc-list-item>`}},{kind:"field",key:"_getStatistics",value(){return(0,r.Z)(((t,i,e,s,a,n,r)=>{if(!t.length)return[{id:"",name:this.hass.localize("ui.components.statistic-picker.no_statistics"),strings:[]}];if(i){const e=(0,d.r)(i);t=t.filter((t=>e.includes(t.statistics_unit_of_measurement)))}if(e){const i=(0,d.r)(e);t=t.filter((t=>i.includes(t.unit_class)))}if(s){const i=(0,d.r)(s);t=t.filter((t=>{const e=this.hass.states[t.statistic_id];return!e||i.includes(e.attributes.device_class||"")}))}const c=[];return t.forEach((t=>{if(n&&t.statistic_id!==r&&n.includes(t.statistic_id))return;const i=this.hass.states[t.statistic_id];if(!i){if(!a){const i=t.statistic_id,e=(0,l.Kd)(this.hass,t.statistic_id,t);c.push({id:i,name:e,strings:[i,e]})}return}const e=t.statistic_id,s=(0,l.Kd)(this.hass,t.statistic_id,t);c.push({id:e,name:s,state:i,strings:[e,s]})})),c.length?(c.length>1&&c.sort(((t,i)=>(0,o.$)(t.name||"",i.name||"",this.hass.locale.language))),c.push({id:"__missing",name:this.hass.localize("ui.components.statistic-picker.missing_entity"),strings:[]}),c):[{id:"",name:this.hass.localize("ui.components.statistic-picker.no_match"),strings:[]}]}))}},{kind:"method",key:"open",value:function(){this.comboBox?.open()}},{kind:"method",key:"focus",value:function(){this.comboBox?.focus()}},{kind:"method",key:"willUpdate",value:function(t){(!this.hasUpdated&&!this.statisticIds||t.has("statisticTypes"))&&this._getStatisticIds(),(!this._init&&this.statisticIds||t.has("_opened")&&this._opened)&&(this._init=!0,this.hasUpdated?this._statistics=this._getStatistics(this.statisticIds,this.includeStatisticsUnitOfMeasurement,this.includeUnitClass,this.includeDeviceClass,this.entitiesOnly,this.excludeStatistics,this.value):this.updateComplete.then((()=>{this._statistics=this._getStatistics(this.statisticIds,this.includeStatisticsUnitOfMeasurement,this.includeUnitClass,this.includeDeviceClass,this.entitiesOnly,this.excludeStatistics,this.value)})))}},{kind:"method",key:"render",value:function(){return 0===this._statistics.length?a.Ld:a.dy` <ha-combo-box .hass="${this.hass}" .label="${void 0===this.label&&this.hass?this.hass.localize("ui.components.statistic-picker.statistic"):this.label}" .value="${this._value}" .renderer="${this._rowRenderer}" .disabled="${this.disabled}" .allowCustomValue="${this.allowCustomEntity}" .items="${this._statistics}" .filteredItems="${this._filteredItems??this._statistics}" item-value-path="id" item-id-path="id" item-label-path="name" @opened-changed="${this._openedChanged}" @value-changed="${this._statisticChanged}" @filter-changed="${this._filterChanged}"></ha-combo-box> `}},{kind:"method",key:"_getStatisticIds",value:async function(){this.statisticIds=await(0,l.uR)(this.hass,this.statisticTypes)}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_statisticChanged",value:function(t){t.stopPropagation();let i=t.detail.value;"__missing"===i&&(i=""),i!==this._value&&this._setValue(i)}},{kind:"method",key:"_openedChanged",value:function(t){this._opened=t.detail.value}},{kind:"method",key:"_filterChanged",value:function(t){const i=t.detail.value.toLowerCase();this._filteredItems=i.length?(0,p.q)(i,this._statistics):void 0}},{kind:"method",key:"_setValue",value:function(t){this.value=t,setTimeout((()=>{(0,c.B)(this,"value-changed",{value:t}),(0,c.B)(this,"change")}),0)}}]}}),a.oi);i()}catch(t){i(t)}}))},58749:function(t,i,e){e.a(t,(async function(t,i){try{var s=e(44249),a=(e(39527),e(99790),e(13334),e(57243)),n=e(50778),r=e(91583),d=e(11297),c=e(13766),o=t([c]);c=(o.then?(await o)():o)[0];(0,s.Z)([(0,n.Mo)("ha-statistics-picker")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Array})],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1,type:Array})],key:"statisticIds",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"statistic-types"})],key:"statisticTypes",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"picked-statistic-label"})],key:"pickedStatisticLabel",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"pick-statistic-label"})],key:"pickStatisticLabel",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"allow-custom-entity"})],key:"allowCustomEntity",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-statistics-unit-of-measurement"})],key:"includeStatisticsUnitOfMeasurement",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-unit-class"})],key:"includeUnitClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-device-class"})],key:"includeDeviceClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"ignore-restrictions-on-first-statistic"})],key:"ignoreRestrictionsOnFirstStatistic",value:()=>!1},{kind:"method",key:"render",value:function(){if(!this.hass)return a.Ld;const t=this.ignoreRestrictionsOnFirstStatistic&&this._currentStatistics.length<=1,i=t?void 0:this.includeStatisticsUnitOfMeasurement,e=t?void 0:this.includeUnitClass,s=t?void 0:this.includeDeviceClass,n=t?void 0:this.statisticTypes;return a.dy` ${(0,r.r)(this._currentStatistics,(t=>t),(t=>a.dy` <div> <ha-statistic-picker .curValue="${t}" .hass="${this.hass}" .includeStatisticsUnitOfMeasurement="${i}" .includeUnitClass="${e}" .includeDeviceClass="${s}" .value="${t}" .statisticTypes="${n}" .statisticIds="${this.statisticIds}" .label="${this.pickedStatisticLabel}" .excludeStatistics="${this.value}" .allowCustomEntity="${this.allowCustomEntity}" @value-changed="${this._statisticChanged}"></ha-statistic-picker> </div> `))} <div> <ha-statistic-picker .hass="${this.hass}" .includeStatisticsUnitOfMeasurement="${this.includeStatisticsUnitOfMeasurement}" .includeUnitClass="${this.includeUnitClass}" .includeDeviceClass="${this.includeDeviceClass}" .statisticTypes="${this.statisticTypes}" .statisticIds="${this.statisticIds}" .label="${this.pickStatisticLabel}" .excludeStatistics="${this.value}" .allowCustomEntity="${this.allowCustomEntity}" @value-changed="${this._addStatistic}"></ha-statistic-picker> </div> `}},{kind:"get",key:"_currentStatistics",value:function(){return this.value||[]}},{kind:"method",key:"_updateStatistics",value:async function(t){this.value=t,(0,d.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_statisticChanged",value:function(t){t.stopPropagation();const i=t.currentTarget.curValue,e=t.detail.value;if(e===i)return;const s=this._currentStatistics;e&&!s.includes(e)?this._updateStatistics(s.map((t=>t===i?e:t))):this._updateStatistics(s.filter((t=>t!==i)))}},{kind:"method",key:"_addStatistic",value:async function(t){t.stopPropagation();const i=t.detail.value;if(!i)return;if(t.currentTarget.value="",!i)return;const e=this._currentStatistics;e.includes(i)||this._updateStatistics([...e,i])}},{kind:"get",static:!0,key:"styles",value:function(){return a.iv`:host{width:200px;display:block}ha-statistic-picker{display:block;width:100%;margin-top:8px}`}}]}}),a.oi);i()}catch(t){i(t)}}))},74064:function(t,i,e){var s=e(44249),a=e(72621),n=e(65703),r=e(46289),d=e(57243),c=e(50778);(0,s.Z)([(0,c.Mo)("ha-list-item")],(function(t,i){class e extends i{constructor(...i){super(...i),t(this)}}return{F:e,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,a.Z)(e,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[r.W,d.iv`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?d.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:d.iv``]}}]}}),n.K)},76422:function(t,i,e){e.a(t,(async function(t,s){try{e.r(i),e.d(i,{HaStatisticSelector:function(){return o}});var a=e(44249),n=e(57243),r=e(50778),d=e(58749),c=t([d]);d=(c.then?(await c)():c)[0];let o=(0,a.Z)([(0,r.Mo)("ha-selector-statistic")],(function(t,i){return{F:class extends i{constructor(...i){super(...i),t(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){return this.selector.statistic.multiple?n.dy` ${this.label?n.dy`<label>${this.label}</label>`:""} <ha-statistics-picker .hass="${this.hass}" .value="${this.value}" .helper="${this.helper}" .disabled="${this.disabled}" .required="${this.required}"></ha-statistics-picker> `:n.dy`<ha-statistic-picker .hass="${this.hass}" .value="${this.value}" .label="${this.label}" .helper="${this.helper}" .disabled="${this.disabled}" .required="${this.required}" allow-custom-entity></ha-statistic-picker>`}}]}}),n.oi);s()}catch(t){s(t)}}))},41946:function(t,i,e){e.d(i,{iI:function(){return a},oT:function(){return s}});e(13334);const s=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}})),a=(t,i)=>t.callWS({type:"auth/sign_path",path:i})},36719:function(t,i,e){e.d(i,{ON:function(){return r},PX:function(){return d},V_:function(){return c},lz:function(){return n},nZ:function(){return a},rk:function(){return l}});var s=e(95907);const a="unavailable",n="unknown",r="on",d="off",c=[a,n],o=[a,n,d],l=(0,s.z)(c);(0,s.z)(o)},76500:function(t,i,e){e.d(i,{Kd:function(){return n},uR:function(){return a}});e(39527),e(36993);var s=e(73525);const a=(t,i)=>t.callWS({type:"recorder/list_statistic_ids",statistic_type:i}),n=(t,i,e)=>{const a=t.states[i];return a?(0,s.C)(a):e?.name||i}},26205:function(t,i,e){e.d(i,{R:function(){return s}});const s=(t,i)=>`https://${t.config.version.includes("b")?"rc":t.config.version.includes("dev")?"next":"www"}.home-assistant.io${i}`},87319:function(t,i,e){var s=e(9065),a=e(50778),n=e(65703),r=e(46289);let d=class extends n.K{};d.styles=[r.W],d=(0,s.gn)([(0,a.Mo)("mwc-list-item")],d)},91583:function(t,i,e){e.d(i,{r:()=>d});var s=e("2841"),a=e("45779"),n=e("53232");const r=(t,i,e)=>{const s=new Map;for(let a=i;a<=e;a++)s.set(t[a],a);return s},d=(0,a.XM)(class extends a.Xe{constructor(t){if(super(t),t.type!==a.pX.CHILD)throw Error("repeat() can only be used in text expressions")}ct(t,i,e){let s;void 0===e?e=i:void 0!==i&&(s=i);const a=[],n=[];let r=0;for(const i of t)a[r]=s?s(i,r):r,n[r]=e(i,r),r++;return{values:n,keys:a}}render(t,i,e){return this.ct(t,i,e).values}update(t,[i,e,a]){var d;const c=(0,n.i9)(t),{values:o,keys:l}=this.ct(i,e,a);if(!Array.isArray(c))return this.ut=l,o;const u=null!==(d=this.ut)&&void 0!==d?d:this.ut=[],h=[];let p,v,f=0,m=c.length-1,y=0,k=o.length-1;for(;f<=m&&y<=k;)if(null===c[f])f++;else if(null===c[m])m--;else if(u[f]===l[y])h[y]=(0,n.fk)(c[f],o[y]),f++,y++;else if(u[m]===l[k])h[k]=(0,n.fk)(c[m],o[k]),m--,k--;else if(u[f]===l[k])h[k]=(0,n.fk)(c[f],o[k]),(0,n._Y)(t,h[k+1],c[f]),f++,k--;else if(u[m]===l[y])h[y]=(0,n.fk)(c[m],o[y]),(0,n._Y)(t,c[f],c[m]),m--,y++;else if(void 0===p&&(p=r(l,y,k),v=r(u,f,m)),p.has(u[f]))if(p.has(u[m])){const i=v.get(l[y]),e=void 0!==i?c[i]:null;if(null===e){const i=(0,n._Y)(t,c[f]);(0,n.fk)(i,o[y]),h[y]=i}else h[y]=(0,n.fk)(e,o[y]),(0,n._Y)(t,c[f],e),c[i]=null;y++}else(0,n.ws)(c[m]),m--;else(0,n.ws)(c[f]),f++;for(;y<=k;){const i=(0,n._Y)(t,h[k+1]);(0,n.fk)(i,o[y]),h[y++]=i}for(;f<=m;){const t=c[f++];null!==t&&(0,n.ws)(t)}return this.ut=l,(0,n.hl)(t,h),s.Jb}})},94571:function(t,i,e){e.d(i,{C:()=>h});e("39527"),e("67670");var s=e("2841"),a=e("53232"),n=e("1714");class r{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class d{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){var t;null!==(t=this.Y)&&void 0!==t||(this.Y=new Promise((t=>this.Z=t)))}resume(){var t;null===(t=this.Z)||void 0===t||t.call(this),this.Y=this.Z=void 0}}var c=e("45779");const o=t=>!(0,a.pt)(t)&&"function"==typeof t.then,l=1073741823;class u extends n.sR{constructor(){super(...arguments),this._$C_t=l,this._$Cwt=[],this._$Cq=new r(this),this._$CK=new d}render(...t){var i;return null!==(i=t.find((t=>!o(t))))&&void 0!==i?i:s.Jb}update(t,i){const e=this._$Cwt;let a=e.length;this._$Cwt=i;const n=this._$Cq,r=this._$CK;this.isConnected||this.disconnected();for(let t=0;t<i.length&&!(t>this._$C_t);t++){const s=i[t];if(!o(s))return this._$C_t=t,s;t<a&&s===e[t]||(this._$C_t=l,a=0,Promise.resolve(s).then((async t=>{for(;r.get();)await r.get();const i=n.deref();if(void 0!==i){const e=i._$Cwt.indexOf(s);e>-1&&e<i._$C_t&&(i._$C_t=e,i.setValue(t))}})))}return s.Jb}disconnected(){this._$Cq.disconnect(),this._$CK.pause()}reconnected(){this._$Cq.reconnect(this),this._$CK.resume()}}const h=(0,c.XM)(u)}};
//# sourceMappingURL=6356.b594bbddcd4f4e11.js.map