"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[83688],{94075:function(e,t,a){a.a(e,async function(e,n){try{a.r(t);var i,s=a(28430),l=a(97058),r=a(57567),o=a(25979),c=a(12463),u=a(16472),h=(a(28706),a(2008),a(74423),a(62062),a(18111),a(22489),a(61701),a(79432),a(26099),a(21699),a(15697)),d=a(57527),f=a(51209),m=a(90789),v=a(49588),_=a(148),p=a(41107),y=a(55682),g=a(1031),A=a(31008),b=a(30013),k=a(24652),z=e([y,A]);[y,A]=z.then?(await z)():z;var C=(0,v.kp)(b.H,(0,v.Ik)({entity:(0,v.lq)((0,v.Yj)()),name:(0,v.lq)(k.q),states:(0,v.lq)((0,v.YO)()),theme:(0,v.lq)((0,v.Yj)())})),M=Object.keys(A.ALARM_MODE_STATE_MAP),q=function(e){function t(){var e;(0,r.A)(this,t);for(var a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return(e=(0,u.A)(this,t,[].concat(n)))._schema=(0,m.A)(function(e,t,a){return[{name:"entity",required:!0,selector:{entity:{domain:"alarm_control_panel"}}},{name:"name",selector:{entity_name:{}},context:{entity:"entity"}},{name:"theme",selector:{theme:{}}},{name:"states",selector:{select:{multiple:!0,mode:"list",options:M.map(function(n){return{value:n,label:e("ui.card.alarm_control_panel.".concat(n)),disabled:!(a.includes(n)||t&&(0,p.$)(t,g.t[A.ALARM_MODE_STATE_MAP[n]].feature||0))}})}}}]}),e._computeLabelCallback=function(t){switch(t.name){case"entity":return e.hass.localize("ui.panel.lovelace.editor.card.generic.entity");case"name":return e.hass.localize("ui.panel.lovelace.editor.card.generic.name");case"theme":return"".concat(e.hass.localize("ui.panel.lovelace.editor.card.generic.theme")," (").concat(e.hass.localize("ui.panel.lovelace.editor.card.config.optional"),")");default:return e.hass.localize("ui.panel.lovelace.editor.card.alarm-panel.available_states")}},e}return(0,c.A)(t,e),(0,o.A)(t,[{key:"setConfig",value:function(e){(0,v.vA)(e,C),this._config=e}},{key:"render",value:function(){if(!this.hass||!this._config)return d.s6;var e=this.hass.states[this._config.entity],t=(0,A.filterSupportedAlarmStates)(e,A.DEFAULT_STATES),a=(0,l.A)({states:t},this._config);return(0,d.qy)(i||(i=(0,s.A)([" <ha-form .hass="," .data="," .schema="," .computeLabel="," @value-changed=","></ha-form> "])),this.hass,a,this._schema(this.hass.localize,e,a.states),this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(e){var t,a=e.detail.value;if(a.states){var n=M.filter(function(e){return a.states.includes(e)});a.states=n}if(a.states&&a.entity!==(null===(t=this._config)||void 0===t?void 0:t.entity)){var i,s=null===(i=this.hass)||void 0===i?void 0:i.states[a.entity];s&&(a.states=(0,A.filterSupportedAlarmStates)(s,a.states))}(0,_.r)(this,"config-changed",{config:a})}}])}(d.WF);(0,h.Cg)([(0,f.MZ)({attribute:!1})],q.prototype,"hass",void 0),(0,h.Cg)([(0,f.wk)()],q.prototype,"_config",void 0),q=(0,h.Cg)([(0,f.EM)("hui-alarm-panel-card-editor")],q),a.d(t,{HuiAlarmPanelCardEditor:function(){return q}}),n()}catch(E){n(E)}})},30013:function(e,t,a){var n=a(49588),i=(0,n.Ik)({type:(0,n.Yj)(),view_layout:(0,n.bz)(),layout_options:(0,n.bz)(),grid_options:(0,n.bz)(),visibility:(0,n.bz)(),disabled:(0,n.lq)((0,n.zM)())});a.d(t,{H:function(){return i}})}}]);
//# sourceMappingURL=83688.33a961fb9f78333e.js.map