import{r as d,j as I}from"./vendor-react-wBh_31cN.js";import{dz as S}from"./index-dNe6i2rS.js";var p=new Map,g=new WeakMap,w=0,V=void 0;function j(e){return e?(g.has(e)||(w+=1,g.set(e,w.toString())),g.get(e)):"0"}function B(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?j(e.root):e[t]}`).toString()}function M(e){const t=B(e);let n=p.get(t);if(!n){const i=new Map;let u;const o=new IntersectionObserver(s=>{s.forEach(r=>{var c;const l=r.isIntersecting&&u.some(f=>r.intersectionRatio>=f);e.trackVisibility&&typeof r.isVisible>"u"&&(r.isVisible=l),(c=i.get(r.target))==null||c.forEach(f=>{f(l,r)})})},e);u=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:i},p.set(t,n)}return n}function _(e,t,n={},i=V){if(typeof window.IntersectionObserver>"u"&&i!==void 0){const c=e.getBoundingClientRect();return t(i,{isIntersecting:i,target:e,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:c,intersectionRect:c,rootBounds:c}),()=>{}}const{id:u,observer:o,elements:s}=M(n),r=s.get(e)||[];return s.has(e)||s.set(e,r),r.push(t),o.observe(e),function(){r.splice(r.indexOf(t),1),r.length===0&&(s.delete(e),o.unobserve(e)),s.size===0&&(o.disconnect(),p.delete(u))}}function O({threshold:e,delay:t,trackVisibility:n,rootMargin:i,root:u,triggerOnce:o,skip:s,initialInView:r,fallbackInView:c,onChange:l}={}){var f;const[h,C]=d.useState(null),b=d.useRef(l),[R,y]=d.useState({inView:!!r,entry:void 0});b.current=l,d.useEffect(()=>{if(s||!h)return;let v;return v=_(h,(E,m)=>{y({inView:E,entry:m}),b.current&&b.current(E,m),m.isIntersecting&&o&&v&&(v(),v=void 0)},{root:u,rootMargin:i,threshold:e,trackVisibility:n,delay:t},c),()=>{v&&v()}},[Array.isArray(e)?e.toString():e,h,u,i,o,s,n,c,t]);const x=(f=R.entry)==null?void 0:f.target,A=d.useRef(void 0);!h&&x&&!o&&!s&&A.current!==x&&(A.current=x,y({inView:!!r,entry:void 0}));const a=[C,R.inView,R.entry];return a.ref=a[0],a.inView=a[1],a.entry=a[2],a}const N=({name:e,children:t})=>{const{setVisibility:n,clear:i}=d.useContext(S),{ref:u}=O({threshold:[0,1],rootMargin:"0% 0% 0% 0%",root:document.getElementById("content"),onChange:(o,s)=>{n({anchor:e,visibility:s.intersectionRatio})}});return d.useEffect(()=>i,[i]),I.jsx("div",{ref:u,id:e,className:"scroll-mt-[5vh] no-underline",children:t})},$=({children:e})=>I.jsx("div",{className:"flex flex-col gap-5 pb-[60vh]",children:e});export{$ as A,N as a};
