"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[95865],{26792:function(e,t,o){o.a(e,async function(e,a){try{var i,n=o(86613),r=o(28430),s=o(97058),c=o(74512),d=o(57567),u=o(25979),l=o(12463),h=o(16472),m=o(43939),f=(o(28706),o(62062),o(18111),o(61701),o(26099),o(15697)),v=o(57527),p=o(51209),y=o(90789),_=o(148),g=o(55682),A=e([g]);g=(A.then?(await A)():A)[0];var b=["customize_modes"];function F(e){e.customize_modes;return(0,m.A)(e,b)}var k=function(e){function t(){var e;(0,d.A)(this,t);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(e=(0,h.A)(this,t,[].concat(a)))._schema=(0,y.A)(function(t,o,a){var i,n=e.descriptor,r=null!==(i=n.styleListI18nFeatureId)&&void 0!==i?i:n.i18nFeatureId;return[{name:"style",selector:{select:{multiple:!1,mode:"list",options:["dropdown","icons"].map(function(e){return{value:e,label:t("ui.panel.lovelace.editor.features.types.".concat(r,".style_list.").concat(e))}})}}},{name:"customize_modes",selector:{boolean:{}}}].concat((0,c.A)(a?[{name:n.modeField,selector:{select:{reorder:!0,multiple:!0,options:n.getAvailableModesOrdered(o).map(function(t){return{value:t,label:n.getModeLabel(e.hass,o,t)}})}}}]:[]))}),e._computeLabelCallback=function(t){var o=e.descriptor.i18nFeatureId,a=e.descriptor.modeField;return"style"===t.name||"customize_modes"===t.name||t.name===a?e.hass.localize("ui.panel.lovelace.editor.features.types.".concat(o,".").concat(t.name)):""},e}return(0,l.A)(t,e),(0,u.A)(t,[{key:"setConfig",value:function(e){e.type===this.descriptor.featureType&&(this._config=e)}},{key:"render",value:function(){var e;if(!this.hass||!this._config)return v.s6;var t=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[this.context.entity_id]:void 0,o=this.descriptor,a=o.modeField,n=o.defaultStyle,c=(0,s.A)((0,s.A)({style:n},this._config),{},{customize_modes:void 0!==this._config[a]}),d=this._schema(this.hass.localize,t,c.customize_modes);return(0,v.qy)(i||(i=(0,r.A)([" <ha-form .hass="," .data="," .schema="," .computeLabel="," @value-changed=","></ha-form> "])),this.hass,c,d,this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(e){var t,o=e.detail.value,a=o.customize_modes,i=F(o),r=null!==(t=this.context)&&void 0!==t&&t.entity_id?this.hass.states[this.context.entity_id]:void 0,c=this.descriptor,d=c.modeField,u=c.getAvailableModesOrdered,l=d;a&&!i[l]&&(i=(0,s.A)((0,s.A)({},i),{},(0,n.A)({},d,u(r)))),a||void 0===i[l]||delete i[l],(0,_.r)(this,"config-changed",{config:i})}}])}(v.WF);(0,f.Cg)([(0,p.MZ)({attribute:!1})],k.prototype,"hass",void 0),(0,f.Cg)([(0,p.MZ)({attribute:!1})],k.prototype,"context",void 0),(0,f.Cg)([(0,p.wk)()],k.prototype,"_config",void 0),o.d(t,{k:function(){return k}}),a()}catch(C){a(C)}})},48288:function(e,t,o){o.a(e,async function(e,a){try{o.r(t);var i=o(25979),n=o(57567),r=o(12463),s=o(16472),c=(o(28706),o(26910),o(15697)),d=o(51209),u=o(74624),l=o(26792),h=e([l]);l=(h.then?(await h)():h)[0];var m={featureType:"water-heater-operation-modes",i18nFeatureId:"water-heater-operation-modes",modeField:"operation_modes",defaultStyle:"icons",getAvailableModesOrdered:function(e){var t;return(null!==(t=null==e?void 0:e.attributes.operation_list)&&void 0!==t?t:[]).concat().sort(u.im)},getModeLabel:function(e,t,o){return t?e.formatEntityState(t,o):o}},f=function(e){function t(){var e;(0,n.A)(this,t);for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(e=(0,s.A)(this,t,[].concat(a))).descriptor=m,e}return(0,r.A)(t,e),(0,i.A)(t)}(l.k);f=(0,c.Cg)([(0,d.EM)("hui-water-heater-operation-modes-card-feature-editor")],f),o.d(t,{HuiWaterHeaterOperationModesCardFeatureEditor:function(){return f}}),a()}catch(v){a(v)}})}}]);
//# sourceMappingURL=95865.e7adb48d11150aca.js.map