"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["33194"],{61844:function(t,s,e){e.a(t,async function(t,i){try{e.r(s),e.d(s,{HuiWaterTotalBadge:function(){return _}});e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698),e(62953);var a=e(40445),n=e(96196),o=e(77845),r=(e(24671),e(67094),e(20058)),h=e(38114),c=e(54706),u=t([h,r]);[h,r]=u.then?(await u)():u;let l,d,f=t=>t;const g="M12,20A6,6 0 0,1 6,14C6,10 12,3.25 12,3.25C12,3.25 18,10 18,14A6,6 0 0,1 12,20Z";class _ extends((0,c.E)(n.WF)){setConfig(t){this._config=t}hassSubscribe(){var t;return[(0,h.tb)(this.hass,{key:null===(t=this._config)||void 0===t?void 0:t.collection_key}).subscribe(t=>{this._data=t})]}shouldUpdate(t){if(t.has("_config")||t.has("_data"))return!0;if(t.has("hass")){const e=t.get("hass");if(!e||!this._entities.size)return!0;for(const t of this._entities){var s;if(e.states[t]!==(null===(s=this.hass)||void 0===s?void 0:s.states[t]))return!0}}return!1}render(){if(!this._config||!this._data)return n.s6;const{value:t,unit:s}=(0,h.mn)("water",this._data.prefs,this.hass.states,this._entities),e=`${(0,r.ZV)(t,this.hass.locale,{maximumFractionDigits:1})} ${s}`,i=this._config.title||this.hass.localize("ui.panel.lovelace.cards.energy.water_total_title");return(0,n.qy)(l||(l=f` <ha-badge .label="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-badge> `),i,g,e)}constructor(...t){super(...t),this._entities=new Set,this.hassSubscribeRequiredHostProps=["_config"]}}_.styles=(0,n.AH)(d||(d=f`ha-badge{--badge-color:var(--energy-water-color)}`)),(0,a.Cg)([(0,o.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,a.Cg)([(0,o.wk)()],_.prototype,"_config",void 0),(0,a.Cg)([(0,o.wk)()],_.prototype,"_data",void 0),_=(0,a.Cg)([(0,o.EM)("hui-water-total-badge")],_),i()}catch(l){i(l)}})},56434:function(t,s,e){e.d(s,{e:function(){return a}});var i=e(81977);function a(t,s,e){return(0,i.P)(t,12*s,e)}}}]);
//# sourceMappingURL=33194.997ad2616dd4951d.js.map