"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[55044],{26792:function(e,t,i){i.a(e,async function(e,o){try{var a,n=i(86613),r=i(28430),s=i(97058),d=i(74512),c=i(57567),u=i(25979),l=i(12463),h=i(16472),m=i(43939),f=(i(28706),i(62062),i(18111),i(61701),i(26099),i(15697)),v=i(57527),p=i(51209),y=i(90789),_=i(148),g=i(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,c.A)(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return(e=(0,h.A)(this,t,[].concat(o)))._schema=(0,y.A)(function(t,i,o){var a,n=e.descriptor,r=null!==(a=n.styleListI18nFeatureId)&&void 0!==a?a: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,d.A)(o?[{name:n.modeField,selector:{select:{reorder:!0,multiple:!0,options:n.getAvailableModesOrdered(i).map(function(t){return{value:t,label:n.getModeLabel(e.hass,i,t)}})}}}]:[]))}),e._computeLabelCallback=function(t){var i=e.descriptor.i18nFeatureId,o=e.descriptor.modeField;return"style"===t.name||"customize_modes"===t.name||t.name===o?e.hass.localize("ui.panel.lovelace.editor.features.types.".concat(i,".").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,i=this.descriptor,o=i.modeField,n=i.defaultStyle,d=(0,s.A)((0,s.A)({style:n},this._config),{},{customize_modes:void 0!==this._config[o]}),c=this._schema(this.hass.localize,t,d.customize_modes);return(0,v.qy)(a||(a=(0,r.A)([" <ha-form .hass="," .data="," .schema="," .computeLabel="," @value-changed=","></ha-form> "])),this.hass,d,c,this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(e){var t,i=e.detail.value,o=i.customize_modes,a=F(i),r=null!==(t=this.context)&&void 0!==t&&t.entity_id?this.hass.states[this.context.entity_id]:void 0,d=this.descriptor,c=d.modeField,u=d.getAvailableModesOrdered,l=c;o&&!a[l]&&(a=(0,s.A)((0,s.A)({},a),{},(0,n.A)({},c,u(r)))),o||void 0===a[l]||delete a[l],(0,_.r)(this,"config-changed",{config:a})}}])}(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),i.d(t,{k:function(){return k}}),o()}catch(C){o(C)}})},97647:function(e,t,i){i.a(e,async function(e,o){try{i.r(t);var a=i(25979),n=i(57567),r=i(12463),s=i(16472),d=(i(28706),i(15697)),c=i(51209),u=i(26792),l=e([u]);u=(l.then?(await l)():l)[0];var h={featureType:"humidifier-modes",i18nFeatureId:"humidifier-modes",modeField:"modes",defaultStyle:"dropdown",getAvailableModesOrdered:function(e){var t;return null!==(t=null==e?void 0:e.attributes.available_modes)&&void 0!==t?t:[]},getModeLabel:function(e,t,i){return t?e.formatEntityAttributeValue(t,"mode",i):i}},m=function(e){function t(){var e;(0,n.A)(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return(e=(0,s.A)(this,t,[].concat(o))).descriptor=h,e}return(0,r.A)(t,e),(0,a.A)(t)}(u.k);m=(0,d.Cg)([(0,c.EM)("hui-humidifier-modes-card-feature-editor")],m),i.d(t,{HuiHumidifierModesCardFeatureEditor:function(){return m}}),o()}catch(f){o(f)}})}}]);
//# sourceMappingURL=55044.e285161cb5d18c87.js.map