export const __rspack_esm_id=63091;export const __rspack_esm_ids=[63091];export const __webpack_modules__={67294(e,t,a){a.a(e,async function(e,i){try{a.r(t);var s=a(15697),n=a(57527),o=a(79224),r=a(90789),c=a(49588),h=a(148),l=a(45602),d=(a(2441),a(55682)),_=(a(41247),a(30013)),m=a(24652),u=a(13263),f=a(35170),g=e([d,f]);[d,f]=g.then?(await g)():g;const p="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",y={climate:["climate-hvac-modes","climate-preset-modes","climate-fan-modes","climate-swing-modes","climate-swing-horizontal-modes"],water_heater:["water-heater-operation-modes"]},v=(0,c.kp)(_.H,(0,c.Ik)({entity:(0,c.lq)((0,c.Yj)()),name:(0,c.lq)(m.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 b extends n.WF{setConfig(e){(0,c.vA)(e,v),this._config=e}render(){if(!this.hass||!this._config)return n.s6;const e=this._config.entity,t=(0,l.m)(e),a=this._featureContext(e);return n.qy` <ha-form .hass=${this.hass} .data=${this._config} .schema=${this._schema(t)} .computeLabel=${this._computeLabelCallback} @value-changed=${this._valueChanged}></ha-form> <ha-expansion-panel outlined> <ha-svg-icon slot="leading-icon" .path=${p}></ha-svg-icon> <h3 slot="header"> ${this.hass.localize("ui.panel.lovelace.editor.card.generic.features")} </h3> <div class="content"> <hui-card-features-editor .hass=${this.hass} .context=${a} .featuresTypes=${y[t]} .features=${this._config.features??[]} @features-changed=${this._featuresChanged} @edit-detail-element=${this._editDetailElement}></hui-card-features-editor> </div> </ha-expansion-panel> `}_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={...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={...this._config,features:a};(0,h.r)(this,"config-changed",{config:i})}static get styles(){return[u.U,n.AH`ha-form{margin-bottom:24px;display:block}`]}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})],b.prototype,"hass",void 0),(0,s.Cg)([(0,o.wk)()],b.prototype,"_config",void 0),b=(0,s.Cg)([(0,o.EM)("hui-thermostat-card-editor")],b),a.d(t,{HuiThermostatCardEditor:()=>b}),i()}catch(e){i(e)}})},30013(e,t,a){var i=a(49588);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)())});a.d(t,{},{H:s})}};
//# sourceMappingURL=63091.08be0bb8b0084821.js.map