export const __rspack_esm_id="26934";export const __rspack_esm_ids=["26934"];export const __webpack_modules__={57237(t,e,o){o.d(e,{d:()=>a});const a=t=>t.stopPropagation()},70947(t,e,o){var a=o(62826),s=o(90075),i=(o(43776),o(96196)),r=o(97735);o(67094);class c extends s.A{renderCheckboxIcon(){return i.qy` <ha-svg-icon id="check" part="checkmark" .path="${this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z"}"></ha-svg-icon> `}static get styles(){return[s.A.styles,i.AH`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`]}constructor(...t){super(...t),this.selected=!1}}(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"selected",void 0),c=(0,a.Cg)([(0,r.EM)("ha-dropdown-item")],c)},29823(t,e,o){o.a(t,async function(t,e){try{var a=o(62826),s=o(52254),i=o(96196),r=o(97735),c=t([s]);s=(c.then?(await c)():c)[0];class n extends s.A{get anchorElement(){return this.popup?.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[s.A.styles,i.AH`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
            --card-background-color,
            var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
          )}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`]}constructor(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],n.prototype,"dropdownTag",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],n.prototype,"dropdownItemTag",void 0),n=(0,a.Cg)([(0,r.EM)("ha-dropdown")],n),e()}catch(t){e(t)}})},8456(t,e,o){o.a(t,async function(t,a){try{o.r(e),o.d(e,{HaFormOptionalActions:()=>g});o(18111),o(22489),o(61701),o(45367),o(92731);var s=o(62826),i=o(96196),r=o(97735),c=o(22786),n=o(57237),h=o(18350),d=o(29823),p=(o(70947),o(67094),o(52763)),l=t([h,d,p]);[h,d,p]=l.then?(await l)():l;const u="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",m=[];class g extends i.WF{async focus(){await this.updateComplete,this.renderRoot.querySelector("ha-form")?.focus()}reportValidity(){const t=this.renderRoot.querySelector("ha-form");return!t||t.reportValidity()}updated(t){if(super.updated(t),t.has("data")){const t=this._displayActions??m,e=this._hiddenActions(this.schema.schema,t);this._displayActions=[...t,...e.filter(t=>t in this.data)]}}render(){const t=this._displayActions??m,e=this._displaySchema(this.schema.schema,this._displayActions??[]),o=this._hiddenActions(this.schema.schema,t),a=new Map(this.computeLabel?this.schema.schema.map(t=>[t.name,t]):[]);return i.qy` ${e.length>0?i.qy` <ha-form .hass="${this.hass}" .data="${this.data}" .schema="${e}" .disabled="${this.disabled}" .computeLabel="${this.computeLabel}" .computeHelper="${this.computeHelper}" .localizeValue="${this.localizeValue}"></ha-form> `:i.s6} ${o.length>0?i.qy` <ha-dropdown @wa-select="${this._handleAddAction}" @closed="${n.d}"> <ha-button slot="trigger" appearance="filled" size="small"> <ha-svg-icon .path="${u}" slot="start"></ha-svg-icon> ${this.localize?.("ui.components.form-optional-actions.add")||"Add interaction"} </ha-button> ${o.map(t=>{const e=a.get(t);return i.qy` <ha-dropdown-item .value="${t}"> ${this.computeLabel&&e?this.computeLabel(e):t} </ha-dropdown-item> `})} </ha-dropdown> `:i.s6} `}_handleAddAction(t){const e=t.detail.item.value;this._displayActions=[...this._displayActions??[],e]}constructor(...t){super(...t),this.disabled=!1,this._hiddenActions=(0,c.A)((t,e)=>t.map(t=>t.name).filter(t=>!e.includes(t))),this._displaySchema=(0,c.A)((t,e)=>t.filter(t=>e.includes(t.name)))}}g.styles=i.AH`:host{display:flex!important;flex-direction:column;gap:var(--ha-space-6)}:host ha-form{display:block}ha-dropdown{display:inline-block}`,(0,s.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"localize",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"data",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"schema",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"disabled",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"computeLabel",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"computeHelper",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"localizeValue",void 0),(0,s.Cg)([(0,r.wk)()],g.prototype,"_displayActions",void 0),g=(0,s.Cg)([(0,r.EM)("ha-form-optional_actions")],g),a()}catch(t){a(t)}})},35370(t,e,o){var a=o(26198);t.exports=function(t,e,o){for(var s=0,i=arguments.length>2?o:a(e),r=new t(i);i>s;)r[s]=e[s++];return r}}};
//# sourceMappingURL=26934.3a947dab1ec98390.js.map