import{x as i,G as h,Q as g,a4 as f,b as y,Z as _,aq as x,o as c,f as d,F as b,r as k,l as p,h as B,t as C,u as H,ar as S,c as q,j as A}from"./entry.5c8819da.js";const w=()=>{const r=i(),s=i([]),a=i([]),u=e=>e.forEach(o=>{const n=o.target.id;o.isIntersecting?s.value.push(n):s.value=s.value.filter(m=>m!==n)}),l=e=>e.forEach(o=>{r.value.observe(o)});return h(s,(e,o)=>{e.length===0?a.value=o:a.value=e}),g(()=>r.value=new IntersectionObserver(u)),f(()=>{var e;return(e=r.value)==null?void 0:e.disconnect()}),{visibleHeadings:s,activeHeadings:a,updateHeadings:l}},T=["href","onClick"],D=y({__name:"DocsTocLinks",props:{links:{type:Array,default:()=>[]}},emits:["move"],setup(r,{emit:s}){const a=_(),u=x(),{activeHeadings:l,updateHeadings:e}=w();h(()=>a.path,()=>{setTimeout(()=>{e([...document.querySelectorAll(".document-driven-page h1, .docus-content h1"),...document.querySelectorAll(".document-driven-page h2, .docus-content h2"),...document.querySelectorAll(".document-driven-page h3, .docus-content h3"),...document.querySelectorAll(".document-driven-page h4, .docus-content h4")])},300)},{immediate:!0});const o=n=>{u.push(`#${n}`),s("move",n)};return(n,m)=>{const v=D;return c(),d("ul",null,[(c(!0),d(b,null,k(r.links,t=>(c(),d("li",{key:t.text,class:p(["min-w-0 group",[{"pl-3":t.depth===3,"pl-6":t.depth===4}]])},[B("a",{href:`#${t.id}`,class:p(["block py-1 text-sm truncate lg:pr-3",[H(l).includes(t.id)?"text-primary-500":"u-text-gray-500 hover:u-text-gray-900"]]),onClick:S(E=>o(t.id),["prevent"])},C(t.text),11,T),t.children?(c(),q(v,{key:0,links:t.children},null,8,["links"])):A("",!0)],2))),128))])}}});export{D as _};
