import{r as t,h as s,H as i,g as e}from"./p-ClISz4NF.js";import{p as o}from"./p-CQvUntGY.js";import{S as a}from"./p-BcQO4NH2.js";import{g as c,b as r}from"./p-CoD1xawt.js";import{v as h}from"./p-NOJjz9dT.js";import{A as n,a as l}from"./p-Bz_RzYFb.js";import{c as d}from"./p-vN03FcXN.js";import{i as p}from"./p-CzXeijOj.js";import"./p-CgDnDrq5.js";const b=o(a,["_XS","_S","_M","_L","_XL"]);var f;(function(t){t["DOWN"]="down";t["UP"]="up"})(f||(f={}));const m={root:"gov-collapsible",content:"gov-collapsible__content",disabled:"gov-collapsible--disabled"};const v=class{constructor(s){t(this,s);this.hydrated=false;this.size="m";this.disabled=false;this.open=false;this.inheritedAttributes={};this.h=c(this.host);this.triggerId=d("GovCollapsibleControl");this.contentId=d("GovCollapsibleContent")}validateSize(t){h(b,t,m.root)}componentDidLoad(){this.attributeObserver=new n(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(l)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=p(this.host)}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}connectedCallback(){this.hydrated=true}render(){return s(i,{key:"3c9284a4fdbf445f402693b15c5269c8e5b98372",hydrated:this.hydrated,class:this.h.classes([m.root,this.disabled&&m.disabled]),size:this.size},s("gov-button",Object.assign({key:"db793476b0b8ed5ecc44dd2191b3cf26c0a97e86",color:"primary",size:this.size,type:"link",disabled:this.disabled,"onGov-click":t=>{t.stopPropagation();t.preventDefault();this.open=!this.open}},this.inheritedAttributes,{identifier:this.triggerId,"aria-controls":this.contentId,"aria-expanded":r(this.open),"aria-haspopup":"true"}),this.label,s("gov-icon",{key:"c230a7d2553c0858ddf24c6f9c7afbc249cd7f8e",slot:"icon-end",name:this.open?"chevron-up":"chevron-down",type:"components"})),s("div",{key:"64e787e14f8773dae11f0e54658984f3622b8b47",class:m.content,hidden:!this.open,id:this.contentId,"aria-labelledby":this.triggerId,"aria-hidden":r(!this.open)},s("slot",{key:"1e09e5a7242946af30012b68beb38119865003ec"})))}get host(){return e(this)}static get watchers(){return{size:["validateSize"]}}};export{v as gov_collapsible};
//# sourceMappingURL=p-ae6d0bcd.entry.js.map