import{r as t,h as e,a as o}from"./p-9add63ef.js";const s=':host{display:block;--toggle-spacing:0}::slotted(*){margin-bottom:var(--toggle-spacing)}::slotted(:not(:first-child):not([style*="display: none"])){border-top:1px solid var(--sc-input-border-color)}';const i=s;const l=class{constructor(e){t(this,e);this.accordion=false;this.collapsible=true;this.theme="default"}getToggles(){var t,e,o;let s=this.el.shadowRoot.querySelector("slot");if(!s)return;return((o=(e=(t=s===null||s===void 0?void 0:s.assignedNodes)===null||t===void 0?void 0:t.call(s))===null||e===void 0?void 0:e.filter)===null||o===void 0?void 0:o.call(e,(t=>t.nodeName==="SC-TOGGLE")))||[]}handleShowChange(t){if(t.target.tagName!=="SC-TOGGLE")return;if(this.accordion){this.getToggles().map((e=>e.open=t.target===e))}}handleCollapibleChange(){this.getToggles().map((t=>t.collapsible=this.collapsible))}componentDidLoad(){this.handleCollapibleChange();const t=this.getToggles();if((t===null||t===void 0?void 0:t.length)&&!t.some((t=>t.open))){t[0].open=true}}render(){const t="container"===this.theme?"sc-card":"div";return e(t,{key:"7536b7318df242ac6c775c32cb8f9e4a70511d1a",class:{toggles:true,[`toggles--theme-${this.theme}`]:true},part:"base","no-padding":true},e("slot",{key:"f8a0cbe04e66ba56f0a98e28a61e8a7810c24957"}))}get el(){return o(this)}static get watchers(){return{collapsible:["handleCollapibleChange"]}}};l.style=i;export{l as sc_toggles};
//# sourceMappingURL=p-658a263f.entry.js.map