"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["79062"],{54197:function(e,a,t){t.a(e,async function(e,r){try{t.r(a),t.d(a,{HuiEnergyGraphCardEditor:function(){return _}});t(62953);var n=t(40445),i=t(96196),s=t(77845),o=t(63533),c=t(22786),l=t(1087),u=t(52763),h=t(84698),g=e([u]);u=(g.then?(await g)():g)[0];let d,p=e=>e;const y=(0,o.kp)(h.H,(0,o.Ik)({type:(0,o.KC)([(0,o.eu)("energy-carbon-consumed-gauge"),(0,o.eu)("energy-compare"),(0,o.eu)("energy-distribution"),(0,o.eu)("energy-gas-graph"),(0,o.eu)("energy-grid-neutrality-gauge"),(0,o.eu)("energy-self-sufficiency-gauge"),(0,o.eu)("energy-solar-consumed-gauge"),(0,o.eu)("energy-solar-graph"),(0,o.eu)("energy-usage-graph"),(0,o.eu)("energy-water-graph"),(0,o.eu)("power-sources-graph")]),title:(0,o.lq)((0,o.Yj)()),collection_key:(0,o.lq)((0,o.Yj)()),show_legend:(0,o.lq)((0,o.zM)()),link_dashboard:(0,o.lq)((0,o.zM)())}));class _ extends i.WF{setConfig(e){(0,o.vA)(e,y),this._config=e}render(){if(!this.hass||!this._config)return i.s6;const e=this._schema(this._config.type),a=Object.assign({},this._config);return(0,i.qy)(d||(d=p` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form>`),this.hass,a,e,this._computeLabelCallback,this._computeHelperCallback,this._valueChanged)}_valueChanged(e){(0,l.r)(this,"config-changed",{config:e.detail.value})}constructor(...e){super(...e),this._schema=(0,c.A)(e=>[..."energy-compare"!==e?[{name:"title",selector:{text:{}}}]:[],..."power-sources-graph"===e?[{name:"show_legend",required:!1,selector:{boolean:{}}}]:[],..."energy-distribution"===e?[{name:"link_dashboard",required:!1,selector:{boolean:{}}}]:[],{type:"string",name:"collection_key",required:!1}]),this._computeHelperCallback=e=>{if("collection_key"===e.name)return this.hass.localize("ui.panel.lovelace.editor.card.generic.collection_key_description")},this._computeLabelCallback=e=>{switch(e.name){case"link_dashboard":return this.hass.localize(`ui.panel.lovelace.editor.card.energy-distribution.${e.name}`);case"show_legend":return this.hass.localize(`ui.panel.lovelace.editor.card.power-sources-graph.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}}(0,n.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,n.Cg)([(0,s.wk)()],_.prototype,"_config",void 0),_=(0,n.Cg)([(0,s.EM)("hui-energy-graph-card-editor")],_),r()}catch(d){r(d)}})},84698:function(e,a,t){t.d(a,{H:function(){return n}});var r=t(63533);const n=(0,r.Ik)({type:(0,r.Yj)(),view_layout:(0,r.bz)(),layout_options:(0,r.bz)(),grid_options:(0,r.bz)(),visibility:(0,r.bz)(),disabled:(0,r.lq)((0,r.zM)())})}}]);
//# sourceMappingURL=79062.1de0ba8c081a3546.js.map