import{r as n}from"./react-vendor-0bvDbF03.js";import{aa as A,ah as O,aI as S,a1 as m,ac as D,ad as M,ab as L,an as k}from"./index-DmqBj0U5.js";import{j as c}from"./query-vendor-CZu0EHPe.js";var v="Collapsible",[F,z]=A(v),[B,g]=F(v),I=n.forwardRef((e,s)=>{const{__scopeCollapsible:r,open:o,defaultOpen:t,disabled:l,onOpenChange:i,...f}=e,[p=!1,d]=O({prop:o,defaultProp:t,onChange:i});return c.jsx(B,{scope:r,disabled:l,contentId:S(),open:p,onOpenToggle:n.useCallback(()=>d(C=>!C),[d]),children:c.jsx(m.div,{"data-state":R(p),"data-disabled":l?"":void 0,...f,ref:s})})});I.displayName=v;var T="CollapsibleTrigger",j=n.forwardRef((e,s)=>{const{__scopeCollapsible:r,...o}=e,t=g(T,r);return c.jsx(m.button,{type:"button","aria-controls":t.contentId,"aria-expanded":t.open||!1,"data-state":R(t.open),"data-disabled":t.disabled?"":void 0,disabled:t.disabled,...o,ref:s,onClick:D(e.onClick,t.onOpenToggle)})});j.displayName=T;var x="CollapsibleContent",w=n.forwardRef((e,s)=>{const{forceMount:r,...o}=e,t=g(x,e.__scopeCollapsible);return c.jsx(M,{present:r||t.open,children:({present:l})=>c.jsx(G,{...o,ref:s,present:l})})});w.displayName=x;var G=n.forwardRef((e,s)=>{const{__scopeCollapsible:r,present:o,children:t,...l}=e,i=g(x,r),[f,p]=n.useState(o),d=n.useRef(null),C=L(s,d),h=n.useRef(0),y=h.current,N=n.useRef(0),P=N.current,b=i.open||f,E=n.useRef(b),u=n.useRef();return n.useEffect(()=>{const a=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(a)},[]),k(()=>{const a=d.current;if(a){u.current=u.current||{transitionDuration:a.style.transitionDuration,animationName:a.style.animationName},a.style.transitionDuration="0s",a.style.animationName="none";const _=a.getBoundingClientRect();h.current=_.height,N.current=_.width,E.current||(a.style.transitionDuration=u.current.transitionDuration,a.style.animationName=u.current.animationName),p(o)}},[i.open,o]),c.jsx(m.div,{"data-state":R(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!b,...l,ref:C,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":P?`${P}px`:void 0,...e.style},children:b&&t})});function R(e){return e?"open":"closed"}var J=I,K=j,Q=w;export{Q as C,J as R,K as T,j as a,w as b,z as c};
//# sourceMappingURL=index-Doa5m1Nz.js.map