/*! For license information please see JWzNYj_L.js.LICENSE.txt */
export const id=8709;export const ids=[8709];export const modules={2872:(t,e,i)=>{i.d(e,{x:()=>s});const s=(t,e)=>t&&t.config.components.includes(e)},4656:(t,e,i)=>{i.d(e,{v:()=>s});const s=(t,e,i,s)=>{const[n,r,a]=t.split(".",3);return Number(n)>e||Number(n)===e&&(void 0===s?Number(r)>=i:Number(r)>i)||void 0!==s&&Number(n)===e&&Number(r)===i&&Number(a)>=s}},8709:(t,e,i)=>{i.r(e),i.d(e,{HaIconSelector:()=>d});var s=i(5461),n=i(8597),r=i(196),a=i(6625),o=i(3167),c=i(4538);i(5063);let d=(0,s.A)([(0,r.EM)("ha-selector-icon")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,r.MZ)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.MZ)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,r.MZ)()],key:"value",value:void 0},{kind:"field",decorators:[(0,r.MZ)()],key:"label",value:void 0},{kind:"field",decorators:[(0,r.MZ)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,r.MZ)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,r.MZ)({type:Boolean})],key:"required",value(){return!0}},{kind:"field",decorators:[(0,r.MZ)({attribute:!1})],key:"context",value:void 0},{kind:"method",key:"render",value:function(){const t=this.context?.icon_entity,e=t?this.hass.states[t]:void 0,i=this.selector.icon?.placeholder||e?.attributes.icon||e&&(0,a.T)((0,c.fq)(this.hass,e));return n.qy`
      <ha-icon-picker
        .hass=${this.hass}
        .label=${this.label}
        .value=${this.value}
        .required=${this.required}
        .disabled=${this.disabled}
        .helper=${this.helper}
        .placeholder=${this.selector.icon?.placeholder??i}
        @value-changed=${this._valueChanged}
      >
        ${!i&&e?n.qy`
              <ha-state-icon
                slot="fallback"
                .hass=${this.hass}
                .stateObj=${e}
              ></ha-state-icon>
            `:n.s6}
      </ha-icon-picker>
    `}},{kind:"method",key:"_valueChanged",value:function(t){(0,o.r)(this,"value-changed",{value:t.detail.value})}}]}}),n.WF)},5063:(t,e,i)=>{var s=i(5461),n=i(8597),r=i(196),a=i(6625),o=i(3758),c=i(85),d=i(4538);i(9222);(0,s.A)([(0,r.EM)("ha-state-icon")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,r.MZ)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.MZ)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,r.MZ)({attribute:!1})],key:"stateValue",value:void 0},{kind:"field",decorators:[(0,r.MZ)()],key:"icon",value:void 0},{kind:"method",key:"render",value:function(){const t=this.icon||this.stateObj&&this.hass?.entities[this.stateObj.entity_id]?.icon||this.stateObj?.attributes.icon;if(t)return n.qy`<ha-icon .icon=${t}></ha-icon>`;if(!this.stateObj)return n.s6;if(!this.hass)return this._renderFallback();const e=(0,d.fq)(this.hass,this.stateObj,this.stateValue).then((t=>t?n.qy`<ha-icon .icon=${t}></ha-icon>`:this._renderFallback()));return n.qy`${(0,a.T)(e)}`}},{kind:"method",key:"_renderFallback",value:function(){const t=(0,c.t)(this.stateObj);return n.qy`
      <ha-svg-icon
        .path=${o.n_[t]||o.lW}
      ></ha-svg-icon>
    `}}]}}),n.WF)},4538:(t,e,i)=>{i.d(e,{_4:()=>$,fq:()=>_,Yd:()=>f,f$:()=>g,Yw:()=>k});var s=i(9263),n=i(9782),r=i(85),a=i(2503);const o={10:"mdi:battery-10",20:"mdi:battery-20",30:"mdi:battery-30",40:"mdi:battery-40",50:"mdi:battery-50",60:"mdi:battery-60",70:"mdi:battery-70",80:"mdi:battery-80",90:"mdi:battery-90",100:"mdi:battery"},c={10:"mdi:battery-charging-10",20:"mdi:battery-charging-20",30:"mdi:battery-charging-30",40:"mdi:battery-charging-40",50:"mdi:battery-charging-50",60:"mdi:battery-charging-60",70:"mdi:battery-charging-70",80:"mdi:battery-charging-80",90:"mdi:battery-charging-90",100:"mdi:battery-charging"},d=(t,e)=>{const i=Number(t);if(isNaN(i))return"off"===t?"mdi:battery":"on"===t?"mdi:battery-alert":"mdi:battery-unknown";const s=10*Math.round(i/10);return e&&i>=10?c[s]:e?"mdi:battery-charging-outline":i<=5?"mdi:battery-alert-variant-outline":o[s]},u=(t,e)=>{const i=(0,r.t)(t),s=e??t.state,n=t.attributes.device_class;switch(i){case"update":return((t,e)=>"on"===(e??t.state)?(0,a.Jy)(t)?"mdi:package-down":"mdi:package-up":"mdi:package")(t,s);case"sensor":if("battery"===n)return((t,e)=>{const i=e??t.state;return d(i)})(t,s);break;case"device_tracker":return((t,e)=>{const i=e??t.state;return"router"===t?.attributes.source_type?"home"===i?"mdi:lan-connect":"mdi:lan-disconnect":["bluetooth","bluetooth_le"].includes(t?.attributes.source_type)?"home"===i?"mdi:bluetooth-connect":"mdi:bluetooth":"not_home"===i?"mdi:account-arrow-right":"mdi:account"})(t,s);case"sun":return"above_horizon"===s?"mdi:white-balance-sunny":"mdi:weather-night";case"input_datetime":if(!t.attributes.has_date)return"mdi:clock";if(!t.attributes.has_time)return"mdi:calendar"}};var l=i(2872),h=i(4656);const y={entity:{},entity_component:{},services:{domains:{}}},m=async(t,e,i)=>t.callWS({type:"frontend/get_icons",category:e,integration:i}),v=async(t,e,i=!1)=>{if(!i&&e in y.entity)return y.entity[e];if(!(0,l.x)(t,e)||!(0,h.v)(t.connection.haVersion,2024,2))return;const s=m(t,"entity",e).then((t=>t?.resources[e]));return y.entity[e]=s,y.entity[e]},b=async(t,e,i=!1)=>!i&&y.entity_component.resources&&y.entity_component.domains?.includes(e)?y.entity_component.resources.then((t=>t[e])):(0,l.x)(t,e)?(y.entity_component.domains=[...t.config.components],y.entity_component.resources=m(t,"entity_component").then((t=>t.resources)),y.entity_component.resources.then((t=>t[e]))):void 0,f=async(t,e,i=!1)=>{if(!e)return!i&&y.services.all||(y.services.all=m(t,"services",e).then((t=>(y.services.domains=t.resources,t?.resources)))),y.services.all;if(!i&&e in y.services.domains)return y.services.domains[e];if(y.services.all&&!i&&(await y.services.all,e in y.services.domains))return y.services.domains[e];if(!(0,l.x)(t,e))return;const s=m(t,"services",e);return y.services.domains[e]=s.then((t=>t?.resources[e])),y.services.domains[e]},_=async(t,e,i)=>{const s=t.entities?.[e.entity_id];if(s?.icon)return s.icon;const n=(0,r.t)(e);return p(t,n,e,i,s)},p=async(t,e,i,s,n)=>{const r=n?.platform,a=n?.translation_key,o=i?.attributes.device_class,c=s??i?.state;let d;if(a&&r){const i=await v(t,r);if(i){const t=i[e]?.[a];d=c&&t?.state?.[c]||t?.default}}if(!d&&i&&(d=u(i,c)),!d){const i=await b(t,e);if(i){const t=o&&i[o]||i._;d=c&&t?.state?.[c]||t?.default}}return d},g=async(t,e)=>{let i;const r=(0,s.m)(e),a=(0,n.Y)(e),o=await f(t,r);if(o){const t=o[a];i=t?.service}return i||(i=await $(t,r)),i},k=async(t,e,i)=>{const r=(0,s.m)(e),a=(0,n.Y)(e),o=await f(t,r);if(o){const t=o[a];return t?.sections?.[i]}},$=async(t,e,i)=>{const s=await b(t,e);if(s){const t=i&&s[i]||s._;return t?.default}}},2503:(t,e,i)=>{i.d(e,{A_:()=>a,Jy:()=>r});i(3758);var s=i(222);i(6412);let n=function(t){return t[t.INSTALL=1]="INSTALL",t[t.SPECIFIC_VERSION=2]="SPECIFIC_VERSION",t[t.PROGRESS=4]="PROGRESS",t[t.BACKUP=8]="BACKUP",t[t.RELEASE_NOTES=16]="RELEASE_NOTES",t}({});const r=t=>(t=>(0,s.$)(t,n.PROGRESS)&&"number"==typeof t.attributes.in_progress)(t)||!!t.attributes.in_progress,a=(t,e)=>{const i=t.state,a=t.attributes;if("off"===i){return a.latest_version&&a.skipped_version===a.latest_version?a.latest_version:e.formatEntityState(t)}if("on"===i&&r(t)){return(0,s.$)(t,n.PROGRESS)&&"number"==typeof a.in_progress?e.localize("ui.card.update.installing_with_progress",{progress:a.in_progress}):e.localize("ui.card.update.installing")}return e.formatEntityState(t)}},6625:(t,e,i)=>{i.d(e,{T:()=>h});var s=i(4078),n=i(3982),r=i(3267);class a{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class o{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=i(2154);const d=t=>!(0,n.sO)(t)&&"function"==typeof t.then,u=1073741823;class l extends r.Kq{constructor(){super(...arguments),this._$C_t=u,this._$Cwt=[],this._$Cq=new a(this),this._$CK=new o}render(...t){var e;return null!==(e=t.find((t=>!d(t))))&&void 0!==e?e:s.c0}update(t,e){const i=this._$Cwt;let n=i.length;this._$Cwt=e;const r=this._$Cq,a=this._$CK;this.isConnected||this.disconnected();for(let s=0;s<e.length&&!(s>this._$C_t);s++){const t=e[s];if(!d(t))return this._$C_t=s,t;s<n&&t===i[s]||(this._$C_t=u,n=0,Promise.resolve(t).then((async e=>{for(;a.get();)await a.get();const i=r.deref();if(void 0!==i){const s=i._$Cwt.indexOf(t);s>-1&&s<i._$C_t&&(i._$C_t=s,i.setValue(e))}})))}return s.c0}disconnected(){this._$Cq.disconnect(),this._$CK.pause()}reconnected(){this._$Cq.reconnect(this),this._$CK.resume()}}const h=(0,c.u$)(l)}};
//# sourceMappingURL=JWzNYj_L.js.map