export const __rspack_esm_id="21323";export const __rspack_esm_ids=["21323"];export const __webpack_modules__={42566(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HuiServiceButtonElementEditor:()=>u});var s=a(62826),c=a(96196),o=a(97735),n=a(22786),r=a(63533),l=a(1087),h=a(52763),d=a(67431),v=e([h,d]);[h,d]=v.then?(await v)():v;const _=(0,r.Ik)({type:(0,r.vP)(["service-button","action-button"]),style:(0,r.lq)((0,r.bz)()),title:(0,r.lq)((0,r.Yj)()),action:(0,r.lq)((0,r.Yj)()),service:(0,r.lq)((0,r.Yj)()),service_data:(0,r.lq)((0,r.bz)()),data:(0,r.lq)((0,r.bz)()),target:(0,r.lq)((0,r.bz)())}),g=[{name:"title",required:!0,selector:{text:{}}},{name:"style",selector:{object:{}}}];class u extends c.WF{setConfig(e){(0,r.vA)(e,_),this._config=e}render(){return this.hass&&this._config?c.qy` <ha-form .hass="${this.hass}" .data="${this._config}" .schema="${g}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> <ha-service-control .hass="${this.hass}" .value="${this._serviceData(this._config)}" .showAdvanced="${this.hass.userData?.showAdvanced}" narrow @value-changed="${this._serviceDataChanged}"></ha-service-control> `:c.s6}_valueChanged(e){(0,l.r)(this,"config-changed",{config:{...this._config,...e.detail.value}})}_serviceDataChanged(e){const t={...this._config,action:e.detail.value.action,data:e.detail.value.data,target:e.detail.value.target};"service"in t&&delete t.service,"service_data"in t&&delete t.service_data,(0,l.r)(this,"config-changed",{config:t})}constructor(...e){super(...e),this._serviceData=(0,n.A)(e=>({action:e?.action??e?.service,data:e?.data??e?.service_data,target:e?.target})),this._computeLabelCallback=e=>this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)||this.hass.localize(`ui.panel.lovelace.editor.elements.${e.name}`)||e.name}}u.styles=c.AH`ha-service-control{display:block;margin-top:16px;--service-control-padding:0}`,(0,s.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,s.Cg)([(0,o.wk)()],u.prototype,"_config",void 0),u=(0,s.Cg)([(0,o.EM)("hui-service-button-element-editor")],u),i()}catch(e){i(e)}})}};
//# sourceMappingURL=21323.d9528e95989d6a15.js.map