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