"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["44621"],{27420:function(e,t,s){s.r(t),s.d(t,{HuiClimateSwingModesCardFeatureEditor:function(){return f}});var i,o=s(20054),n=s(72153),a=s(7739),l=s(44734),c=s(43080),u=s(69683),r=s(6454),d=(s(28706),s(62062),s(18111),s(61701),s(69085),s(26099),s(40445)),m=s(96196),h=s(77845),_=s(22786),g=s(1087),v=(s(52763),["customize_modes"]),f=function(e){function t(){var e;(0,l.A)(this,t);for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];return(e=(0,u.A)(this,t,[].concat(i)))._schema=(0,_.A)(function(e,t,s,i){var o;return[{name:"style",selector:{select:{multiple:!1,mode:"list",options:["dropdown","icons"].map(function(t){return{value:t,label:e("ui.panel.lovelace.editor.features.types.climate-swing-modes.style_list.".concat(t))}})}}},{name:"customize_modes",selector:{boolean:{}}}].concat((0,a.A)(i?[{name:"swing_modes",selector:{select:{reorder:!0,multiple:!0,options:(null==s||null===(o=s.attributes.swing_modes)||void 0===o?void 0:o.map(function(e){return{value:e,label:t(s,"swing_mode",e)}}))||[]}}}]:[]))}),e._computeLabelCallback=function(t){switch(t.name){case"style":case"swing_modes":case"customize_modes":return e.hass.localize("ui.panel.lovelace.editor.features.types.climate-swing-modes.".concat(t.name));default:return""}},e}return(0,r.A)(t,e),(0,c.A)(t,[{key:"setConfig",value:function(e){this._config=e}},{key:"render",value:function(){var e,t;if(!this.hass||!this._config)return m.s6;var s=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[null===(t=this.context)||void 0===t?void 0:t.entity_id]:void 0,o=Object.assign(Object.assign({style:"dropdown"},this._config),{},{customize_modes:void 0!==this._config.swing_modes}),a=this._schema(this.hass.localize,this.hass.formatEntityAttributeValue,s,o.customize_modes);return(0,m.qy)(i||(i=(0,n.A)([' <ha-form .hass="','" .data="','" .schema="','" .computeLabel="','" @value-changed="','"></ha-form> '])),this.hass,o,a,this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(e){var t,s,i=e.detail.value,n=i.customize_modes,a=(0,o.A)(i,v),l=null!==(t=this.context)&&void 0!==t&&t.entity_id?this.hass.states[null===(s=this.context)||void 0===s?void 0:s.entity_id]:void 0;n&&!a.swing_modes&&(a.swing_modes=(null==l?void 0:l.attributes.swing_modes)||[]),!n&&a.swing_modes&&delete a.swing_modes,(0,g.r)(this,"config-changed",{config:a})}}])}(m.WF);(0,d.Cg)([(0,h.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,d.Cg)([(0,h.MZ)({attribute:!1})],f.prototype,"context",void 0),(0,d.Cg)([(0,h.wk)()],f.prototype,"_config",void 0),f=(0,d.Cg)([(0,h.EM)("hui-climate-swing-modes-card-feature-editor")],f)}}]);
//# sourceMappingURL=44621.f0c7a0b48613f96b.js.map