export const __rspack_esm_id="35905";export const __rspack_esm_ids=["35905"];export const __webpack_modules__={93048(e,t,a){a.a(e,async function(e,n){try{a.r(t),a.d(t,{HuiEntityBadgeEditor:()=>C});a(44114);var i=a(62826),s=a(96196),o=a(97735),l=a(22786),c=a(63533),_=a(1087),d=a(52763),r=a(67066),p=a(999),h=a(91408),m=a(45031),u=a(44155),y=a(7382),g=a(16161),b=e([d,g,r,p]);[d,g,r,p]=b.then?(await b)():b;const f="M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5Z",v="M4,9H20V11H4V9M4,13H14V15H4V13Z",q=(0,c.kp)(m.y,(0,c.Ik)({entity:(0,c.lq)((0,c.Yj)()),display_type:(0,c.lq)((0,c.vP)(r.rU)),name:(0,c.lq)(u.q),icon:(0,c.lq)((0,c.Yj)()),state_content:(0,c.lq)((0,c.KC)([(0,c.Yj)(),(0,c.YO)((0,c.Yj)())])),color:(0,c.lq)((0,c.Yj)()),show_name:(0,c.lq)((0,c.zM)()),show_state:(0,c.lq)((0,c.zM)()),show_icon:(0,c.lq)((0,c.zM)()),show_entity_picture:(0,c.lq)((0,c.zM)()),tap_action:(0,c.lq)(h.kn),hold_action:(0,c.lq)(h.kn),double_tap_action:(0,c.lq)(h.kn),image:(0,c.lq)((0,c.Yj)())}));class C extends s.WF{setConfig(e){(0,c.vA)(e,q),this._config={...r.PV,...(0,r.P8)(e)}}render(){if(!this.hass||!this._config)return s.s6;const e=this._schema(this.hass.localize),t={...this._config,displayed_elements:this._displayedElements(this._config)};return s.qy` <ha-form .hass="${this.hass}" .data="${t}" .schema="${e}" .computeLabel="${this._computeLabelCallback}" .computeHelper="${this._computeHelperCallback}" @value-changed="${this._valueChanged}"></ha-form> `}_valueChanged(e){if(e.stopPropagation(),!this._config||!this.hass)return;const t={...e.detail.value};t.state_content||delete t.state_content,t.displayed_elements&&(t.show_name=t.displayed_elements.includes("name"),t.show_state=t.displayed_elements.includes("state"),t.show_icon=t.displayed_elements.includes("icon"),delete t.displayed_elements),(0,_.r)(this,"config-changed",{config:t})}static get styles(){return[y.U,s.AH`.container{display:flex;flex-direction:column}ha-form{display:block;margin-bottom:24px}`]}constructor(...e){super(...e),this._schema=(0,l.A)(e=>[{name:"entity",selector:{entity:{}}},{name:"content",type:"expandable",flatten:!0,iconPath:v,schema:[{name:"name",selector:{entity_name:{}},context:{entity:"entity"}},{name:"",type:"grid",schema:[{name:"color",selector:{ui_color:{default_color:"state",include_state:!0}}},{name:"icon",selector:{icon:{}},context:{icon_entity:"entity"}},{name:"show_entity_picture",selector:{boolean:{}}}]},{name:"displayed_elements",selector:{select:{mode:"list",multiple:!0,options:[{value:"name",label:e("ui.panel.lovelace.editor.badge.entity.displayed_elements_options.name")},{value:"state",label:e("ui.panel.lovelace.editor.badge.entity.displayed_elements_options.state")},{value:"icon",label:e("ui.panel.lovelace.editor.badge.entity.displayed_elements_options.icon")}]}}},{name:"state_content",selector:{ui_state_content:{allow_name:!0}},context:{filter_entity:"entity"}}]},{name:"interactions",type:"expandable",flatten:!0,iconPath:f,schema:[{name:"tap_action",selector:{ui_action:{default_action:"more-info"}},context:p.Tq},{name:"",type:"optional_actions",flatten:!0,schema:["hold_action","double_tap_action"].map(e=>({name:e,selector:{ui_action:{default_action:"none"}},context:p.Tq}))}]}]),this._displayedElements=(0,l.A)(e=>{const t=[];return e.show_name&&t.push("name"),e.show_state&&t.push("state"),e.show_icon&&t.push("icon"),t}),this._computeLabelCallback=e=>{switch(e.name){case"color":case"state_content":case"show_entity_picture":case"displayed_elements":return this.hass.localize(`ui.panel.lovelace.editor.badge.entity.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}},this._computeHelperCallback=e=>{if("color"===e.name)return this.hass.localize(`ui.panel.lovelace.editor.badge.entity.${e.name}_helper`)}}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,i.Cg)([(0,o.wk)()],C.prototype,"_config",void 0),C=(0,i.Cg)([(0,o.EM)("hui-entity-badge-editor")],C),n()}catch(e){n(e)}})},45031(e,t,a){a.d(t,{y:()=>i});var n=a(63533);const i=(0,n.Ik)({type:(0,n.Yj)(),visibility:(0,n.bz)(),disabled:(0,n.lq)((0,n.zM)())})}};
//# sourceMappingURL=35905.7ad96f591a66782d.js.map