export const __rspack_esm_id="35505";export const __rspack_esm_ids=["35505"];export const __webpack_modules__={57237(t,i,e){e.d(i,{d:()=>a});const a=t=>t.stopPropagation()},8456(t,i,e){e.a(t,async function(t,a){try{e.r(i),e.d(i,{HaFormOptionalActions:()=>h});e(18111),e(22489),e(61701);var s=e(62826),o=e(96196),n=e(44457),d=e(22786),r=e(57237),c=e(18350),l=(e(28732),e(67094),e(52763),t([c]));c=(l.then?(await l)():l)[0];const p="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",m=[];class h extends o.WF{async focus(){await this.updateComplete,this.renderRoot.querySelector("ha-form")?.focus()}updated(t){if(super.updated(t),t.has("data")){const t=this._displayActions??m,i=this._hiddenActions(this.schema.schema,t);this._displayActions=[...t,...i.filter(t=>t in this.data)]}}render(){const t=this._displayActions??m,i=this._displaySchema(this.schema.schema,this._displayActions??[]),e=this._hiddenActions(this.schema.schema,t),a=new Map(this.computeLabel?this.schema.schema.map(t=>[t.name,t]):[]);return o.qy` ${i.length>0?o.qy` <ha-form .hass="${this.hass}" .data="${this.data}" .schema="${i}" .disabled="${this.disabled}" .computeLabel="${this.computeLabel}" .computeHelper="${this.computeHelper}" .localizeValue="${this.localizeValue}"></ha-form> `:o.s6} ${e.length>0?o.qy` <ha-button-menu @action="${this._handleAddAction}" fixed @closed="${r.d}"> <ha-button slot="trigger" appearance="filled" size="small"> <ha-svg-icon .path="${p}" slot="start"></ha-svg-icon> ${this.localize?.("ui.components.form-optional-actions.add")||"Add interaction"} </ha-button> ${e.map(t=>{const i=a.get(t);return o.qy` <ha-list-item> ${this.computeLabel&&i?this.computeLabel(i):t} </ha-list-item> `})} </ha-button-menu> `:o.s6} `}_handleAddAction(t){const i=this._hiddenActions(this.schema.schema,this._displayActions??m)[t.detail.index];this._displayActions=[...this._displayActions??[],i]}constructor(...t){super(...t),this.disabled=!1,this._hiddenActions=(0,d.A)((t,i)=>t.map(t=>t.name).filter(t=>!i.includes(t))),this._displaySchema=(0,d.A)((t,i)=>t.filter(t=>i.includes(t.name)))}}h.styles=o.AH`:host{display:flex!important;flex-direction:column;gap:var(--ha-space-6)}:host ha-form{display:block}`,(0,s.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"localize",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"data",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"schema",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],h.prototype,"disabled",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"computeLabel",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"computeHelper",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"localizeValue",void 0),(0,s.Cg)([(0,n.wk)()],h.prototype,"_displayActions",void 0),h=(0,s.Cg)([(0,n.EM)("ha-form-optional_actions")],h),a()}catch(t){a(t)}})},28732(t,i,e){var a=e(62826),s=e(27686),o=e(7731),n=e(96196),d=e(44457);class r extends s.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[o.R,n.AH`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?n.AH`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:n.AH``]}}r=(0,a.Cg)([(0,d.EM)("ha-list-item")],r)}};
//# sourceMappingURL=35505.8bedc3920fb9b9b0.js.map