import{x as E,z as x,d as P,ae as V,i as u,at as z,K as R,E as B,y as N,O as g,ao as $,Q as C,bx as A,Z as I,am as D,af as H,S as K,ap as j,aw as k,a3 as M,a1 as Q,aA as Y}from"./index.afa1b71c.js";import{c as S,C as Z}from"./index.8fb41b14.js";const[T,q]=E("collapse"),_=Symbol(T),F={border:x,accordion:Boolean,modelValue:{type:[String,Number,Array],default:""}};var G=P({name:T,props:F,emits:["change","update:modelValue"],setup(t,{emit:o,slots:n}){const{linkChildren:d}=V(_),s=e=>{o("change",e),o("update:modelValue",e)};return d({toggle:(e,l)=>{const{accordion:r,modelValue:i}=t;s(r?e===i?"":e:l?i.concat(e):i.filter(f=>f!==e))},isExpanded:e=>{const{accordion:l,modelValue:r}=t;return l?r===e:r.includes(e)}}),()=>{var e;return u("div",{class:[q(),{[z]:t.border}]},[(e=n.default)==null?void 0:e.call(n)])}}});const te=R(G),[J,p]=E("collapse-item"),U=["icon","title","value","label","right-icon"],W=B({},S,{name:N,isLink:x,disabled:Boolean,readonly:Boolean,lazyRender:x});var X=P({name:J,props:W,setup(t,{slots:o}){const n=g(),d=g(),{parent:s,index:m}=$(_);if(!s)return;const h=C(()=>{var a;return(a=t.name)!=null?a:m.value}),e=C(()=>s.isExpanded(h.value)),l=g(e.value),r=A(()=>l.value||!t.lazyRender),i=()=>{e.value?n.value&&(n.value.style.height=""):l.value=!1};I(e,(a,v)=>{if(v===null)return;a&&(l.value=!0),(a?K:j)(()=>{if(!d.value||!n.value)return;const{offsetHeight:c}=d.value;if(c){const y=`${c}px`;n.value.style.height=a?"0":y,D(()=>{n.value&&(n.value.style.height=a?y:"0")})}else i()})});const f=(a=!e.value)=>{s.toggle(h.value,a)},w=()=>{!t.disabled&&!t.readonly&&f()},L=()=>{const{border:a,disabled:v,readonly:b}=t,c=k(t,Object.keys(S));return b&&(c.isLink=!1),(v||b)&&(c.clickable=!1),u(Z,M({role:"button",class:p("title",{disabled:v,expanded:e.value,borderless:!a}),"aria-expanded":String(e.value),onClick:w},c),k(o,U))},O=r(()=>{var a;return Q(u("div",{ref:n,class:p("wrapper"),onTransitionend:i},[u("div",{ref:d,class:p("content")},[(a=o.default)==null?void 0:a.call(o)])]),[[Y,l.value]])});return H({toggle:f}),()=>u("div",{class:[p({border:m.value&&t.border})]},[L(),O()])}});const ne=R(X);export{te as C,ne as a};
