import{r as n,j as c,P as v,a as D,n as M,o as L,v as k,q as z,C as F,p as $,_ as q}from"./index-D5aSL5Lk.js";var B="Separator",T="horizontal",G=["horizontal","vertical"],_=n.forwardRef((e,o)=>{const{decorative:r,orientation:a=T,...t}=e,s=H(a)?a:T,d=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(v.div,{"data-orientation":s,...d,...t,ref:o})});_.displayName=B;function H(e){return G.includes(e)}var w=_;const U=n.forwardRef(({className:e,orientation:o="horizontal",decorative:r=!0,...a},t)=>c.jsx(w,{ref:t,decorative:r,orientation:o,className:D("shrink-0 bg-border",o==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...a}));U.displayName=w.displayName;var C="Collapsible",[V,W]=M(C),[J,h]=V(C),A=n.forwardRef((e,o)=>{const{__scopeCollapsible:r,open:a,defaultOpen:t,disabled:s,onOpenChange:l,...d}=e,[u,p]=L({prop:a,defaultProp:t??!1,onChange:l,caller:C});return c.jsx(J,{scope:r,disabled:s,contentId:k(),open:u,onOpenToggle:n.useCallback(()=>p(b=>!b),[p]),children:c.jsx(v.div,{"data-state":x(u),"data-disabled":s?"":void 0,...d,ref:o})})});A.displayName=C;var I="CollapsibleTrigger",S=n.forwardRef((e,o)=>{const{__scopeCollapsible:r,...a}=e,t=h(I,r);return c.jsx(v.button,{type:"button","aria-controls":t.contentId,"aria-expanded":t.open||!1,"data-state":x(t.open),"data-disabled":t.disabled?"":void 0,disabled:t.disabled,...a,ref:o,onClick:z(e.onClick,t.onOpenToggle)})});S.displayName=I;var R="CollapsibleContent",j=n.forwardRef((e,o)=>{const{forceMount:r,...a}=e,t=h(R,e.__scopeCollapsible);return c.jsx(F,{present:r||t.open,children:({present:s})=>c.jsx(K,{...a,ref:o,present:s})})});j.displayName=R;var K=n.forwardRef((e,o)=>{const{__scopeCollapsible:r,present:a,children:t,...s}=e,l=h(R,r),[d,u]=n.useState(a),p=n.useRef(null),b=$(o,p),g=n.useRef(0),N=g.current,y=n.useRef(0),P=y.current,m=l.open||d,E=n.useRef(m),f=n.useRef(void 0);return n.useEffect(()=>{const i=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(i)},[]),q(()=>{const i=p.current;if(i){f.current=f.current||{transitionDuration:i.style.transitionDuration,animationName:i.style.animationName},i.style.transitionDuration="0s",i.style.animationName="none";const O=i.getBoundingClientRect();g.current=O.height,y.current=O.width,E.current||(i.style.transitionDuration=f.current.transitionDuration,i.style.animationName=f.current.animationName),u(a)}},[l.open,a]),c.jsx(v.div,{"data-state":x(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!m,...s,ref:b,style:{"--radix-collapsible-content-height":N?`${N}px`:void 0,"--radix-collapsible-content-width":P?`${P}px`:void 0,...e.style},children:m&&t})});function x(e){return e?"open":"closed"}var X=A,Y=S,Z=j;export{Z as C,X as R,U as S,Y as T,S as a,j as b,W as c};