import{r as t,h as s,a as e,g as i}from"./p-c18ee3cd.js";import{c as a}from"./p-c608c6dc.js";const n=class{constructor(s){t(this,s),this.dependent=!1,this.expanded=!1,this.headingLevel=null,this.iconLocation="left"}collapsibleHandler(t){t.stopPropagation();const{expanded:s}=t.detail;this.dependent&&!1!==s&&this.getCollapsibleChildren().forEach((s=>{s!==t.target&&s.hasAttribute("expanded")&&(s.expanded=!1)}))}headingLevelChanged(t){this.propagatePropsToChildren(t,this.iconLocation)}iconLocationChanged(t){this.propagatePropsToChildren(this.headingLevel,t)}connectedCallback(){this.dependent||this.getCollapsibleChildren().forEach((t=>{t.expanded=this.expanded}))}componentDidLoad(){null===this.headingLevel&&"left"===this.iconLocation||this.propagatePropsToChildren(this.headingLevel,this.iconLocation)}getCollapsibleChildren(){return Array.from(this.el.querySelectorAll("scale-collapsible"))}propagatePropsToChildren(t,s){this.getCollapsibleChildren().forEach((e=>{e.headingLevel=t,e.iconLocation=s}))}render(){return s(e,null,this.styles&&s("style",null,this.styles),s("div",{class:this.getCssClassMap(),part:"base"},s("slot",null)))}getCssClassMap(){return a("accordion")}get el(){return i(this)}static get watchers(){return{headingLevel:["headingLevelChanged"],iconLocation:["iconLocationChanged"]}}};export{n as scale_accordion}