"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["8260"],{4623:function(t,e,s){s.a(t,async function(t,o){try{s.r(e),s.d(e,{HuiClimateSwingHorizontalModesCardFeatureEditor:function(){return g}});var i=s(20054),a=(s(18111),s(61701),s(62953),s(40445)),n=s(96196),l=s(77845),r=s(22786),d=s(1087),c=s(52763),h=t([c]);c=(h.then?(await h)():h)[0];const u=["customize_modes"];let m,_=t=>t;class g extends n.WF{setConfig(t){this._config=t}render(){var t,e;if(!this.hass||!this._config)return n.s6;const s=null!==(t=this.context)&&void 0!==t&&t.entity_id?this.hass.states[null===(e=this.context)||void 0===e?void 0:e.entity_id]:void 0,o=Object.assign(Object.assign({style:"dropdown"},this._config),{},{customize_modes:void 0!==this._config.swing_horizontal_modes}),i=this._schema(this.hass.localize,this.hass.formatEntityAttributeValue,s,o.customize_modes);return(0,n.qy)(m||(m=_` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> `),this.hass,o,i,this._computeLabelCallback,this._valueChanged)}_valueChanged(t){var e,s;const o=t.detail.value,{customize_modes:a}=o,n=(0,i.A)(o,u),l=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[null===(s=this.context)||void 0===s?void 0:s.entity_id]:void 0;a&&!n.swing_horizontal_modes&&(n.swing_horizontal_modes=(null==l?void 0:l.attributes.swing_horizontal_modes)||[]),!a&&n.swing_horizontal_modes&&delete n.swing_horizontal_modes,(0,d.r)(this,"config-changed",{config:n})}constructor(...t){super(...t),this._schema=(0,r.A)((t,e,s,o)=>{var i;return[{name:"style",selector:{select:{multiple:!1,mode:"list",options:["dropdown","icons"].map(e=>({value:e,label:t(`ui.panel.lovelace.editor.features.types.climate-swing-horizontal-modes.style_list.${e}`)}))}}},{name:"customize_modes",selector:{boolean:{}}},...o?[{name:"swing_horizontal_modes",selector:{select:{reorder:!0,multiple:!0,options:(null==s||null===(i=s.attributes.swing_horizontal_modes)||void 0===i?void 0:i.map(t=>({value:t,label:e(s,"swing_horizontal_mode",t)})))||[]}}}]:[]]}),this._computeLabelCallback=t=>{switch(t.name){case"style":case"swing_horizontal_modes":case"customize_modes":return this.hass.localize(`ui.panel.lovelace.editor.features.types.climate-swing-horizontal-modes.${t.name}`);default:return""}}}}(0,a.Cg)([(0,l.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,a.Cg)([(0,l.MZ)({attribute:!1})],g.prototype,"context",void 0),(0,a.Cg)([(0,l.wk)()],g.prototype,"_config",void 0),g=(0,a.Cg)([(0,l.EM)("hui-climate-swing-horizontal-modes-card-feature-editor")],g),o()}catch(u){o(u)}})}}]);
//# sourceMappingURL=8260.1ca8ffca24eae28d.js.map