import{r as o,j as n,ca as x}from"./main-634.js";function H({children:l,open:t,overflw:i="auto",classNames:g=""}){const[r,e]=o.useState(t?"auto":0),[a,d]=o.useState(t||!1),s=o.useRef(null);o.useEffect(()=>{d(t)},[t]);const f=u=>{const c=window.getComputedStyle(u),m=parseFloat(c.marginTop)+parseFloat(c.marginBottom);return Math.ceil(u.offsetHeight+m)},h=()=>e(f(s.current));return n.jsx("div",{style:{height:r,transition:"height 300ms",overflow:r==="auto"?i:"hidden"},children:n.jsx(x,{nodeRef:s,in:a,timeout:300,onEntering:h,onEntered:()=>e("auto"),onExit:()=>e(s.current.offsetHeight),onExiting:()=>e(0),unmountOnExit:!0,style:{overflow:a?i:"hidden"},children:n.jsx("div",{ref:s,className:`body ${g}`,children:l})})})}export{H as G};
