import{j as e}from"./jsx-runtime.D_zvdyIk.js";import{u as c,a as d,b as m,c as p,H as u}from"./HeadingList.CneewJt8.js";import"./index.BIRwh3HZ.js";import"./modal.CmyA2O2l.js";import{u as x}from"./useTranslation.Dg7DwAC5.js";import"./utils.BZbvJs_N.js";import"./_commonjsHelpers.CqkleIqs.js";import"./index.BHh4vvK5.js";import"./index.3whys8t3.js";import"./index.RTTH55m1.js";import"./utils.D6Ui05B2.js";import"./site-config.CgQ_bxrG.js";import"./site.Deo0TYgJ.js";const f=120;function N({defaultExpanded:s=!1,enableNumbering:a=!0}={}){const{t:o}=x(),t=c(),r=d({offsetTop:f}),{expandedIds:i,setExpandedIds:n}=m({headings:t,activeId:r,defaultExpanded:s}),l=p({headings:t,setExpandedIds:n});return t.length===0?e.jsx("div",{className:"py-6 text-center text-muted-foreground",children:e.jsx("div",{className:"text-sm",children:o("toc.empty")})}):e.jsx("nav",{className:`toc-container vertical-scrollbar scroll-gutter-stable flex h-full flex-col gap-2 overflow-auto pr-1 [--scrollbar-width:0.25rem] ${a?"":"toc-no-numbering"}`,"aria-label":o("toc.title"),children:e.jsx(u,{headings:t,depth:0,activeId:r,expandedIds:i,onHeadingClick:l})})}export{N as TableOfContents};
