"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[22490],{78593:function(t,e,o){o.a(t,async function(t,i){try{o.r(e);var n=o(43939),s=o(28430),a=o(97058),c=o(74512),r=o(57567),u=o(25979),l=o(12463),h=o(16472),d=(o(28706),o(62062),o(18111),o(61701),o(26099),o(15697)),p=o(57527),v=o(51209),f=o(90789),_=o(148),m=o(55682),g=t([m]);m=(g.then?(await g)():g)[0];var y,C=["customize_options"],b=function(t){function e(){var t;(0,r.A)(this,e);for(var o=arguments.length,i=new Array(o),n=0;n<o;n++)i[n]=arguments[n];return(t=(0,h.A)(this,e,[].concat(i)))._schema=(0,f.A)(function(t,e,o){var i;return[{name:"customize_options",selector:{boolean:{}}}].concat((0,c.A)(o?[{name:"options",selector:{select:{multiple:!0,reorder:!0,options:(null==e||null===(i=e.attributes.options)||void 0===i?void 0:i.map(function(o){return{value:o,label:t(e,o)}}))||[]}}}]:[]))}),t._computeLabelCallback=function(e){switch(e.name){case"options":case"customize_options":return t.hass.localize("ui.panel.lovelace.editor.features.types.select-options.".concat(e.name));default:return""}},t}return(0,l.A)(e,t),(0,u.A)(e,[{key:"setConfig",value:function(t){this._config=t}},{key:"render",value:function(){var t,e;if(!this.hass||!this._config)return p.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,i=(0,a.A)((0,a.A)({},this._config),{},{customize_options:void 0!==this._config.options}),n=this._schema(this.hass.formatEntityState,o,i.customize_options);return(0,p.qy)(y||(y=(0,s.A)([" <ha-form .hass="," .data="," .schema="," .computeLabel="," @value-changed=","></ha-form> "])),this.hass,i,n,this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(t){var e,o,i=t.detail.value,s=i.customize_options,a=(0,n.A)(i,C),c=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;s&&!a.options&&(a.options=(null==c?void 0:c.attributes.options)||[]),!s&&a.options&&delete a.options,(0,_.r)(this,"config-changed",{config:a})}}])}(p.WF);(0,d.Cg)([(0,v.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,d.Cg)([(0,v.MZ)({attribute:!1})],b.prototype,"context",void 0),(0,d.Cg)([(0,v.wk)()],b.prototype,"_config",void 0),b=(0,d.Cg)([(0,v.EM)("hui-select-options-card-feature-editor")],b),o.d(e,{HuiSelectOptionsCardFeatureEditor:function(){return b}}),i()}catch(A){i(A)}})}}]);
//# sourceMappingURL=22490.c3c98de773c65560.js.map