"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["61242"],{45217:function(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HuiThermostatCardEditor:function(){return w}});a(62953);var s=a(40445),n=a(96196),o=a(77845),r=a(22786),c=a(63533),h=a(1087),l=a(71727),u=(a(11382),a(52763)),d=(a(67094),a(84698)),f=a(44155),m=a(7382),g=a(16161),_=e([u,g]);[u,g]=_.then?(await _)():_;let p,y,b=e=>e;const v="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3M7 7H9V9H7V7M7 11H9V13H7V11M7 15H9V17H7V15M17 17H11V15H17V17M17 13H11V11H17V13M17 9H11V7H17V9Z",C={climate:["climate-hvac-modes","climate-preset-modes","climate-fan-modes","climate-swing-modes","climate-swing-horizontal-modes"],water_heater:["water-heater-operation-modes"]},H=(0,c.kp)(d.H,(0,c.Ik)({entity:(0,c.lq)((0,c.Yj)()),name:(0,c.lq)(f.q),theme:(0,c.lq)((0,c.Yj)()),show_current_as_primary:(0,c.lq)((0,c.zM)()),features:(0,c.lq)((0,c.YO)((0,c.bz)()))}));class w extends n.WF{setConfig(e){(0,c.vA)(e,H),this._config=e}render(){var e;if(!this.hass||!this._config)return n.s6;const t=this._config.entity,a=(0,l.m)(t),i=this._featureContext(t);return(0,n.qy)(p||(p=b` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> <ha-expansion-panel outlined> <ha-svg-icon slot="leading-icon" .path="${0}"></ha-svg-icon> <h3 slot="header"> ${0} </h3> <div class="content"> <hui-card-features-editor .hass="${0}" .context="${0}" .featuresTypes="${0}" .features="${0}" @features-changed="${0}" @edit-detail-element="${0}"></hui-card-features-editor> </div> </ha-expansion-panel> `),this.hass,this._config,this._schema(a),this._computeLabelCallback,this._valueChanged,v,this.hass.localize("ui.panel.lovelace.editor.card.generic.features"),this.hass,i,C[a],null!==(e=this._config.features)&&void 0!==e?e:[],this._featuresChanged,this._editDetailElement)}_valueChanged(e){(0,h.r)(this,"config-changed",{config:e.detail.value})}_featuresChanged(e){if(e.stopPropagation(),!this._config||!this.hass)return;const t=e.detail.features,a=Object.assign(Object.assign({},this._config),{},{features:t});0===t.length&&delete a.features,(0,h.r)(this,"config-changed",{config:a})}_editDetailElement(e){const t=e.detail.subElementConfig.index,a=this._config.features[t];(0,h.r)(this,"edit-sub-element",{config:a,saveConfig:e=>this._updateFeature(t,e),context:{entity_id:this._config.entity},type:"feature"})}_updateFeature(e,t){const a=this._config.features.concat();a[e]=t;const i=Object.assign(Object.assign({},this._config),{},{features:a});(0,h.r)(this,"config-changed",{config:i})}static get styles(){return[m.U,(0,n.AH)(y||(y=b`ha-form{display:block;margin-bottom:24px}`))]}constructor(...e){super(...e),this._featureContext=(0,r.A)(e=>({entity_id:e})),this._schema=(0,r.A)(e=>[{name:"entity",selector:{entity:{domain:["climate","water_heater"]}}},{name:"name",selector:{entity_name:{}},context:{entity:"entity"}},{type:"grid",name:"",schema:[{name:"theme",selector:{theme:{}}}]},..."climate"===e?[{name:"show_current_as_primary",selector:{boolean:{}}}]:[]]),this._computeLabelCallback=e=>"show_current_as_primary"===e.name?this.hass.localize("ui.panel.lovelace.editor.card.thermostat.show_current_as_primary"):this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}(0,s.Cg)([(0,o.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,s.Cg)([(0,o.wk)()],w.prototype,"_config",void 0),w=(0,s.Cg)([(0,o.EM)("hui-thermostat-card-editor")],w),i()}catch(p){i(p)}})},84698:function(e,t,a){a.d(t,{H:function(){return s}});var i=a(63533);const s=(0,i.Ik)({type:(0,i.Yj)(),view_layout:(0,i.bz)(),layout_options:(0,i.bz)(),grid_options:(0,i.bz)(),visibility:(0,i.bz)(),disabled:(0,i.lq)((0,i.zM)())})}}]);
//# sourceMappingURL=61242.2b4928bad46f16d4.js.map