boltdocs 2.5.6 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/bin/boltdocs.js +2 -2
  2. package/dist/client/index.cjs +6 -0
  3. package/dist/client/{index.d.mts → index.d.cts} +134 -252
  4. package/dist/client/index.d.ts +135 -253
  5. package/dist/client/index.js +1 -1
  6. package/dist/client/theme/neutral.css +90 -50
  7. package/dist/node/cli-entry.cjs +2 -2
  8. package/dist/node/cli-entry.mjs +2 -2
  9. package/dist/node/index.cjs +1 -1
  10. package/dist/node/index.d.cts +150 -205
  11. package/dist/node/index.d.mts +150 -205
  12. package/dist/node/index.mjs +1 -1
  13. package/dist/node-BgvNl2Ay.mjs +89 -0
  14. package/dist/node-vkbb0MK7.cjs +89 -0
  15. package/dist/{package-OFZf0s2j.mjs → package-CR0HF9x3.mjs} +1 -1
  16. package/dist/{package-BY8Jd2j4.cjs → package-Dgmsc_l5.cjs} +1 -1
  17. package/dist/search-dialog-3lvKsbVG.js +6 -0
  18. package/dist/search-dialog-DMK5OpgH.cjs +6 -0
  19. package/dist/use-search-C9bxCqfF.js +6 -0
  20. package/dist/use-search-DcfZSunO.cjs +6 -0
  21. package/package.json +19 -22
  22. package/src/client/app/config-context.tsx +38 -5
  23. package/src/client/app/doc-page.tsx +34 -0
  24. package/src/client/app/mdx-component.tsx +2 -3
  25. package/src/client/app/mdx-components-context.tsx +27 -2
  26. package/src/client/app/routes-context.tsx +34 -0
  27. package/src/client/app/scroll-handler.tsx +7 -4
  28. package/src/client/app/theme-context.tsx +71 -67
  29. package/src/client/components/default-layout.tsx +13 -14
  30. package/src/client/components/docs-layout.tsx +1 -2
  31. package/src/client/components/icons-dev.tsx +36 -5
  32. package/src/client/components/mdx/admonition.tsx +11 -27
  33. package/src/client/components/mdx/badge.tsx +1 -1
  34. package/src/client/components/mdx/button.tsx +3 -3
  35. package/src/client/components/mdx/card.tsx +1 -1
  36. package/src/client/components/mdx/code-block.tsx +90 -80
  37. package/src/client/components/mdx/component-preview.tsx +1 -5
  38. package/src/client/components/mdx/component-props.tsx +1 -1
  39. package/src/client/components/mdx/field.tsx +4 -5
  40. package/src/client/components/mdx/file-tree.tsx +6 -3
  41. package/src/client/components/mdx/hooks/use-code-block.ts +2 -2
  42. package/src/client/components/mdx/image.tsx +1 -1
  43. package/src/client/components/mdx/link.tsx +2 -2
  44. package/src/client/components/mdx/list.tsx +1 -1
  45. package/src/client/components/mdx/table.tsx +1 -1
  46. package/src/client/components/mdx/tabs.tsx +1 -1
  47. package/src/client/components/primitives/breadcrumbs.tsx +1 -7
  48. package/src/client/components/primitives/button-group.tsx +1 -1
  49. package/src/client/components/primitives/button.tsx +1 -1
  50. package/src/client/components/primitives/code-block.tsx +113 -0
  51. package/src/client/components/primitives/link.tsx +23 -41
  52. package/src/client/components/primitives/menu.tsx +5 -6
  53. package/src/client/components/primitives/navbar.tsx +6 -18
  54. package/src/client/components/primitives/navigation-menu.tsx +4 -4
  55. package/src/client/components/primitives/on-this-page.tsx +6 -10
  56. package/src/client/components/primitives/page-nav.tsx +4 -9
  57. package/src/client/components/primitives/popover.tsx +1 -1
  58. package/src/client/components/primitives/search-dialog.tsx +3 -6
  59. package/src/client/components/primitives/sidebar.tsx +80 -22
  60. package/src/client/components/primitives/skeleton.tsx +1 -1
  61. package/src/client/components/primitives/tabs.tsx +4 -11
  62. package/src/client/components/primitives/tooltip.tsx +3 -3
  63. package/src/client/components/ui-base/breadcrumbs.tsx +4 -6
  64. package/src/client/components/ui-base/copy-markdown.tsx +2 -7
  65. package/src/client/components/ui-base/github-stars.tsx +2 -2
  66. package/src/client/components/ui-base/head.tsx +58 -51
  67. package/src/client/components/ui-base/loading.tsx +2 -2
  68. package/src/client/components/ui-base/navbar.tsx +12 -14
  69. package/src/client/components/ui-base/not-found.tsx +1 -1
  70. package/src/client/components/ui-base/on-this-page.tsx +6 -6
  71. package/src/client/components/ui-base/page-nav.tsx +4 -8
  72. package/src/client/components/ui-base/search-dialog.tsx +10 -8
  73. package/src/client/components/ui-base/sidebar.tsx +76 -23
  74. package/src/client/components/ui-base/tabs.tsx +9 -8
  75. package/src/client/components/ui-base/theme-toggle.tsx +2 -2
  76. package/src/client/hooks/use-i18n.ts +3 -3
  77. package/src/client/hooks/use-localized-to.ts +1 -1
  78. package/src/client/hooks/use-navbar.ts +8 -6
  79. package/src/client/hooks/use-routes.ts +19 -11
  80. package/src/client/hooks/use-search.ts +1 -1
  81. package/src/client/hooks/use-sidebar.ts +48 -2
  82. package/src/client/hooks/use-tabs.ts +6 -2
  83. package/src/client/hooks/use-version.ts +3 -3
  84. package/src/client/index.ts +22 -22
  85. package/src/client/ssg/boltdocs-shell.tsx +127 -0
  86. package/src/client/ssg/create-routes.tsx +179 -0
  87. package/src/client/ssg/index.ts +3 -0
  88. package/src/client/ssg/mdx-page.tsx +37 -0
  89. package/src/client/store/boltdocs-context.tsx +46 -99
  90. package/src/client/theme/neutral.css +90 -50
  91. package/src/client/types.ts +5 -33
  92. package/src/client/utils/react-to-text.ts +34 -0
  93. package/dist/cache-Cr8W2zgZ.cjs +0 -6
  94. package/dist/cache-DFdakSmR.mjs +0 -6
  95. package/dist/client/index.mjs +0 -6
  96. package/dist/client/ssr.cjs +0 -6
  97. package/dist/client/ssr.d.cts +0 -80
  98. package/dist/client/ssr.d.mts +0 -80
  99. package/dist/client/ssr.mjs +0 -6
  100. package/dist/node-CWXme96p.mjs +0 -73
  101. package/dist/node-VYfhzGrh.cjs +0 -73
  102. package/dist/search-dialog-BeNyI_KQ.mjs +0 -6
  103. package/dist/search-dialog-dYsCAk5S.js +0 -6
  104. package/dist/use-search-D25n0PrV.mjs +0 -6
  105. package/dist/use-search-WuzdH1cJ.js +0 -6
  106. package/src/client/app/index.tsx +0 -348
  107. package/src/client/app/mdx-page.tsx +0 -15
  108. package/src/client/app/preload.tsx +0 -66
  109. package/src/client/app/router.tsx +0 -30
  110. package/src/client/integrations/codesandbox.ts +0 -179
  111. package/src/client/integrations/index.ts +0 -1
  112. package/src/client/ssr.tsx +0 -65
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- import e,{Children as t,createContext as n,isValidElement as r,startTransition as i,use as a,useCallback as o,useContext as s,useEffect as c,useLayoutEffect as l,useMemo as u,useRef as d,useState as f}from"react";import p from"react-dom/server";import{StaticRouter as m}from"react-router-dom/server.js";import"react-dom/client";import{Outlet as h,Route as g,Routes as _,useHref as v,useLocation as y,useNavigate as b}from"react-router-dom";import{AlertTriangle as ee,ArrowLeft as x,Bookmark as te,Check as S,ChevronDown as C,ChevronLeft as ne,ChevronRight as w,ChevronUp as re,ChevronsLeft as ie,ChevronsRight as ae,Circle as oe,Copy as T,Dot as se,ExternalLink as ce,File as le,FileCode as ue,FileImage as de,FileText as fe,Flame as pe,Folder as me,Info as he,Lightbulb as ge,Link as _e,ShieldAlert as ve,Zap as ye}from"lucide-react";import*as E from"react-aria-components";import{Link as be,RouterProvider as xe}from"react-aria-components";import{Fragment as D,jsx as O,jsxs as k}from"react/jsx-runtime";import{clsx as Se}from"clsx";import{twMerge as Ce}from"tailwind-merge";import A from"virtual:boltdocs-layout";import{cva as j}from"class-variance-authority";import we from"virtual:boltdocs-mdx-components";var Te=Object.defineProperty,Ee=(e,t)=>{let n={};for(var r in e)Te(n,r,{get:e[r],enumerable:!0});return t||Te(n,Symbol.toStringTag,{value:`Module`}),n};const De=n(null);function M(){let e=a(De);if(!e)throw Error(`useConfig must be used within a ConfigProvider`);return e}const Oe=n({preload:()=>{},routes:[]});function ke(){return a(Oe)}function Ae({routes:e,modules:t,children:n}){let r=d(null),i=o(n=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{let r=n.split(`#`)[0].split(`?`)[0],i=e.find(e=>e.path===r||r===`/`&&e.path===``);if(i?.filePath){let e=Object.keys(t).find(e=>e.endsWith(`/`+i.filePath));e&&t[e]().catch(e=>{console.error(`[boltdocs] Failed to preload route ${n}:`,e)})}},100)},[e,t]);return O(Oe.Provider,{value:{preload:i,routes:e},children:n})}const je=n(void 0),Me=`boltdocs-storage`;function Ne(){try{let e=localStorage.getItem(Me);if(e){let t=JSON.parse(e);return t?.state||t}}catch{}return{}}function Pe({children:e}){let t=Ne(),[n,r]=f(t.currentLocale),[i,a]=f(t.currentVersion),[s,l]=f(!1);c(()=>{l(!0)},[]),c(()=>{if(s){let e={currentLocale:n,currentVersion:i};try{localStorage.setItem(Me,JSON.stringify({state:e}))}catch{}}},[n,i,s]);let u={currentLocale:n,currentVersion:i,hasHydrated:s,setLocale:o(e=>{r(e)},[]),setVersion:o(e=>{a(e)},[]),setHasHydrated:o(e=>{l(e)},[])};return O(je.Provider,{value:u,children:e})}function Fe(){let e=s(je);if(!e)throw Error(`useBoltdocsContext must be used within a BoltdocsProvider`);return e}function N(e){return e(Fe())}function P(){let{routes:e}=ke(),t=M(),n=y(),r=N(e=>e.currentLocale),i=N(e=>e.currentVersion),a=N(e=>e.hasHydrated),o=e.find(e=>e.path===n.pathname),s=t.i18n?o?.locale||(a?r:void 0)||t.i18n.defaultLocale:void 0,c=t.versions?o?.version||(a?i:void 0)||t.versions.defaultVersion:void 0,l=e.filter(n=>{let r=t.i18n?(n.locale||t.i18n.defaultLocale)===s:!0,i=t.versions?(n.version||t.versions.defaultVersion)===c:!0;if(!(r&&i))return!1;let a=t.i18n;if(a){let t=!!o?.locale,r=!!n.locale;if(e.some(e=>e!==n&&e.filePath===n.filePath&&e.version===n.version&&(e.locale||a.defaultLocale)===(n.locale||a.defaultLocale))&&t!==r)return!1}return!0}),u=t.i18n?.localeConfigs?.[s]?.label||t.i18n?.locales[s]||s,d=t.versions?.versions.find(e=>e.path===c)?.label||c;return{routes:l,allRoutes:e,currentRoute:o,currentLocale:s,currentLocaleLabel:u,availableLocales:t.i18n?Object.entries(t.i18n.locales).map(([e,n])=>({key:e,label:t.i18n?.localeConfigs?.[e]?.label||n,isCurrent:e===s})):[],currentVersion:c,currentVersionLabel:d,availableVersions:t.versions?t.versions.versions.map(e=>({key:e.path,label:e.label,isCurrent:e.path===c})):[],config:t}}function Ie(e){let t=M(),{currentLocale:n,currentVersion:r}=P();if(!t||typeof e!=`string`||e.startsWith(`http`)||e.startsWith(`//`))return e;let i=t.i18n,a=t.versions;if(!i&&!a)return e;let o=e.startsWith(`/docs`),s=e.split(`/`).filter(Boolean),c=0;s[c]===`docs`&&c++,a&&s.length>c&&a.versions.find(e=>e.path===s[c])&&c++,i&&s.length>c&&i.locales[s[c]]&&c++;let l=s.slice(c),u=[];o&&(u.push(`docs`),a&&r&&u.push(r)),i&&n&&n!==i.defaultLocale&&u.push(n),u.push(...l);let d=`/${u.join(`/`)}`;return d.length>1&&d.endsWith(`/`)?d.slice(0,-1):d||`/`}function F(...e){return Ce(Se(e))}const I=e.forwardRef((e,t)=>{let{href:n,prefetch:r=`hover`,onMouseEnter:i,onFocus:a,...o}=e,s=Ie(n??``),{preload:c}=ke(),l=e=>{i?.(e),r===`hover`&&typeof s==`string`&&s.startsWith(`/`)&&c(s)},u=e=>{a?.(e),r===`hover`&&typeof s==`string`&&s.startsWith(`/`)&&c(s)};return O(be,{...o,ref:t,href:s,onMouseEnter:l,onFocus:u})});I.displayName=`Link`;const Le=e.forwardRef((e,t)=>{let{href:n,end:r=!1,className:i,children:a,...o}=e,s=y(),c=Ie(n??``),l=r?s.pathname===c:s.pathname.startsWith(c),u=typeof i==`function`?i({isActive:l}):F(i,l&&`active`),d=typeof a==`function`?a({isActive:l}):a;return O(I,{...o,ref:t,href:n,className:u,children:d})});Le.displayName=`NavLink`;function Re(){return O(`div`,{className:`flex items-center justify-center min-h-[60vh] text-center`,children:k(`div`,{className:`space-y-4`,children:[O(`span`,{className:`text-8xl font-black tracking-tighter text-primary-500/20`,children:`404`}),O(`h1`,{className:`text-2xl font-bold text-text-main`,children:`Page Not Found`}),O(`p`,{className:`text-sm text-text-muted max-w-sm mx-auto`,children:`The page you're looking for doesn't exist or has been moved.`}),k(I,{href:`/`,className:`inline-flex items-center gap-2 rounded-lg bg-primary-500 px-5 py-2.5 text-sm font-semibold text-white outline-none transition-all hover:brightness-110 hover:shadow-lg focus-visible:ring-2 focus-visible:ring-primary-500/30`,children:[O(x,{size:16}),` Go to Home`]})]})})}const ze=n(void 0);function Be({children:e}){let[t,n]=f(`system`),[r,i]=f(`dark`),[a,o]=f(!1);return c(()=>{o(!0);let e=localStorage.getItem(`boltdocs-theme`),t=e===`light`||e===`dark`||e===`system`?e:`system`;n(t);let r=window.matchMedia(`(prefers-color-scheme: dark)`);((e,t)=>{i(e===`system`?t?`dark`:`light`:e)})(t,r.matches);let a=e=>{i(t=>(localStorage.getItem(`boltdocs-theme`)||`system`)===`system`?e.matches?`dark`:`light`:t)};return r.addEventListener(`change`,a),()=>r.removeEventListener(`change`,a)},[]),c(()=>{if(!a)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`).matches,n=t===`system`?e?`dark`:`light`:t;i(n);let r=document.documentElement;n===`light`?(r.classList.add(`theme-light`),r.dataset.theme=`light`):(r.classList.remove(`theme-light`),r.dataset.theme=`dark`)},[t,a]),O(ze.Provider,{value:{theme:t,resolvedTheme:r,setTheme:e=>{n(e),localStorage.setItem(`boltdocs-theme`,e)}},children:e})}function Ve(){let e=a(ze);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e}function He({children:e}){let t=b();return O(xe,{navigate:(e,n)=>{i(()=>{t(e,n)})},useHref:v,children:e})}function Ue(){let{pathname:e,hash:t}=y();return l(()=>{let e=document.querySelector(`.boltdocs-content`)||window,n=()=>e===window?window.scrollY:e.scrollTop,r=(t,n=`auto`)=>{e===window?window.scrollTo({top:t,behavior:n}):e.scrollTo({top:t,behavior:n})};if(t){let i=t.replace(`#`,``),a=document.getElementById(i);if(a){let t=e===window?0:e.getBoundingClientRect().top;r(a.getBoundingClientRect().top-t-80+n(),`smooth`);return}}r(0)},[e,t]),null}function We(){return O(A,{children:O(h,{})})}const Ge=n({});function Ke(){return a(Ge)}function qe({components:e,children:t}){return O(Ge.Provider,{value:e,children:t})}function Je({Component:e}){return O(e,{components:Ke()})}const L=j(`flex flex-row items-center justify-center w-auto font-semibold tracking-tight no-underline whitespace-nowrap select-none outline-none transition-all duration-200 cursor-pointer pressed:scale-[0.97] hover:-translate-y-px leading-none`,{variants:{variant:{primary:`bg-primary-500 text-white shadow-md hover:brightness-110 hover:shadow-lg`,secondary:`bg-bg-surface text-text-main border border-border-subtle hover:bg-bg-muted hover:border-border-strong`,outline:`bg-transparent text-text-main border border-border-strong hover:bg-bg-surface hover:border-primary-500`,ghost:`bg-transparent text-text-muted hover:bg-bg-surface hover:text-text-main`,danger:`bg-[var(--color-danger-500)]/10 text-[var(--color-danger-500)] border border-[var(--color-danger-500)]/20 hover:bg-[var(--color-danger-500)]/15`,success:`bg-[var(--color-success-500)]/10 text-[var(--color-success-500)] border border-[var(--color-success-500)]/20 hover:bg-[var(--color-success-500)]/15`,warning:`bg-[var(--color-warning-500)]/10 text-[var(--color-warning-500)] border border-[var(--color-warning-500)]/20 hover:bg-[var(--color-warning-500)]/15`,info:`bg-[var(--color-info-500)]/10 text-[var(--color-info-500)] border border-[var(--color-info-500)]/20 hover:bg-[var(--color-info-500)]/15`,subtle:`bg-primary-500/10 text-primary-500 hover:bg-primary-500/20`,link:`bg-transparent text-primary-500 !p-0 !min-h-0 hover:underline`},size:{sm:`min-h-8 px-3.5 text-[0.8125rem] gap-1.5`,md:`min-h-10 px-5 text-[0.9375rem] gap-2`,lg:`min-h-12 px-7 text-[1.05rem] gap-2.5`},rounded:{none:`rounded-none`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,full:`rounded-full`},iconSize:{sm:`w-8 h-8 p-0`,md:`w-10 h-10 p-0`,lg:`w-12 h-12 p-0`},disabled:{true:`opacity-50 cursor-not-allowed pointer-events-none`,false:null}},defaultVariants:{variant:`primary`,size:`md`,rounded:`md`}}),R=({href:e,icon:t,iconPosition:n=`left`,isIconOnly:r,children:i,className:a,variant:o,size:s,rounded:c,iconSize:l,disabled:u,...d})=>{let f=r||!i&&!!t,p=f?O(`span`,{className:`inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]`,children:t}):k(D,{children:[t&&n===`left`&&O(`span`,{className:`inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]`,children:t}),O(`span`,{className:`flex items-center`,children:i}),t&&n===`right`&&O(`span`,{className:`inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]`,children:t})]});return e?O(E.Link,{href:e,className:F(L({variant:o,size:s,rounded:c,iconSize:f?l:void 0,disabled:u}),a),...d,children:p}):O(E.Button,{className:F(L({variant:o,size:s,rounded:c,iconSize:f?l:void 0,disabled:u}),a),...d,children:p})},Ye=({className:e,variant:t,size:n,rounded:r,iconSize:i,disabled:a,...o})=>O(R,{className:F(`group`,L({variant:t,size:n,rounded:r,iconSize:i,disabled:a,className:e})),...o}),Xe=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);return t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t),!0}};function Ze(e){let{title:t}=e,[n,r]=f(!1),[i,a]=f(!1),[s,l]=f(!1),u=d(null);M();let p=o(async()=>{Xe(u.current?.textContent??``),r(!0),setTimeout(()=>r(!1),2e3)},[]);return c(()=>{l((u.current?.textContent?.length??0)>120)},[e.children,e.highlightedHtml]),{copied:n,isExpanded:i,setIsExpanded:a,isExpandable:s,preRef:u,handleCopy:p,shouldTruncate:s&&!i}}function z(e){let{size:t=20,...n}=e;return{...n,width:t,height:t}}const Qe=e=>k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...z(e),children:[O(`title`,{children:`TypeScript`}),O(`path`,{fill:`#2563EB`,d:`M3.234 9.093V7.318h8.363v1.775H8.479V17.5H6.352V9.093H3.234zm15.263 1.153c-.04-.4-.21-.712-.512-.934-.301-.222-.71-.333-1.228-.333-.351 0-.648.05-.89.149-.242.096-.427.23-.557.403a.969.969 0 0 0-.189.586.838.838 0 0 0 .115.477c.086.136.204.254.353.353.149.097.321.181.517.254.195.07.404.13.626.179l.915.219c.444.1.852.232 1.223.397.371.166.693.37.965.612.271.242.482.527.631.855.152.328.23.704.234 1.129-.004.623-.163 1.163-.478 1.62-.311.454-.762.807-1.352 1.06-.587.248-1.294.372-2.123.372-.822 0-1.538-.126-2.147-.378-.607-.252-1.081-.624-1.422-1.118-.338-.497-.516-1.112-.532-1.845h2.083c.023.342.12.627.293.855.176.226.41.397.701.513a2.8 2.8 0 0 0 1 .168c.364 0 .68-.053.949-.159a1.45 1.45 0 0 0 .631-.442c.15-.189.224-.406.224-.651a.846.846 0 0 0-.204-.577c-.132-.156-.328-.288-.586-.398a5.964 5.964 0 0 0-.94-.298l-1.109-.278c-.858-.21-1.536-.536-2.033-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.491-1.615.335-.461.794-.82 1.377-1.08.584-.258 1.247-.387 1.99-.387.755 0 1.414.13 1.978.388.567.258 1.007.618 1.322 1.079.315.46.477.994.488 1.6h-2.064z`})]}),$e=e=>k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...z(e),children:[O(`title`,{children:`JavaScript`}),O(`path`,{fill:`#F59E0B`,d:`M8.383 7.318h2.127v7.1c0 .656-.147 1.226-.442 1.71a2.924 2.924 0 01-1.218 1.118c-.52.262-1.125.393-1.815.393-.613 0-1.17-.107-1.67-.323a2.67 2.67 0 01-1.183-.994c-.292-.448-.436-1.01-.433-1.686h2.143c.006.269.061.5.164.691.106.19.25.335.432.438.186.1.405.15.657.15.265 0 .488-.057.67-.17.186-.116.327-.285.423-.507.096-.222.145-.496.145-.82v-7.1zm9.43 2.928c-.04-.4-.21-.712-.511-.934-.302-.222-.711-.333-1.228-.333-.352 0-.648.05-.89.149-.242.096-.428.23-.557.403a.969.969 0 00-.19.586.838.838 0 00.115.477c.087.136.204.254.353.353.15.097.322.181.517.254.196.07.405.13.627.179l.915.219c.444.1.851.232 1.223.397.37.166.692.37.964.612s.482.527.631.855a2.7 2.7 0 01.234 1.129c-.003.623-.162 1.163-.477 1.62-.312.454-.763.807-1.353 1.06-.586.248-1.294.372-2.122.372-.822 0-1.538-.126-2.148-.378-.607-.252-1.08-.624-1.422-1.118-.338-.497-.515-1.112-.532-1.845h2.083c.023.342.121.627.293.855.176.226.41.397.702.513.295.112.628.168.999.168.364 0 .68-.053.95-.159.271-.106.482-.253.63-.442.15-.189.224-.406.224-.651a.846.846 0 00-.203-.577c-.133-.156-.329-.288-.587-.398a5.964 5.964 0 00-.94-.298l-1.108-.278c-.859-.21-1.537-.536-2.034-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.492-1.615.334-.461.793-.82 1.377-1.08.583-.258 1.246-.387 1.989-.387.755 0 1.415.13 1.978.388.567.258 1.008.618 1.323 1.079.314.46.477.994.487 1.6h-2.063z`})]}),et=e=>k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...z(e),children:[O(`title`,{children:`JSON`}),O(`path`,{fill:`#F59E0B`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),tt=e=>k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...z(e),children:[O(`title`,{children:`CSS`}),O(`path`,{fill:`#0EA5E9`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),nt=e=>k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...z(e),children:[O(`title`,{children:`HTML`}),O(`path`,{fill:`#EA580C`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),B=e=>k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...z(e),children:[O(`title`,{children:`React`}),O(`path`,{fill:`#0E8ADC`,d:`M12 13.677a1.677 1.677 0 100-3.354 1.677 1.677 0 000 3.354z`}),O(`path`,{stroke:`#0E8ADC`,d:`M12 15.436c4.97 0 9-1.538 9-3.436s-4.03-3.436-9-3.436S3 10.102 3 12s4.03 3.436 9 3.436z`}),O(`path`,{stroke:`#0E8ADC`,d:`M9.024 13.718c2.485 4.305 5.832 7.025 7.476 6.076 1.644-.949.961-5.208-1.524-9.512C12.491 5.977 9.144 3.257 7.5 4.206c-1.644.949-.961 5.208 1.524 9.512z`}),O(`path`,{stroke:`#0E8ADC`,d:`M9.024 10.282c-2.485 4.304-3.168 8.563-1.524 9.512 1.644.95 4.99-1.771 7.476-6.076 2.485-4.304 3.168-8.563 1.524-9.512-1.644-.95-4.99 1.771-7.476 6.076z`})]}),V=e=>k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...z(e),children:[O(`title`,{children:`Markdown`}),O(`path`,{fill:`#60A5FA`,d:`M3 15.714V8h2.323l2.322 2.836L9.968 8h2.322v7.714H9.968V11.29l-2.323 2.836-2.322-2.836v4.424H3zm14.516 0l-3.484-3.743h2.323V8h2.322v3.97H21l-3.484 3.744z`})]}),H=e=>k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...z(e),children:[O(`title`,{children:`Shell`}),O(`path`,{stroke:`#14B8A6`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M4.336 17l6-6-6-6M12.336 19h8`})]}),U=e=>k(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...z(e),children:[O(`title`,{children:`YAML`}),O(`path`,{fill:`#A78BFA`,d:`M6.533 5.864h2.755l2.654 5.011h.113l2.654-5.011h2.756l-4.245 7.522V17.5h-2.443v-4.114L6.533 5.864z`})]}),rt=({className:e,children:t,...n})=>O(E.Tooltip,{...n,offset:8,className:t=>F(`group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none`,`data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100`,`data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75`,`data-[placement=top]:slide-in-from-bottom-1`,`data-[placement=bottom]:slide-in-from-top-1`,`data-[placement=left]:slide-in-from-right-1`,`data-[placement=right]:slide-in-from-left-1`,typeof e==`function`?e(t):e),children:e=>k(D,{children:[O(E.OverlayArrow,{children:k(`svg`,{width:8,height:8,viewBox:`0 0 8 8`,className:`fill-bg-surface/90 stroke-border-subtle group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90`,children:[O(`title`,{children:`Arrow`}),O(`path`,{d:`M0 0 L4 4 L8 0`})]})}),typeof t==`function`?t(e):t]})}),W=({content:e,children:t,delay:n=500,closeDelay:r=0,...i})=>k(E.TooltipTrigger,{delay:n,closeDelay:r,children:[t,O(rt,{...i,children:e})]});W.Root=W,W.Content=rt;const it={ts:Qe,tsx:B,js:$e,jsx:B,json:et,css:tt,html:nt,md:V,mdx:V,bash:H,sh:H,yaml:U,yml:U};function G(e){let{children:t,hideCopy:n=!1,highlightedHtml:r,"data-highlighted-html":i,title:a,"data-lang":o,plain:s=!1,...c}=e,l=r||i;M();let u=e.lang||o||``,{copied:d,isExpanded:f,setIsExpanded:p,isExpandable:m,preRef:h,handleCopy:g,shouldTruncate:_}=Ze(e),v=it[u];return k(`div`,{className:F(`group relative overflow-hidden bg-(--color-code-bg)`,`contain-layout contain-paint`,{"my-6 rounded-lg border border-border-subtle":!s,"[&>pre]:max-h-62.5 [&>pre]:overflow-hidden":_},e.className),children:[a&&k(`div`,{className:`flex items-center gap-2 border-b border-border-subtle bg-bg-surface/50 px-4 py-2 text-[13px] font-medium text-text-muted`,children:[v?O(v,{size:14}):O(le,{size:14,className:`opacity-60`}),O(`span`,{children:a})]}),O(`div`,{className:`absolute top-3 right-4 z-50 flex items-center gap-2 transition-all duration-300 opacity-0 group-hover:opacity-100`,children:!n&&O(W,{content:d?`Copied!`:`Copy code`,children:O(E.Button,{onPress:g,className:F(`grid place-items-center size-8 bg-transparent outline-none cursor-pointer transition-all duration-200 hover:scale-110 active:scale-95 [&>svg]:size-4 [&>svg]:stroke-2`,d?`text-emerald-400`:`text-text-muted hover:text-text-main`),"aria-label":`Copy code`,children:O(d?S:T,{size:20})})})}),l?O(`div`,{ref:h,className:`shiki-wrapper [&>pre]:m-0! [&>pre]:rounded-none! [&>pre]:border-none! [&>pre]:bg-inherit! [&>pre>code]:grid! [&>pre>code]:p-5! [&>.shiki.shiki-themes]:bg-transparent!`,dangerouslySetInnerHTML:{__html:l}}):O(`pre`,{ref:h,className:`m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]`,...c,children:t}),m&&O(`div`,{className:F(_?`absolute bottom-0 inset-x-0 h-24 bg-linear-to-t from-(--color-code-bg) to-transparent flex items-end justify-center pb-4 z-10`:`relative flex justify-center py-4`),children:O(E.Button,{onPress:()=>p(!f),className:`rounded-full bg-bg-surface border border-border-subtle px-5 py-2 text-[0.8125rem] font-medium text-text-main outline-none cursor-pointer transition-all hover:bg-border-subtle hover:-translate-y-px backdrop-blur-md`,children:f?`Show less`:`Expand code`})})]})}function at({initialIndex:e=0,tabs:t}){let n=t[e]?.props.disabled?t.findIndex(e=>!e.props.disabled):e,[r,i]=f(n===-1?0:n),a=d([]),[s,l]=f({opacity:0,transform:`translateX(0)`,width:0});return c(()=>{let e=a.current[r];e&&l({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[r,t]),{active:r,setActive:i,tabRefs:a,indicatorStyle:s,handleKeyDown:o(e=>{let n=0;if(e.key===`ArrowRight`?n=1:e.key===`ArrowLeft`&&(n=-1),n!==0){let e=(r+n+t.length)%t.length;for(;t[e].props.disabled&&e!==r;)e=(e+n+t.length)%t.length;e!==r&&!t[e].props.disabled&&(i(e),a.current[e]?.focus())}},[r,t])}}const ot=j(`relative flex items-center border-b border-border-subtle gap-1 overflow-x-auto no-scrollbar`,{variants:{size:{default:`px-0`,compact:`px-2`}},defaultVariants:{size:`default`}}),st=j(`flex items-center gap-2 px-4 py-2.5 text-sm font-medium outline-none transition-all duration-200 cursor-pointer bg-transparent border-none select-none whitespace-nowrap`,{variants:{isActive:{true:`text-primary-500`,false:`text-text-muted hover:text-text-main`},isDisabled:{true:`opacity-40 pointer-events-none`,false:``}},defaultVariants:{isActive:!1,isDisabled:!1}});function ct({children:e}){return O(`div`,{className:`py-4`,children:typeof e==`string`?O(G,{className:`language-bash`,children:O(`code`,{children:e.trim()})}):e})}function lt({defaultIndex:e=0,children:n}){let i=u(()=>t.toArray(n).filter(e=>r(e)&&e.props?.label),[n]),{active:a,setActive:o,tabRefs:s,indicatorStyle:c}=at({initialIndex:e,tabs:i});return O(`div`,{className:`my-8 w-full group/tabs`,children:k(E.Tabs,{selectedKey:a.toString(),onSelectionChange:e=>o(Number(e)),className:`w-full`,children:[k(E.TabList,{"aria-label":`Content Tabs`,className:F(ot()),children:[i.map((e,t)=>{let{label:n,icon:r,disabled:i}=e.props,a=t.toString();return k(E.Tab,{id:a,isDisabled:i,ref:e=>{s.current[t]=e},className:({isSelected:e,isDisabled:t})=>F(st({isActive:e,isDisabled:t})),children:[!!r&&O(`span`,{className:`shrink-0 [&>svg]:w-4 [&>svg]:h-4`,children:r}),O(`span`,{children:n})]},a)}),O(`div`,{className:`absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none`,style:c,"aria-hidden":`true`})]}),i.map((e,t)=>O(E.TabPanel,{id:t.toString(),children:i[t]},t))]})})}function ut({src:e,poster:t,alt:n,children:r,controls:i,preload:a=`metadata`,...o}){let s=d(null),[l,u]=f(!1);return c(()=>{let e=s.current;if(!e)return;let t=new IntersectionObserver(([e])=>{e.isIntersecting&&(u(!0),t.disconnect())},{rootMargin:`200px`});return t.observe(e),()=>t.disconnect()},[]),O(`div`,{ref:s,className:`my-6 overflow-hidden rounded-lg border border-border-subtle`,children:l?k(`video`,{className:`block w-full h-auto`,src:e,poster:t,controls:!0,preload:a,playsInline:!0,...o,children:[r,`Your browser does not support the video tag.`]}):O(`div`,{className:`aspect-video bg-bg-surface animate-pulse`,role:`img`,"aria-label":n||`Video`})})}const dt=j(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-tight`,{variants:{variant:{default:`bg-bg-surface text-text-muted border-border-subtle`,primary:`bg-primary-500/15 text-primary-400 border-primary-500/20`,success:`bg-emerald-500/15 text-emerald-400 border-emerald-500/20`,warning:`bg-amber-500/15 text-amber-400 border-amber-500/20`,danger:`bg-red-500/15 text-red-400 border-red-500/20`,info:`bg-sky-500/15 text-sky-400 border-sky-500/20`}},defaultVariants:{variant:`default`}});function ft({variant:e=`default`,children:t,className:n=``,...r}){return O(`span`,{className:F(dt({variant:e}),n),...r,children:t})}const pt=j(`grid gap-4 my-6`,{variants:{cols:{1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,4:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-4`}},defaultVariants:{cols:3}});function mt({cols:e=3,children:t,className:n=``,...r}){return O(`div`,{className:F(pt({cols:e}),n),...r,children:t})}function ht({title:e,icon:t,href:n,children:r,className:i=``,...a}){let s=d(null),c=d(null),l=o(e=>{let t=s.current||c.current;if(!t)return;let{left:n,top:r}=t.getBoundingClientRect();t.style.setProperty(`--x`,`${e.clientX-n}px`),t.style.setProperty(`--y`,`${e.clientY-r}px`)},[]),u=k(D,{children:[O(`div`,{className:`pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 group-hover:opacity-100`,style:{background:`radial-gradient(400px circle at var(--x) var(--y), color-mix(in oklch, var(--color-primary-500), transparent 90%), transparent 80%)`}}),t&&O(`div`,{className:`mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-primary-500/10 text-primary-400 text-lg transition-transform duration-300 group-hover:scale-105 group-hover:-rotate-3`,children:t}),k(`div`,{className:`space-y-1.5`,children:[e&&O(`h3`,{className:`text-sm font-bold text-text-main`,children:e}),r&&O(`div`,{className:`text-sm text-text-muted leading-relaxed`,children:r})]})]}),f=F(`group relative block rounded-xl border border-border-subtle bg-bg-surface p-5 outline-none overflow-hidden`,`transition-all duration-200 hover:border-primary-500/40 hover:shadow-lg hover:shadow-primary-500/5`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,i);return n?O(E.Link,{ref:c,href:n,className:F(f,`no-underline cursor-pointer`),onMouseMove:l,...a,children:u}):O(`div`,{ref:s,role:`presentation`,className:f,onMouseMove:l,...a,children:u})}const gt={note:O(te,{size:18}),tip:O(ge,{size:18}),info:O(he,{size:18}),warning:O(ee,{size:18}),danger:O(ve,{size:18}),important:O(pe,{size:18}),caution:O(ye,{size:18})},_t={note:`Note`,tip:`Tip`,info:`Info`,warning:`Warning`,danger:`Danger`,important:`Important`,caution:`Caution`},vt=j(`py-4 px-4 rounded-lg`,{variants:{type:{note:`border-primary-400 bg-primary-500/5 text-primary-400`,tip:`border-emerald-500 bg-emerald-500/5 text-emerald-500`,info:`border-sky-500 bg-sky-500/5 text-sky-500`,warning:`border-amber-500 bg-amber-500/5 text-amber-500`,danger:`border-red-500 bg-red-500/5 text-red-500`,important:`border-orange-500 bg-orange-500/5 text-orange-500`,caution:`border-yellow-500 bg-yellow-500/5 text-yellow-500`}},defaultVariants:{type:`note`}});function K({type:e=`note`,title:t,children:n,className:r=``,...i}){return k(`div`,{className:F(vt({type:e}),r),role:e===`warning`||e===`danger`?`alert`:`note`,...i,children:[k(`div`,{className:`flex items-center flex-row gap-2 mb-2`,children:[O(`span`,{className:F(`shrink-0`,vt({type:e})),children:gt[e]}),O(`span`,{className:`text-sm font-bold tracking-tight text-text-main`,children:t||_t[e]})]}),O(`div`,{className:`text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0`,children:n})]})}const yt=e=>O(K,{type:`note`,...e}),bt=e=>O(K,{type:`tip`,...e}),xt=e=>O(K,{type:`warning`,...e}),St=e=>O(K,{type:`danger`,...e}),Ct=e=>O(K,{type:`info`,...e}),wt=e=>O(K,{type:`important`,...e}),Tt=e=>O(K,{type:`caution`,...e}),Et=j(`my-6 transition-all duration-200`,{variants:{variant:{default:`list-disc pl-5 text-text-muted marker:text-primary-500/50`,number:`list-decimal pl-5 text-text-muted marker:text-primary-500/50 marker:font-bold`,checked:`list-none p-0`,arrow:`list-none p-0`,bubble:`list-none p-0`},cols:{1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,4:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-4`},isGrid:{true:`grid gap-x-8 gap-y-3`,false:`space-y-2`},dense:{true:`space-y-1`,false:`space-y-2`}},compoundVariants:[{variant:`default`,dense:!0,className:`space-y-0.5`}],defaultVariants:{variant:`default`,cols:1,isGrid:!1,dense:!1}}),Dt=j(`group flex items-start gap-3 text-sm leading-relaxed transition-all duration-200`,{variants:{variant:{default:``,number:``,checked:`hover:translate-x-0.5`,arrow:`hover:translate-x-0.5`,bubble:`hover:translate-x-0.5`},dense:{true:`py-0`,false:`py-0.5`}},defaultVariants:{variant:`default`,dense:!1}}),Ot=j(`mt-1 shrink-0 flex items-center justify-center transition-transform group-hover:scale-110`,{variants:{variant:{bubble:`h-5 w-5 rounded-full bg-primary-500/10 text-primary-500 text-[10px] font-bold`,default:``}},defaultVariants:{variant:`default`}});function kt({icon:e,children:t,variant:n,dense:r}){return k(`li`,{className:F(Dt({variant:n,dense:r})),children:[e&&O(`span`,{className:F(Ot({variant:n===`bubble`?`bubble`:`default`})),children:e}),O(`div`,{className:`flex-1 text-text-muted group-hover:text-text-main transition-colors`,children:t})]})}const At={checked:e=>O(S,{size:14,className:F(`text-emerald-500 shrink-0`,e)}),arrow:e=>O(w,{size:14,className:F(`text-primary-400 shrink-0`,e)}),bubble:e=>O(oe,{size:6,fill:`currentColor`,className:F(`text-primary-500 shrink-0`,e)}),default:()=>null,number:()=>null};function jt({variant:e=`default`,cols:n=1,dense:i=!1,children:a,className:o,...s}){let c=n!==void 0&&Number(n)>1,l=At[e],u=Et({variant:e,cols:n,dense:i,isGrid:c,className:o});return e===`default`||e===`number`?O(e===`number`?`ol`:`ul`,{className:u,...s,children:a}):O(`ul`,{className:u,...s,children:t.map(a,t=>{if(!r(t))return t;let n=t,a=n.type===`li`?n.props.children:n.props.children||t;return O(kt,{icon:l(),variant:e,dense:i,children:a})})})}const Mt={ts:Qe,tsx:B,js:$e,jsx:B,json:et,css:tt,html:nt,md:V,mdx:V,bash:H,sh:H,yaml:U,yml:U},q={CODE:/\.(ts|tsx|js|jsx|json|mjs|cjs|astro|vue|svelte)$/i,TEXT:/\.(md|mdx|txt)$/i,IMAGE:/\.(png|jpg|jpeg|svg|gif)$/i};function J(e){return typeof e==`string`?e:typeof e==`number`?e.toString():Array.isArray(e)?e.map(J).join(``):r(e)&&e.props&&typeof e.props==`object`&&`children`in e.props?J(e.props.children):``}function Nt(e,t){let n=e.toLowerCase(),r=`shrink-0 transition-colors duration-200`;if(t)return O(me,{size:16,strokeWidth:2,className:F(r,`text-primary-400`),fill:`currentColor`,fillOpacity:.15});let i=Mt[n.split(`.`).pop()||``];if(i)return O(i,{size:16});let a=F(r,`text-text-dim group-hover:text-text-main`);return q.CODE.test(n)?O(ue,{size:16,strokeWidth:2,className:a}):q.TEXT.test(n)?O(fe,{size:16,strokeWidth:2,className:a}):q.IMAGE.test(n)?O(de,{size:16,strokeWidth:2,className:a}):O(le,{size:16,strokeWidth:2,className:a})}function Y(e,t){if(!r(e))return!1;let n=e.type;if(typeof n==`string`)return n===t;if(typeof n==`function`)return n.name===t||n.name?.toLowerCase()===t;let i=e.props;return i?.originalType===t||i?.mdxType===t}function Pt(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function X(e,n=`root`){if(!r(e))return[];let i=[];if(Y(e,`ul`))return t.forEach(e.props.children,(e,t)=>{i.push(...X(e,`${n}-${t}`))}),i;if(Y(e,`li`)){let r=t.toArray(e.props.children),a=r.findIndex(e=>Y(e,`ul`)),o=a!==-1,s=o?r.slice(0,a):r,c=o?r.slice(a):[],{name:l,comment:u}=Pt(J(s)),d=l.endsWith(`/`),f=d?l.slice(0,-1):l,p=o||d;return i.push({id:`${n}-${f}`,name:f,comment:u,isFolder:p,children:o?X(c[0],`${n}-${f}`):void 0}),i}return e.props&&typeof e.props==`object`&&`children`in e.props&&t.forEach(e.props.children,(e,t)=>{i.push(...X(e,`${n}-${t}`))}),i}function Ft({item:e}){return k(E.TreeItem,{id:e.id,textValue:e.name,className:`outline-none group focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md`,children:[O(E.TreeItemContent,{children:({isExpanded:t,hasChildItems:n})=>k(`div`,{className:`flex items-center gap-2 py-1 px-1.5 rounded-md transition-colors hover:bg-primary-500/5 cursor-pointer`,children:[O(`div`,{style:{width:`calc((var(--tree-item-level) - 1) * 1rem)`},className:`shrink-0`}),n?O(E.Button,{slot:`chevron`,className:`outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors`,children:O(w,{size:14,strokeWidth:3,className:F(`transition-transform duration-200`,t&&`rotate-90`)})}):O(`div`,{className:`w-[18px]`}),Nt(e.name,e.isFolder),O(`span`,{className:F(`text-sm transition-colors truncate select-none`,e.isFolder?`font-semibold text-text-main`:`text-text-muted group-hover:text-text-main`),children:e.name}),e.comment&&k(`span`,{className:`ml-2 text-xs italic text-text-dim opacity-70 group-hover:opacity-100 transition-opacity whitespace-nowrap overflow-hidden text-ellipsis font-sans`,children:[`//`,` `,e.comment]})]})}),e.children&&O(E.Collection,{items:e.children,children:e=>O(Ft,{item:e})})]})}function It({children:e}){let t=u(()=>X(e),[e]);return O(`div`,{className:`my-8`,children:O(E.Tree,{items:t,"aria-label":`File Tree`,className:F(`rounded-xl border border-border-subtle bg-bg-surface/50 p-4 font-mono text-sm shadow-sm backdrop-blur-sm outline-none`,`max-h-[500px] overflow-y-auto scrollbar-thin scrollbar-thumb-border-subtle`,`focus-visible:ring-2 focus-visible:ring-primary-500/20`),children:e=>O(Ft,{item:e})})})}function Lt({data:e,sortable:t=!1,paginated:n=!1,pageSize:r=10}){let[i,a]=f(null),[o,s]=f(1),c=u(()=>{if(!e)return[];let n=[...e];return t&&i!==null&&n.sort((e,t)=>{let n=e[i.key],r=t[i.key],a=typeof n==`string`?n:``,o=typeof r==`string`?r:``;return a<o?i.direction===`asc`?-1:1:a>o?i.direction===`asc`?1:-1:0}),n},[e,i,t]);return{sortConfig:i,currentPage:o,setCurrentPage:s,totalPages:Math.ceil(c.length/r),paginatedData:u(()=>{if(!n)return c;let e=(o-1)*r;return c.slice(e,e+r)},[c,n,o,r]),requestSort:e=>{if(!t)return;let n=`asc`;i&&i.key===e&&i.direction===`asc`&&(n=`desc`),a({key:e,direction:n})}}}function Rt({headers:e,data:t,children:n,className:r=``,sortable:i=!1,paginated:a=!1,pageSize:o=10}){let{sortConfig:s,currentPage:c,setCurrentPage:l,totalPages:u,paginatedData:d,requestSort:f}=Lt({data:t,sortable:i,paginated:a,pageSize:o}),p=e=>i?s?.key===e?s.direction===`asc`?O(re,{size:14,className:`ml-1 text-primary-400`}):O(C,{size:14,className:`ml-1 text-primary-400`}):O(C,{size:14,className:`ml-1 opacity-30`}):null,m=n||k(D,{children:[e&&O(`thead`,{children:O(`tr`,{children:e.map((e,t)=>O(`th`,{onClick:()=>f(t),className:F(`text-left px-3 py-2.5 border-b-2 border-border-subtle text-text-main font-semibold text-sm`,i&&`cursor-pointer select-none hover:text-primary-400 transition-colors`),children:k(`div`,{className:`flex items-center`,children:[e,p(t)]})},t))})}),d&&O(`tbody`,{children:d.map((e,t)=>O(`tr`,{className:`transition-colors hover:bg-bg-surface`,children:e.map((e,t)=>O(`td`,{className:`px-3 py-2 border-b border-border-subtle text-sm text-text-muted`,children:e},t))},t))})]});return k(`div`,{className:F(`my-6 rounded-lg border border-border-subtle overflow-hidden`,r),children:[O(`div`,{className:`overflow-x-auto`,children:O(`table`,{className:`w-full border-collapse text-sm`,children:m})}),a&&u>1&&k(`div`,{className:`flex items-center justify-between border-t border-border-subtle px-4 py-3`,children:[k(`span`,{className:`text-xs text-text-muted`,children:[`Page `,c,` of `,u]}),k(`div`,{className:`flex items-center gap-1`,children:[O(E.Button,{onPress:()=>l(1),isDisabled:c===1,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:O(ie,{size:16})}),O(E.Button,{onPress:()=>l(e=>Math.max(e-1,1)),isDisabled:c===1,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:O(ne,{size:16})}),O(E.Button,{onPress:()=>l(e=>Math.min(e+1,u)),isDisabled:c===u,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:O(w,{size:16})}),O(E.Button,{onPress:()=>l(u),isDisabled:c===u,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:O(ae,{size:16})})]})]})]})}function zt({name:e,type:t,defaultValue:n,required:r=!1,children:i,id:a,className:o=``}){return k(`article`,{className:F(`group relative my-6 rounded-xl border border-border-subtle bg-bg-surface p-5 transition-all duration-300`,`hover:border-primary-500/30 hover:shadow-lg hover:shadow-primary-500/5`,o),id:a,children:[k(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4`,children:[k(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[O(`code`,{className:`inline-flex items-center rounded-md bg-primary-500/10 px-2.5 py-1 font-mono text-sm font-bold text-primary-400 border border-primary-500/20 shadow-sm transition-colors group-hover:bg-primary-500/15`,children:e}),t&&O(`span`,{className:`rounded-md bg-bg-muted/80 border border-border-subtle px-2 py-0.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider shadow-sm`,children:t}),r&&k(`div`,{className:`flex items-center gap-1.5 rounded-full bg-red-500/10 px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-red-400 border border-red-500/20 shadow-sm`,children:[O(`span`,{className:`h-1 w-1 rounded-full bg-red-400 animate-pulse`}),`Required`]})]}),n&&k(`div`,{className:`flex items-center gap-2 text-[11px] text-text-muted bg-bg-muted/30 px-2.5 py-1 rounded-md border border-border-subtle/50`,children:[O(`span`,{className:`font-semibold opacity-60 uppercase tracking-tighter`,children:`Default`}),O(`code`,{className:`font-mono text-text-main font-medium`,children:n})]})]}),O(`div`,{className:`text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30`,children:i})]})}function Bt({to:e,children:t,className:n=``,...r}){let i=e&&(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`));return O(I,{href:e,className:F(`text-blue-600 hover:text-blue-800 hover:underline cursor-pointer`,n),target:i?`_blank`:void 0,rel:i?`noopener noreferrer`:void 0,...r,children:t})}function Vt({src:e,alt:t,theme:n,...r}){let{theme:i}=Ve();return n&&n!==i?null:O(`img`,{src:e,alt:t||``,...r})}function Ht({title:e,props:t,className:n=``}){return k(`div`,{className:F(`my-6`,n),children:[e&&O(`h3`,{className:`text-base font-bold text-text-main mb-3`,children:e}),O(`div`,{className:`overflow-x-auto rounded-lg border border-border-subtle`,children:k(`table`,{className:`w-full border-collapse text-sm`,children:[O(`thead`,{children:k(`tr`,{children:[O(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Property`}),O(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Type`}),O(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Default`}),O(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Description`})]})}),O(`tbody`,{children:t.map((e,t)=>k(`tr`,{className:`transition-colors hover:bg-bg-surface`,children:[k(`td`,{className:`px-4 py-2.5 border-b border-border-subtle`,children:[O(`code`,{className:`rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400`,children:e.name}),e.required&&O(`span`,{className:`ml-1 text-red-400 font-bold`,children:`*`})]}),O(`td`,{className:`px-4 py-2.5 border-b border-border-subtle`,children:O(`code`,{className:`rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted`,children:e.type})}),O(`td`,{className:`px-4 py-2.5 border-b border-border-subtle`,children:e.defaultValue?O(`code`,{className:`rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400`,children:e.defaultValue}):O(`span`,{className:`text-text-dim`,children:`—`})}),O(`td`,{className:`px-4 py-2.5 border-b border-border-subtle text-text-muted`,children:e.description})]},`${e.name}-${t}`))})]})})]})}function Ut(e){let{code:t,children:n,preview:r}=e;return{initialCode:u(()=>(t??(typeof n==`string`?n:``)).trim(),[t,n]),previewElement:u(()=>r??(typeof n==`string`?null:n),[r,n])}}function Wt(e){let{highlightedHtml:t,hideCode:n=!1,hideCopy:r=!1}=e,{initialCode:i,previewElement:a}=Ut(e);return k(`div`,{className:`my-6 overflow-hidden rounded-xl border border-border-subtle`,children:[O(`div`,{className:`flex items-center justify-center p-8 bg-bg-surface`,children:a}),!n&&O(`div`,{className:`border-t border-border-subtle`,children:O(G,{hideCopy:r,lang:`tsx`,highlightedHtml:t,plain:!0,children:i})})]})}const Gt=({children:e,className:t,vertical:n=!1})=>O(`div`,{className:F(`inline-flex`,n?`flex-col`:`flex-row`,!n&&[`[&>*:not(:first-child)]:-ml-px`,`[&>*:first-child]:rounded-r-none`,`[&>*:last-child]:rounded-l-none`,`[&>*:not(:first-child):not(:last-child)]:rounded-none`,t?.includes(`rounded-full`)&&[`[&>*:first-child]:rounded-l-full`,`[&>*:last-child]:rounded-r-full`],t?.includes(`rounded-xl`)&&[`[&>*:first-child]:rounded-l-xl`,`[&>*:last-child]:rounded-r-xl`],t?.includes(`rounded-lg`)&&[`[&>*:first-child]:rounded-l-lg`,`[&>*:last-child]:rounded-r-lg`]],n&&[`[&>*:not(:first-child)]:-mt-px`,`[&>*:first-child]:rounded-b-none`,`[&>*:last-child]:rounded-t-none`,`[&>*:not(:first-child):not(:last-child)]:rounded-none`,t?.includes(`rounded-full`)&&[`[&>*:first-child]:rounded-t-full`,`[&>*:last-child]:rounded-b-full`]],t),children:e}),Kt=({children:e,className:t,showArrow:n,...r})=>k(E.Popover,{offset:8,...r,className:E.composeRenderProps(t,e=>F(`z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none transition-none`,e)),children:[n&&O(E.OverlayArrow,{className:`group`,children:O(`svg`,{viewBox:`0 0 12 12`,className:`block h-3 w-3 fill-bg-surface/80 stroke-border-subtle group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90`,"aria-hidden":`true`,children:O(`path`,{d:`M0 0 L6 6 L12 0`})})}),e]});function qt(t){let[n,r]=e.Children.toArray(t.children).slice(0,2);return k(E.MenuTrigger,{...t,children:[n,O(Kt,{placement:t.placement,className:`min-w-35`,children:r})]})}function Jt(t){let[n,r]=e.Children.toArray(t.children).slice(0,2);return k(E.SubmenuTrigger,{...t,children:[n,O(Kt,{offset:-4,crossOffset:-4,children:r})]})}function Z(e){return O(E.Menu,{...e,className:E.composeRenderProps(e.className,e=>F(`p-1.5 outline-none max-h-[inherit] overflow-auto max-w-75`,e))})}function Yt(e){let t=e.textValue||(typeof e.children==`string`?e.children:void 0);return O(E.MenuItem,{...e,textValue:t,className:E.composeRenderProps(e.className,(e,{isFocused:t,isPressed:n,isDisabled:r})=>F(`group relative flex flex-row items-center gap-2 px-2 py-1 rounded-lg outline-none cursor-default hover:cursor-pointer transition-none`,`text-text-main text-[12px]`,{"bg-bg-surface-elevated text-primary-600 ring-1 ring-border-strong/5":t,"bg-bg-surface-elevanted":n,"opacity-40 grayscale pointer-events-none":r},e)),children:E.composeRenderProps(e.children,(e,{selectionMode:t,isSelected:n,hasSubmenu:r})=>k(D,{children:[t!==`none`&&k(`span`,{className:`flex items-center size-4 shrink-0 justify-center`,children:[n&&t===`multiple`&&O(S,{className:`size-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200`}),n&&t===`single`&&O(se,{className:`size-5 text-primary-500 animate-in zoom-in-50 duration-200`})]}),O(`div`,{className:`flex flex-row w-full transition-colors items-center gap-2 py-1 px-1`,children:e}),r&&O(w,{className:`size-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors`})]}))})}function Xt({title:e,...t}){return k(E.MenuSection,{...t,className:F(`flex flex-col gap-0.5`,t.className),children:[e&&O(E.Header,{className:`px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none`,children:e}),O(E.Collection,{items:t.items,children:t.children})]})}function Zt(e){return O(E.Separator,{...e,className:`mx-2 my-1.5 border-t border-border-subtle/50`})}Z.Root=Z,Z.Item=Yt,Z.Trigger=qt,Z.SubTrigger=Jt,Z.Section=Xt,Z.Separator=Zt;function Q({className:e,variant:t=`rect`,...n}){return O(`div`,{className:F(`animate-pulse bg-bg-muted`,t===`circle`?`rounded-full`:`rounded-md`,e),...n})}const Qt=e=>{let[t,n]=f(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function $t({content:e,mdxRaw:t,config:n}){let r=t||e||``,{copied:i,handleCopy:a,handleOpenRaw:o}=Qt(r),s=n!==!1,c=typeof n==`object`&&n.text||`Copy Markdown`;return!s||!r?null:O(`div`,{className:`relative inline-flex z-100 flex-shrink-0 w-max translate-y-0 active:translate-y-px transition-transform duration-200`,children:k(Gt,{className:`rounded-xl border border-border-subtle bg-bg-surface/40 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:shadow-lg hover:shadow-primary-500/5 group overflow-hidden`,children:[O(R,{variant:`ghost`,onPress:a,icon:O(i?S:T,{size:16}),iconPosition:`left`,className:F(`px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 border-none shrink-0`,`text-text-main transition-all duration-300 hover:bg-primary-500/5`,i&&`text-emerald-500 hover:bg-emerald-500/5`),children:i?`Copied!`:c}),k(Z.Trigger,{placement:`bottom end`,children:[O(R,{variant:`ghost`,isIconOnly:!0,icon:O(C,{size:14}),className:F(`px-3.5 h-9 border-l border-border-subtle/50 text-text-muted rounded-none bg-transparent shrink-0`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`)}),k(Z.Root,{className:`w-52`,children:[k(Z.Item,{onAction:a,children:[O(T,{size:16,className:`size-4 mt-0.5 text-text-muted group-hover:text-primary-500`}),O(`span`,{className:`font-medium text-[0.8125rem]`,children:`Copy Markdown`})]}),k(Z.Item,{onAction:o,children:[O(ce,{size:16,className:`size-4 mt-0.5 text-text-muted group-hover:text-primary-500`}),O(`span`,{className:`font-medium text-[0.8125rem]`,children:`View as Markdown`})]})]})]})]})})}var en=Ee({Admonition:()=>K,Badge:()=>ft,Button:()=>Ye,Card:()=>ht,Cards:()=>mt,Caution:()=>Tt,CodeBlock:()=>G,ComponentPreview:()=>Wt,ComponentProps:()=>Ht,CopyMarkdown:()=>$t,Danger:()=>St,Field:()=>zt,FileTree:()=>It,Image:()=>Vt,Important:()=>wt,InfoBox:()=>Ct,Link:()=>Bt,List:()=>jt,Note:()=>yt,Tab:()=>ct,Table:()=>Rt,Tabs:()=>lt,Tip:()=>bt,Video:()=>ut,Warning:()=>xt});function tn(){return O(`div`,{className:F(`w-full h-full relative overflow-y-auto transition-opacity duration-300 animate-fade-in`),children:k(`div`,{className:`mx-auto max-w-(--spacing-content-max) px-4 py-8 space-y-10`,children:[k(`div`,{className:`flex gap-2`,children:[O(Q,{className:`h-3 w-16`}),O(Q,{className:`h-3 w-24`})]}),O(Q,{className:`h-10 w-[60%] sm:h-12`}),k(`div`,{className:`space-y-3`,children:[O(Q,{className:`h-4 w-full`}),O(Q,{className:`h-4 w-[95%]`}),O(Q,{className:`h-4 w-[40%]`})]}),k(`div`,{className:`space-y-6 pt-4`,children:[O(Q,{className:`h-7 w-32`}),k(`div`,{className:`space-y-3`,children:[O(Q,{className:`h-4 w-full`}),O(Q,{className:`h-4 w-[98%]`}),O(Q,{className:`h-4 w-[92%]`}),O(Q,{className:`h-4 w-[60%]`})]})]}),O(Q,{className:`h-32 w-full rounded-lg bg-bg-muted/50`}),k(`div`,{className:`space-y-6 pt-4`,children:[O(Q,{className:`h-7 w-48`}),k(`div`,{className:`space-y-3`,children:[O(Q,{className:`h-4 w-full`}),O(Q,{className:`h-4 w-[85%]`})]})]})]})})}const $=({level:e,id:t,children:n,...r})=>k(`h${e}`,{id:t,...r,className:`boltdocs-heading`,children:[n,t&&O(`a`,{href:`#${t}`,className:`header-anchor`,"aria-label":`Anchor`,children:O(_e,{size:16})})]}),nn={...en,Loading:tn,h1:e=>O($,{level:1,...e}),h2:e=>O($,{level:2,...e}),h3:e=>O($,{level:3,...e}),h4:e=>O($,{level:4,...e}),h5:e=>O($,{level:5,...e}),h6:e=>O($,{level:6,...e}),pre:e=>O(G,{...e,children:e.children})};function rn(){let{currentLocale:e,config:t}=P();return c(()=>{if(!t.i18n)return;let n=t.i18n.localeConfigs?.[e];document.documentElement.lang=n?.htmlLang||e||`en`,document.documentElement.dir=n?.direction||`ltr`},[e,t.i18n]),null}function an(){let e=y(),{config:t}=P(),n=N(e=>e.setLocale),r=N(e=>e.setVersion),i=N(e=>e.currentLocale),a=N(e=>e.currentVersion);return c(()=>{let o=e.pathname.split(`/`).filter(Boolean),s=0,c=t.versions?.defaultVersion,l=t.i18n?.defaultLocale;if(o[s]===`docs`&&s++,t.versions&&o.length>s){let e=t.versions.versions.find(e=>e.path===o[s]);e&&(c=e.path,s++)}t.i18n&&o.length>s&&t.i18n.locales[o[s]]?l=o[s]:t.i18n&&o.length===0&&(l=i||t.i18n.defaultLocale),l!==i&&n(l),c!==a&&r(c)},[e.pathname,t,n,r,i,a]),null}function on({initialRoutes:t,initialConfig:n,docsDirName:r,modules:i,hot:a,homePage:o,externalPages:s,externalLayout:l,components:d={}}){let[p,m]=f(t),[h,v]=f(n),y=s||{},b=l||A,ee=u(()=>p.filter(e=>!(o&&(e.path===`/`||e.path===``))&&!y[e.path===``?`/`:e.path]).map(t=>{let n=Object.keys(i).find(e=>e===`/${r}/${t.filePath}`||e.endsWith(`/${r}/${t.filePath}`)||e.endsWith(`/${r}\\${t.filePath.replace(/\\/g,`/`)}`)),a=n?i[n]:null;return{...t,Component:e.lazy(async()=>a?await a():{default:Re})}}),[p,i,r,o,y]);c(()=>{a&&(a.on(`boltdocs:routes-update`,e=>{m(e)}),a.on(`boltdocs:config-update`,e=>{v(e)}))},[a]);let x=u(()=>({...nn,...we,...d}),[d]),te=x.Loading;return O(Pe,{children:O(Be,{children:O(qe,{components:x,children:O(De.Provider,{value:h,children:O(He,{children:k(Ae,{routes:p,modules:i,children:[O(Ue,{}),O(an,{}),O(rn,{}),k(_,{children:[O(g,{element:O(We,{}),children:ee.map(t=>O(g,{path:t.path===``?`/`:t.path,element:O(e.Suspense,{fallback:O(te,{}),children:O(Je,{Component:t.Component})})},t.path))},`docs-layout`),o&&k(D,{children:[O(g,{path:`/`,element:O(b,{children:O(o,{})})}),h.i18n&&Object.keys(h.i18n.locales).map(e=>O(g,{path:`/${e}`,element:O(b,{children:O(o,{})})},`home-${e}`))]}),Object.entries(y).map(([t,n])=>{let r=t===`/`?``:t;return k(e.Fragment,{children:[O(g,{path:t,element:O(b,{children:O(n,{})})}),h.i18n&&Object.keys(h.i18n.locales).map(e=>O(g,{path:`/${e}${r}`,element:O(b,{children:O(n,{})})},`${t}-${e}`))]},t)}),O(g,{path:`*`,element:O(A,{children:O(Re,{})})})]})]})})})})})})}async function sn(t){let{path:n,routes:r,config:i,modules:a,homePage:o,externalPages:s,docsDirName:c}=t,l={};for(let[e,t]of Object.entries(a))l[e]=()=>Promise.resolve(t);return p.renderToString(O(e.StrictMode,{children:O(m,{location:n,children:O(on,{initialRoutes:r,initialConfig:i,docsDirName:c,modules:l,homePage:o,externalPages:s})})}))}export{sn as render};
@@ -1,73 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- import{C as e,E as t,S as n,_ as r,a as i,b as a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,s as _,t as v,u as y,v as b,w as x,x as S,y as ee}from"./cache-DFdakSmR.mjs";import C from"@vitejs/plugin-react";import w from"@tailwindcss/vite";import{loadConfigFromFile as te,loadEnv as T}from"vite";import E from"fast-glob";import D from"fs";import{z as O}from"zod";import k from"path";import ne from"crypto";import re from"github-slugger";import{ViteImageOptimizer as ie}from"vite-plugin-image-optimizer";import{fileURLToPath as A}from"url";import{createRequire as j}from"module";import ae from"semver";import oe from"@mdx-js/rollup";import se from"remark-gfm";import ce from"remark-frontmatter";import M from"rehype-slug";import{visit as N}from"unist-util-visit";import{createHighlighter as P}from"shiki";function le(){F.invalidateAll()}function ue(e){F.invalidate(e)}var F,de=t((()=>{d(),F=new v({name:`routes`})}));function fe(t,n,s,c){let d;try{d=decodeURIComponent(t)}catch{let e=k.basename(t);throw g(`ENCODING_ERROR`,`Invalid character encoding`,{file:e}),new ee(`Security breach: Invalid characters or encoding in path: ${e}`)}if(d.length>260){let e=k.basename(d);throw g(`PATH_TOO_LONG`,`Path length exceeds limit`,{length:d.length,file:e}),new a(`Security breach: Path length exceeds limit of 260 characters: ${e}`)}let m=k.resolve(d),h=k.resolve(n),_=p(k.relative(h,m));if(_.startsWith(`../`)||_===`..`||m.includes(`\0`)||!e.test(_)){let e=k.basename(t);throw g(`PATH_TRAVERSAL_ATTEMPT`,`Path traversal or invalid characters detected`,{path:_}),new a(`Security breach: File is outside of docs directory, contains null bytes, or invalid characters: ${e}`)}let{data:v,content:y}=u(t),x=_.split(`/`),S,C;if(c?.versions&&x.length>0){let e=x[0],t=c.versions.prefix||``,n=c.versions.versions.find(n=>e===t+n.path||e===n.path);n&&(C=n.path,x=x.slice(1))}if(c?.i18n&&x.length>0){let e=x[0];c.i18n.locales[e]&&(S=e,x=x.slice(1))}let w;if(x.length>0){let e=x[0].match(/^\((.+)\)$/);e&&(w=e[1].toLowerCase(),x=x.slice(1))}let te=x.join(`/`),T;T=v.permalink?v.permalink.startsWith(`/`)?v.permalink:`/${v.permalink}`:f(te||`index.md`);let E=s;C&&(E+=`/`+C),S&&(E+=`/`+S),w&&(E+=`/`+w),E+=T===`/`?``:T,(!E||E===``)&&(E=`/`);let D=x[x.length-1],O=b(D),ne=b(k.basename(t,k.extname(t))),ie=v.sidebarPosition??o(D),A=x.length>=2?x[0]:void 0,j=A?b(A):void 0,ae=x.length>=2&&/^index\.mdx?$/.test(O),oe=new re,se=[];for(let e of y.matchAll(/^(#{2,4})\s+(.+)$/gm)){let t=e[1].length,n=l(e[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,`$1`).replace(/[_*`]/g,``).trim()).trim(),r=oe.slug(n);se.push({level:t,text:n,id:r})}let ce=v.title?l(String(v.title)):ne,M=v.description?l(String(v.description)):``;!M&&y&&(M=r(y.replace(/^#+.*$/gm,``).replace(/\[([^\]]+)\]\([^\)]+\)/g,`$1`).replace(/[_*`]/g,``).replace(/\s+/g,` `)).trim().slice(0,160));let N=v.badge?l(String(v.badge)):void 0,P=v.icon?String(v.icon):void 0,le=pe(y);return{route:{path:E,componentPath:t,filePath:_,title:ce,description:M,sidebarPosition:ie,headings:se,locale:S,version:C,badge:N,icon:P,tab:w,_content:le,_rawContent:y},relativeDir:j,isGroupIndex:ae,inferredTab:w,groupMeta:ae?{title:v.groupTitle||v.title||(j?i(j):``),position:v.groupPosition??v.sidebarPosition??(A?o(A):void 0),icon:P}:void 0,inferredGroupPosition:A?o(A):void 0}}function pe(e){return r(e.replace(/^#+.*$/gm,``).replace(/\[([^\]]+)\]\([^\)]+\)/g,`$1`).replace(/\{[^\}]+\}/g,``).replace(/[_*`]/g,``).replace(/\s+/g,` `)).trim()}var me=t((()=>{s(),x(),n()}));function he(e){return e.sort((e,t)=>!e.group&&!t.group?ge(e,t):e.group?t.group?e.group===t.group?ge(e,t):_e(e,t):1:-1)}function ge(e,t){return e.sidebarPosition!==void 0&&t.sidebarPosition!==void 0?e.sidebarPosition-t.sidebarPosition:e.sidebarPosition===void 0?t.sidebarPosition===void 0?e.title.localeCompare(t.title):1:-1}function _e(e,t){return e.groupPosition!==void 0&&t.groupPosition!==void 0?e.groupPosition-t.groupPosition:e.groupPosition===void 0?t.groupPosition===void 0?(e.groupTitle||e.group).localeCompare(t.groupTitle||t.group):1:-1}var ve=t((()=>{}));async function I(e,t,n=`/docs`,r=!0){let a=performance.now();F.load(),R.clear(),(process.env.BOLTDOCS_FORCE_REPARSE===`true`||t?.i18n)&&F.invalidateAll();let o;!r&&L?o=L:(o=await E([`**/*.md`,`**/*.mdx`],{cwd:e,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),L=o),F.pruneStale(new Set(o));let s=[],c=0;for(let r=0;r<o.length;r+=50){let i=o.slice(r,r+50),a=await Promise.all(i.map(async r=>{let i=F.get(r);if(i)return c++,i;let a=fe(r,e,n,t);return F.set(r,a),a}));s.push(...a),r+50<o.length&&await new Promise(e=>setImmediate(e))}F.save();let l=new Map,u=[];for(let e of s)if(e.isGroupIndex&&e.relativeDir&&u.push(e),e.relativeDir){let t=l.get(e.relativeDir);t?(t.position===void 0&&e.inferredGroupPosition!==void 0&&(t.position=e.inferredGroupPosition),!t.icon&&e.route.icon&&(t.icon=e.route.icon)):(t={title:i(e.relativeDir),position:e.inferredGroupPosition,icon:e.route.icon},l.set(e.relativeDir,t))}for(let e of u){let t=l.get(e.relativeDir);e.groupMeta&&(t.title=e.groupMeta.title,e.groupMeta.position!==void 0&&(t.position=e.groupMeta.position),e.groupMeta.icon&&(t.icon=e.groupMeta.icon))}let d=Array(s.length);for(let e=0;e<s.length;e++){let t=s[e],n=t.relativeDir,r=n?l.get(n):void 0;d[e]={...t.route,group:n,groupTitle:r?.title||(n?i(n):void 0),groupPosition:r?.position,groupIcon:r?.icon}}let f=d;if(t?.i18n){let e=ye(d,t,n);f=[...d,...e]}let p=he(f),m=performance.now()-a;return console.log(`[boltdocs] Route generation: ${m.toFixed(2)}ms (${o.length} files, ${c} cache hits)`),p}function ye(e,t,n){let r=t.i18n.defaultLocale,i=Object.keys(t.i18n.locales),a=[],o=new Map,s=[];for(let t of e){let e=t.locale||r;o.has(e)||o.set(e,new Set),o.get(e).add(t.path),e===r&&s.push(t)}for(let e of i){let i=o.get(e)||new Set;for(let o of s){let s=be(o.path,r,e,n,t);s!==o.path&&(i.has(s)||a.push({...o,path:s,locale:e}))}}return a}function be(e,t,n,r,i){let a=`${e}:${n}`,o=R.get(a);if(o)return o;let s=r;if(i?.versions){let t=i.versions.prefix||``;for(let n of i.versions.versions){let i=t+n.path;if(e.startsWith(`${r}/${i}`)){s+=`/`+i;break}if(e.startsWith(`${r}/${n.path}`)){s+=`/`+n.path;break}}}let c=e.substring(s.length),l=`/${t}`;if(c.startsWith(l+`/`))c=`/`+n+`/`+c.substring(l.length+1);else if(c===l)c=`/`+n;else if(c===`/`||c===``)c=`/`+n;else{let e=c.startsWith(`/`)?``:`/`;c=`/`+n+e+c}let u=s+c;return R.size>2e3&&R.clear(),R.set(a,u),u}var L,R,xe=t((()=>{s(),de(),me(),ve(),L=null,R=new Map})),Se,Ce,we,z,Te,Ee,De,Oe,ke,Ae,je=t((()=>{Se=O.object({icon:O.string().max(50),link:O.string().url()}),Ce=O.object({text:O.string().max(2e3).optional()}),we=O.enum([`fs:read`,`fs:write`,`vite:config`,`mdx:remark`,`mdx:rehype`,`components`,`hooks:build`,`hooks:dev`]),z=O.object({name:O.string(),enforce:O.enum([`pre`,`post`]).optional(),version:O.string().optional(),boltdocsVersion:O.string().optional(),permissions:O.array(we).optional(),remarkPlugins:O.array(O.any()).optional(),rehypePlugins:O.array(O.any()).optional(),vitePlugins:O.array(O.any()).optional(),components:O.record(O.string(),O.string()).optional(),hooks:O.record(O.string(),O.any()).optional()}),Te=O.object({title:O.union([O.string(),O.record(O.string(),O.string())]).optional(),description:O.union([O.string(),O.record(O.string(),O.string())]).optional(),logo:O.union([O.string(),O.object({dark:O.string(),light:O.string(),alt:O.string().optional(),width:O.number().optional(),height:O.number().optional()})]).optional(),navbar:O.array(O.object({label:O.union([O.string(),O.record(O.string(),O.string())]),href:O.string()})).optional(),sidebar:O.record(O.string(),O.array(O.object({text:O.string(),link:O.string()}))).optional(),socialLinks:O.array(Se).optional(),footer:Ce.optional(),breadcrumbs:O.boolean().optional(),editLink:O.string().refine(e=>!e||e.includes(`:path`),{message:`editLink must contain ':path' placeholder if specified`}).optional(),communityHelp:O.string().url().optional(),version:O.string().max(50).optional(),githubRepo:O.string().max(100).optional(),favicon:O.string().optional(),ogImage:O.string().optional(),poweredBy:O.boolean().optional(),tabs:O.array(O.object({id:O.string(),text:O.union([O.string(),O.record(O.string(),O.string())]),icon:O.string().optional()})).optional(),codeTheme:O.union([O.string(),O.object({light:O.string(),dark:O.string()})]).optional(),copyMarkdown:O.union([O.boolean(),O.object({text:O.string().optional(),icon:O.string().optional()})]).optional()}),Ee=O.union([O.string(),O.object({rules:O.array(O.object({userAgent:O.string(),allow:O.union([O.string(),O.array(O.string())]).optional(),disallow:O.union([O.string(),O.array(O.string())]).optional()})).optional(),sitemaps:O.array(O.string().url()).optional()})]),De=O.object({defaultLocale:O.string(),locales:O.record(O.string(),O.string()),localeConfigs:O.record(O.string(),O.object({label:O.string().optional(),direction:O.enum([`ltr`,`rtl`]).optional(),htmlLang:O.string().optional(),calendar:O.string().optional()})).optional()}),Oe=O.object({defaultVersion:O.string(),prefix:O.string().optional(),versions:O.array(O.object({label:O.string(),path:O.string()}))}),ke=O.object({headers:O.record(O.string(),O.string()).optional(),enableCSP:O.boolean().optional(),customHeaders:O.record(O.string(),O.string()).optional()}),Ae=O.object({siteUrl:O.string().url().optional(),docsDir:O.string().optional(),homePage:O.string().optional(),theme:Te.optional(),i18n:De.optional(),versions:Oe.optional(),plugins:O.array(z).optional(),robots:Ee.optional(),security:ke.optional(),vite:O.record(O.string(),O.unknown()).optional()})}));function Me(e){return e}async function B(e,t=process.cwd()){let n=t,r={docsDir:k.resolve(e),theme:{title:`Boltdocs`,description:`A Vite documentation framework`,navbar:[{label:`Home`,href:`/`},{label:`Documentation`,href:`/docs`}],codeTheme:{light:`github-light`,dark:`github-dark`},poweredBy:!0,breadcrumbs:!0}},i={};for(let e of V){let t=k.resolve(n,e);if(D.existsSync(t))try{let e=await te({command:`serve`,mode:`development`},t,n);if(e){i=e.config;break}}catch(t){console.warn(`[boltdocs] Failed to load config from ${e}:`,t)}}let a={title:i.title,description:i.description,logo:i.logo,favicon:i.favicon,ogImage:i.ogImage,navbar:i.navbar,sidebar:i.sidebar,socialLinks:i.socialLinks,footer:i.footer,githubRepo:i.githubRepo,tabs:i.tabs,codeTheme:i.codeTheme,copyMarkdown:i.copyMarkdown,breadcrumbs:i.breadcrumbs,poweredBy:i.poweredBy,communityHelp:i.communityHelp,version:i.version,editLink:i.editLink,...i.theme||{}},o=Object.fromEntries(Object.entries(a).filter(([e,t])=>t!==void 0));o.navbar&&=o.navbar.map(e=>({label:e.label||e.text||``,href:e.href||e.link||e.to||``}));let s={docsDir:k.resolve(e),homePage:i.homePage,theme:{...r.theme,...o},i18n:i.i18n,versions:i.versions,siteUrl:i.siteUrl,plugins:i.plugins||[],robots:i.robots,security:i.security,vite:i.vite},c=Ae.safeParse(s);if(!c.success)throw new S(`Invalid Boltdocs configuration:\n${c.error.issues.map(e=>` - ${e.path.join(`.`)}: ${e.message}`).join(`
7
- `)}`);return c.data}var V,H=t((()=>{je(),n(),V=[`boltdocs.config.js`,`boltdocs.config.mjs`,`boltdocs.config.ts`]}));function Ne(e,t){let n=h(t.title),r=h(t.description);return e.replace(/<title>.*?<\/title>/,`<title>${n}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${n}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${n}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${r}$2`)}var Pe=t((()=>{s()}));function Fe(e,t){let n=t?.siteUrl?.replace(/\/$/,``)||`https://example.com`,r=new Date().toISOString().split(`T`)[0],i=[{url:`/`,priority:`1.0`,changefreq:`daily`}];if(t?.i18n){let e=t.i18n.defaultLocale;for(let n of Object.keys(t.i18n.locales))n!==e&&i.push({url:`/${n}/`,priority:`1.0`,changefreq:`daily`})}return`<?xml version="1.0" encoding="UTF-8"?>
8
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
9
- ${[...i,...e.map(e=>({url:e,priority:`0.8`,changefreq:`weekly`}))].map(e=>` <url>
10
- <loc>${_(n)}${_(e.url)}</loc>
11
- <lastmod>${r}</lastmod>
12
- <changefreq>${e.changefreq}</changefreq>
13
- <priority>${e.priority}</priority>
14
- </url>`).join(`
15
- `)}
16
- </urlset>`}var Ie=t((()=>{s()}));function Le(e){if(typeof e.robots==`string`)return e.robots;let t=e.siteUrl?.replace(/\/$/,``)||``,n=e.robots||{},r=n.rules||[{userAgent:`*`,allow:`/`}],i=n.sitemaps||(t?[`${t}/sitemap.xml`]:[]),a=``;for(let e of r){if(a+=`User-agent: ${e.userAgent}\n`,e.disallow){let t=Array.isArray(e.disallow)?e.disallow:[e.disallow];for(let e of t)a+=`Disallow: ${e}\n`}if(e.allow){let t=Array.isArray(e.allow)?e.allow:[e.allow];for(let e of t)a+=`Allow: ${e}\n`}a+=`
17
- `}for(let e of i)a+=`Sitemap: ${e}\n`;return a.trim()}var Re=t((()=>{}));async function ze(e){let{docsDir:t,docsDirName:n,outDir:r,config:i}=e,a=await I(t,i),o=[`tsx`,`ts`,`jsx`,`js`].map(e=>k.resolve(t,`pages-external/index.${e}`)).find(e=>D.existsSync(e));if(o)try{let e=D.readFileSync(o,`utf-8`),t=e.match(/pages\s*:\s*{([^}]+)}/s);if(t){let e=t[1].split(`,`).map(e=>e.split(`:`)[0].trim().replace(/['"]/g,``)).filter(e=>e&&e.startsWith(`/`));for(let t of e)a.some(e=>e.path===t)||a.push({path:t,title:t.slice(1).charAt(0).toUpperCase()+t.slice(2),filePath:``,componentPath:``,_content:``})}e.includes(`homePage`)&&!a.some(e=>e.path===`/`)&&a.push({path:`/`,title:`Home`,filePath:``,componentPath:``,_content:``})}catch(e){console.warn(`[boltdocs] Failed to parse external routes for SSG:`,e)}let s=k.resolve(U,`../client/ssr.js`);if(!D.existsSync(s)){console.error(`[boltdocs] SSR module not found at`,s,`- Did you build the core package?`);return}let c=Ve(`module`),l=c.prototype.require;c.prototype.require=function(e,...t){return e.startsWith(`virtual:boltdocs-`)?e===`virtual:boltdocs-layout`?{__esModule:!0,default:function(e){try{let t=l.apply(this,[k.resolve(U,`../client/index.js`)]).DefaultLayout||(({children:e})=>e);return l.apply(this,[`react`]).createElement(t,e)}catch{return e.children}}}:e===`virtual:boltdocs-mdx-components`?{__esModule:!0,default:{}}:e===`virtual:boltdocs-config`?{__esModule:!0,default:i}:{__esModule:!0,default:e.includes(`routes`)?[]:{}}:l.apply(this,[e,...t])};let{render:u}=Ve(s);c.prototype.require=l;let d=k.join(r,`index.html`);if(!D.existsSync(d)){console.warn(`[boltdocs] No index.html found in outDir, skipping SSG.`);return}let f=D.readFileSync(d,`utf-8`);await Promise.all(a.map(async e=>{let t=y(i?.theme?.title,e.locale)||`Boltdocs`,o=y(i?.theme?.description,e.locale)||``,s=`${e.title} | ${t}`,c=e.description||o,l={};l[`/${n}/${e.filePath}`]={default:()=>null};try{let t=await u({path:e.path,routes:a,config:i||{},docsDirName:n,modules:l,homePage:void 0}),o=Ne(f,{title:h(s),description:h(c)}).replace(`<!--app-html-->`,t).replace(`<div id="root"></div>`,`<div id="root">${t}</div>`),d=k.join(r,e.path);await D.promises.mkdir(d,{recursive:!0}),await D.promises.writeFile(k.join(d,`index.html`),o,`utf-8`)}catch(t){console.error(`[boltdocs] Error SSR rendering route ${e.path}:`,t&&(t.stack||t))}}));let p=Fe(a.map(e=>e.path),i);D.writeFileSync(k.join(r,`sitemap.xml`),p,`utf-8`);let m=Le(i);D.writeFileSync(k.join(r,`robots.txt`),m,`utf-8`),console.log(`[boltdocs] Generated ${a.length} static pages + sitemap.xml + robots.txt`);let{flushCache:g}=await import(`./cache-DFdakSmR.mjs`).then(e=>(e.i(),e.r));await g()}var Be,U,Ve,He=t((()=>{xe(),s(),Pe(),Ie(),Re(),Be=A(import.meta.url),U=k.dirname(Be),Ve=j(import.meta.url)}));function Ue(e,t){let n=e.homePage?`import HomePage from '${p(e.homePage)}';`:``,r=k.resolve(process.cwd(),`index.css`),i=D.existsSync(r)?`import './index.css';`:``,a=e.homePage?`homePage: HomePage,`:``,o=t?.plugins?.flatMap(e=>Object.entries(e.components||{}))||[],s=o.map(([e,t])=>`import * as _comp_${e} from '${p(t)}';
18
- const ${e} = _comp_${e}.default || _comp_${e}['${e}'] || _comp_${e};`).join(`
19
- `),c=o.map(([e])=>e).join(`, `),l=k.basename(e.docsDir||`docs`),u=k.resolve(process.cwd(),e.docsDir||`docs`),d=[`tsx`,`ts`,`jsx`,`js`].map(e=>k.resolve(u,`pages-external/index.${e}`)).find(e=>D.existsSync(e)),f=d?`import * as _external_module from '${p(d)}';`:``;return a=d?`homePage: _external_module.homePage || HomePage,`:e.homePage?`homePage: HomePage,`:``,`
20
- import { createBoltdocsApp as _createApp } from 'boltdocs/client';
21
- import _routes from 'virtual:boltdocs-routes';
22
- import _config from 'virtual:boltdocs-config';
23
- import _user_mdx_components from 'virtual:boltdocs-mdx-components';
24
- ${i}
25
- ${n}
26
- ${s}
27
- ${f}
28
-
29
- _createApp({
30
- target: '#root',
31
- routes: _routes,
32
- docsDirName: '${l}',
33
- config: _config,
34
- modules: import.meta.glob('/${l}/**/*.{md,mdx}'),
35
- hot: import.meta.hot,
36
- ${a}
37
- ${d?`externalPages: _external_module.pages, externalLayout: _external_module.layout,`:``}
38
- components: { ${c}${c?`, `:``} ...(_user_mdx_components || {}) },
39
- });
40
- `}var We=t((()=>{s()}));function Ge(e){return`<!doctype html>
41
- <html lang="en">
42
- <head>
43
- <meta charset="UTF-8" />
44
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
45
- <title>${e.theme?.title||`Boltdocs`}</title>
46
- </head>
47
- <body>
48
- <div id="root"></div>
49
- </body>
50
- </html>`}function Ke(e,t){let n=t.theme,r=n?.title||`Boltdocs`,i=n?.description||``,a=n?.favicon;!a&&n?.logo&&(a=typeof n.logo==`string`?n.logo:n.logo.light||n.logo.dark);let o=[a?`<link rel="icon" href="${a}">`:``,`<meta name="description" content="${i}">`,`<meta property="og:title" content="${r}">`,`<meta property="og:description" content="${i}">`,n?.ogImage?`<meta property="og:image" content="${n.ogImage}">`:``,`<meta property="og:type" content="website">`,`<meta name="twitter:card" content="summary_large_image">`,`<meta name="twitter:title" content="${r}">`,`<meta name="twitter:description" content="${i}">`,n?.ogImage?`<meta name="twitter:image" content="${n.ogImage}">`:``,`<meta name="generator" content="Boltdocs">`].filter(Boolean).join(`
51
- `);return e=e.includes(`<title>`)?e.replace(/<title>.*?<\/title>/,`<title>${r}</title>`):e.replace(`</head>`,` <title>${r}</title>\n </head>`),e=e.replace(`</head>`,` ${o}\n
52
- <script>
53
- (function() {
54
- try {
55
- var stored = localStorage.getItem("boltdocs-theme");
56
- var theme = stored || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
57
- if (theme === "light") {
58
- document.documentElement.classList.add("theme-light");
59
- document.documentElement.dataset.theme = "light";
60
- } else {
61
- document.documentElement.classList.remove("theme-light");
62
- document.documentElement.dataset.theme = "dark";
63
- }
64
- } catch (e) {}
65
- })();
66
- <\/script>
67
- </head>`),!e.includes(`src/main`)&&!e.includes(`virtual:boltdocs-entry`)&&(e=e.replace(`</body>`,` <script type="module">import "virtual:boltdocs-entry";<\/script>
68
- </body>`)),e}var qe=t((()=>{}));function Je(e){let t=[];for(let n of e)if(t.push({id:n.path,title:n.title,content:n._content||``,url:n.path,display:n.groupTitle?`${n.groupTitle} > ${n.title}`:n.title,locale:n.locale,version:n.version}),n.headings)for(let e of n.headings)t.push({id:`${n.path}#${e.id}`,title:e.text,content:`${e.text} in ${n.title}`,url:`${n.path}#${e.id}`,display:`${n.title} > ${e.text}`,locale:n.locale,version:n.version});return t}var Ye=t((()=>{})),Xe,Ze=t((()=>{Xe={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`}}));function Qe(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}var $e=t((()=>{})),et=t((()=>{})),W,G,tt,K,nt,q=t((()=>{W=class e extends Error{pluginName;constructor(t,n){super(`[plugin:${t}] ${n}`),this.name=`PluginError`,this.pluginName=t,Object.setPrototypeOf(this,e.prototype)}},G=class e extends W{constructor(t,n){super(t,`Validation failed: ${n}`),this.name=`PluginValidationError`,Object.setPrototypeOf(this,e.prototype)}},tt=class e extends W{constructor(t,n){super(t,`Compatibility error: ${n}`),this.name=`PluginCompatibilityError`,Object.setPrototypeOf(this,e.prototype)}},K=class e extends W{constructor(t,n){super(t,`Missing required permission: '${n}'`),this.name=`PluginPermissionError`,Object.setPrototypeOf(this,e.prototype)}},nt=class e extends W{hookName;constructor(t,n,r){super(t,`Error in hook '${n}': ${r.message}`),this.name=`PluginHookError`,this.hookName=n,this.stack=r.stack,Object.setPrototypeOf(this,e.prototype)}}})),rt,it=t((()=>{rt=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let n=this.getNamespaceKey(e,t),r=this.data.get(n);if(r!==void 0)return typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r}set(e,t,n){let r=this.getNamespaceKey(e,t),i=typeof n==`object`&&n?JSON.parse(JSON.stringify(n)):n;this.data.set(r,i)}has(e,t){let n=this.getNamespaceKey(e,t);return this.data.has(n)}}}));function at(e,t){let n=[],r=new Set;for(let i of e){let e=ot.safeParse(i);if(!e.success)throw new G(i.name||`unknown`,e.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `));let a=e.data;if(r.has(a.name))throw new G(a.name,`Duplicate plugin name detected`);if(r.add(a.name),a.boltdocsVersion&&!ae.satisfies(t,a.boltdocsVersion))throw new tt(a.name,`Plugin expects Boltdocs version ${a.boltdocsVersion}, but current is ${t}`);if(a.components){for(let[e,t]of Object.entries(a.components))if((t.includes(`..`)||k.isAbsolute(t))&&t.includes(`..`))throw new G(a.name,`Component '${e}' has an invalid path: traversal sequences are not allowed.`)}n.push(a)}return n}function J(e,t){return e.permissions?e.permissions.includes(t):!1}var ot,st=t((()=>{je(),q(),ot=z.extend({version:O.string().optional(),boltdocsVersion:O.string().optional(),permissions:O.array(O.string()).optional(),hooks:O.object({beforeBuild:O.function().optional(),afterBuild:O.function().optional(),beforeDev:O.function().optional(),afterDev:O.function().optional(),configResolved:O.function().optional(),buildEnd:O.function().optional()}).optional()})})),Y,ct=t((()=>{q(),st(),Y=class{static checkPermission(e,t){if(!J(e,t))throw new K(e.name,t)}static getSanitizedCapabilities(e){return{remarkPlugins:J(e,`mdx:remark`)?e.remarkPlugins:[],rehypePlugins:J(e,`mdx:rehype`)?e.rehypePlugins:[],vitePlugins:J(e,`vite:config`)?e.vitePlugins:[],components:J(e,`components`)?e.components:{}}}static async executeWithIsolation(e,t,n,r){try{return this.checkPermission(e,t),await r()}catch(t){if(t instanceof K){console.warn(`[boltdocs] Skipping hook '${n}' for plugin '${e.name}': ${t.message}`);return}throw t}}}})),lt,ut=t((()=>{q(),it(),ct(),lt=class{plugins;config;store;constructor(e,t){this.plugins=e,this.config=t,this.store=new rt}async runHook(e,...t){let n=this.getSortedPlugins();for(let r of n){if(!r.hooks?.[e])continue;let n=this.createContext(r),i=e.toLowerCase().includes(`build`),a=e.toLowerCase().includes(`dev`),o=i?`hooks:build`:a?`hooks:dev`:void 0;try{o?await Y.executeWithIsolation(r,o,e,()=>r.hooks[e](n,...t)):await r.hooks[e](n,...t)}catch(t){let i=new nt(r.name,e,t instanceof Error?t:Error(String(t)));n.logger.error(i)}}}getSortedPlugins(){let e=this.plugins.filter(e=>e.enforce===`pre`),t=this.plugins.filter(e=>!e.enforce),n=this.plugins.filter(e=>e.enforce===`post`);return[...e,...t,...n]}createContext(e){return{config:Object.freeze({...this.config}),meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(e,t)=>this.store.get(e,t),set:(e,t,n)=>this.store.set(e,t,n),has:(e,t)=>this.store.has(e,t)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:e=>console.log(`${t} INFO: ${e}`),warn:e=>console.warn(`${t} WARN: ${e}`),error:e=>{let n=e instanceof Error?e.message:e;console.error(`${t} ERROR: ${n}`)},debug:e=>console.debug(`${t} DEBUG: ${e}`)}}}}));function dt(e){return e}var ft=t((()=>{et(),q(),it(),st(),ct(),ut()})),pt=t((()=>{}));function mt(e={},t){let n=k.resolve(process.cwd(),e.docsDir||`docs`),r=p(n),i=t,a,o=!1,s,l=[];return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){o=t.command===`build`;let r=e.envDir||process.cwd(),a=T(t.mode,r,``);Object.assign(process.env,a),i||=await B(n);let c=(await import(`./package-OFZf0s2j.mjs`)).version,u=at(i.plugins||[],c);return i.plugins=u,s=new lt(u,i),l=u.flatMap(e=>Y.getSanitizedCapabilities(e).vitePlugins||[]),o&&await s.runHook(`beforeBuild`),{optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{dedupe:[`react`,`react-dom`]}}},configResolved(e){a=e,s?.runHook(`configResolved`,i)},async configureServer(e){await s?.runHook(`beforeDev`),e.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(Xe).forEach(([e,n])=>{t.setHeader(e,n)}),i.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Qe(i)),n()}),e.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){let e=Le(i);t.statusCode=200,t.setHeader(`Content-Type`,`text/plain`),t.end(e);return}n()}),e.middlewares.use(async(t,n,r)=>{let a=t.url?.split(`?`)[0]||`/`,o=t.headers.accept||``,s=a===`/`||a.startsWith(`/docs`)||i.i18n&&Object.keys(i.i18n.locales).some(e=>a.startsWith(`/${e}/docs`)||a===`/${e}`)||!0,c=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(a);if(o.includes(`text/html`)&&!c&&s){let r=Ge(i);r=Ke(r,i),r=await e.transformIndexHtml(t.url||`/`,r),n.statusCode=200,n.setHeader(`Content-Type`,`text/html`),n.end(r);return}r()});let t=V.map(e=>k.resolve(process.cwd(),e)),a=[`tsx`,`jsx`],o=a.map(e=>k.resolve(n,`layout.${e}`)),l=[`tsx`,`ts`,`jsx`,`js`],u=l.map(e=>k.resolve(n,`mdx-components.${e}`)),d=l.map(e=>k.resolve(n,`pages-external/index.${e}`));e.watcher.add([...t,...u,...o,...d]);let f=async(t,o)=>{try{let s=p(t);if(V.some(e=>s.endsWith(e))){e.restart();return}if(l.some(e=>s.endsWith(`mdx-components.${e}`))){let t=e.moduleGraph.getModuleById(`\0virtual:boltdocs-mdx-components`);t&&e.moduleGraph.invalidateModule(t),e.ws.send({type:`full-reload`});return}if(a.some(e=>s.endsWith(`layout.${e}`))){let t=e.moduleGraph.getModuleById(`\0virtual:boltdocs-layout`);t&&e.moduleGraph.invalidateModule(t),e.ws.send({type:`full-reload`});return}if(s.includes(`/pages-external/`)||s.includes(`\\pages-external\\`)){let t=e.moduleGraph.getModuleById(`\0virtual:boltdocs-entry`);t&&e.moduleGraph.invalidateModule(t),e.ws.send({type:`full-reload`});return}if(!s.startsWith(r)||!c(s))return;if(o===`add`||o===`unlink`){le(),i=await B(n);let t=e.moduleGraph.getModuleById(`\0virtual:boltdocs-config`);t&&e.moduleGraph.invalidateModule(t),e.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:i?.theme,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl}})}else ue(t);let u=await I(n,i,`/docs`,o!==`change`),d=e.moduleGraph.getModuleById(`\0virtual:boltdocs-routes`);d&&e.moduleGraph.invalidateModule(d),e.ws.send({type:`custom`,event:`boltdocs:routes-update`,data:u})}catch(e){console.error(`[boltdocs] HMR error during ${o} event:`,e)}};e.watcher.on(`add`,e=>f(e,`add`)),e.watcher.on(`unlink`,e=>f(e,`unlink`)),e.watcher.on(`change`,e=>f(e,`change`)),await s?.runHook(`afterDev`)},resolveId(e){if(e===`virtual:boltdocs-routes`||e===`virtual:boltdocs-config`||e===`virtual:boltdocs-entry`||e===`virtual:boltdocs-mdx-components`||e===`virtual:boltdocs-layout`||e===`virtual:boltdocs-search`)return`\0`+e},async load(t){if(t===`\0virtual:boltdocs-routes`){let e=await I(n,i);return`export default ${JSON.stringify(e,null,2)};`}if(t===`\0virtual:boltdocs-config`){let e={theme:i?.theme,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl,plugins:i?.plugins?.map(e=>({name:e.name}))};return`export default ${JSON.stringify(e,null,2)};`}if(t===`\0virtual:boltdocs-entry`)return Ue(e,i);if(t===`\0virtual:boltdocs-mdx-components`){let e=[`tsx`,`ts`,`jsx`,`js`],t=null;for(let r of e){let e=k.resolve(n,`mdx-components.${r}`);if(D.existsSync(e)){t=e;break}}if(t){let e=p(t);return`import * as components from '${e}';
69
- const mdxComponents = components.default || components;
70
- export default mdxComponents;
71
- export * from '${e}';`}return`export default {};`}if(t===`\0virtual:boltdocs-layout`){let e=[`tsx`,`jsx`],t=null;for(let r of e){let e=k.resolve(n,`layout.${r}`);if(D.existsSync(e)){t=e;break}}return t?`import UserLayout from '${p(t)}';
72
- export default UserLayout;`:`import { DefaultLayout } from 'boltdocs/client';
73
- export default DefaultLayout;`}if(t===`\0virtual:boltdocs-search`){let e=Je(await I(n,i));return`export default ${JSON.stringify(e,null,2)};`}},transformIndexHtml:{order:`pre`,handler(e){return Ke(e,i)}},async closeBundle(){if(!o)return;let e=a?.build?.outDir?k.resolve(a.root,a.build.outDir):k.resolve(process.cwd(),`dist`);await ze({docsDir:n,docsDirName:k.basename(n||`docs`),outDir:e,config:i});let{flushCache:t}=await import(`./cache-DFdakSmR.mjs`).then(e=>(e.i(),e.r));await t(),await s?.runHook(`afterBuild`),await s?.runHook(`buildEnd`)}},ie({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),{name:`vite-plugin-boltdocs-extra-plugins`,async configResolved(){}},...l]}var ht=t((()=>{xe(),H(),He(),s(),We(),qe(),Re(),Ye(),Ze(),$e(),ft(),pt()})),X,gt=t((()=>{d(),X=new m(`mdx`)}));async function _t(e){if(Z)return Z;let t=typeof e==`object`?[e.light,e.dark]:[e??`github-dark`];return[`github-light`,`github-dark`].forEach(e=>{t.includes(e)||t.push(e)}),Z=await P({themes:t,langs:[`tsx`,`jsx`,`ts`,`js`,`json`,`md`,`mdx`,`css`,`html`,`bash`,`sh`,`yaml`,`yml`]}),Z}var Z,vt=t((()=>{Z=null}));function yt(e){return async t=>{let n=e?.theme?.codeTheme??{light:`github-light`,dark:`github-dark`},r=await _t(n);N(t,[`mdxJsxFlowElement`,`mdxJsxTextElement`],e=>{if(e.name!==`ComponentPreview`)return;let t=e.attributes?.find(e=>e.name===`code`),i=``;if(t){if(typeof t.value==`string`)i=t.value;else if(t.value?.type===`mdxJsxAttributeValueExpression`){let e=t.value.value??``;i=e.match(/^[`'"]([\s\S]+)[`'"]$/)?.[1]??e}}if(!i)return;let a=typeof n==`object`?{themes:{light:n.light,dark:n.dark},lang:`tsx`}:{theme:n,lang:`tsx`},o=r.codeToHtml(i,a);e.attributes=(e.attributes??[]).filter(e=>e.name!==`highlightedHtml`),e.attributes.push({type:`mdxJsxAttribute`,name:`highlightedHtml`,value:o})})}}var bt=t((()=>{vt()}));function xt(e){return async t=>{let n=e?.theme?.codeTheme||{light:`github-light`,dark:`github-dark`},r=await _t(n);N(t,`element`,e=>{if(e.tagName===`pre`&&e.children?.[0]?.tagName===`code`){let t=e.children[0],i=(t.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):`text`,o=t.children[0]?.value||``,s=(t.data?.meta||t.properties?.metastring||``).match(/title\s*=\s*"([^"]*)"/),c=s?s[1]:void 0,l={lang:a};typeof n==`object`?l.themes={light:n.light,dark:n.dark}:l.theme=n;let u=r.codeToHtml(o,l);e.properties[`data-highlighted`]=`true`,e.properties[`data-highlighted-html`]=u,e.properties[`data-lang`]=a,c&&(e.properties.title=c),e.children=[]}})}}var St=t((()=>{vt()}));function Ct(){return e=>{N(e,`code`,e=>{if(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.lang&&(e.data.hProperties[`data-lang`]=e.lang),!e.meta)return;let t=e.meta,n=t.match(/title\s*=\s*"([^"]*)"/);n&&(e.data.hProperties.title=n[1]),e.data.hProperties.metastring=t})}}var wt=t((()=>{}));function Tt(e,t=oe){let n=e?.plugins?.flatMap(e=>Y.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>Y.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[se,ce,Ct,[yt,e],...n],rehypePlugins:[M,[xt,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){Q=0,$=0,Et||=(X.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){if(!t.endsWith(`.md`)&&!t.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);console.log(`[boltdocs] Transforming MDX: ${t}`),$++;let r=`${t}:${ne.createHash(`md5`).update(e).digest(`hex`)}:v4`,a=X.get(r);if(a)return Q++,{code:a,map:null};let o=await i.transform.call(this,e,t,n);return o&&typeof o==`object`&&o.code&&X.set(r,o.code),o},async buildEnd(){$>0&&console.log(`[boltdocs] MDX Cache Performance: ${Q}/${$} hits (${Math.round(Q/$*100)||0}%)`),X.save(),await X.flush(),i.buildEnd&&await i.buildEnd.call(this)}}}var Et,Q,$,Dt=t((()=>{gt(),bt(),St(),wt(),ft(),Et=!1,Q=0,$=0}));async function Ot(e){let t=await B(e?.docsDir||`docs`);return[...mt({...e,homePage:e?.homePage||t.homePage},t),Tt(t)]}async function kt(e,t=`development`){let n=await B(`docs`,e),r=t===`production`?{...Xe}:{};return n.security?.enableCSP&&(r[`Content-Security-Policy`]=Qe(n)),{root:e,mode:t,plugins:[C(),w(),await Ot({docsDir:n.docsDir,homePage:n.homePage})],resolve:{alias:{"use-sync-external-store/shim/index.js":`react`,"use-sync-external-store/shim":`react`,"use-sync-external-store":`react`}},server:{headers:{...r,...n.vite?.server?.headers},...n.vite?.server},preview:{headers:{...r,...n.vite?.preview?.headers},...n.vite?.preview},...n.vite}}var At=t((()=>{ht(),Dt(),Ze(),$e(),H(),He(),ft()}));export{qe as _,lt as a,H as b,J as c,tt as d,W as f,Ge as g,G as h,dt as i,at as l,K as m,kt as n,Y as o,nt as p,At as r,ot as s,Ot as t,rt as u,ze as v,B as x,Me as y};
@@ -1,73 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- const e=require(`./cache-Cr8W2zgZ.cjs`);let t=require(`@vitejs/plugin-react`);t=e.S(t);let n=require(`@tailwindcss/vite`);n=e.S(n);let r=require(`vite`),i=require(`fast-glob`);i=e.S(i);let a=require(`fs`);a=e.S(a);let o=require(`zod`),s=require(`path`);s=e.S(s);let c=require(`crypto`);c=e.S(c);let l=require(`github-slugger`);l=e.S(l);let u=require(`vite-plugin-image-optimizer`),d=require(`url`),f=require(`module`),p=require(`semver`);p=e.S(p);let m=require(`@mdx-js/rollup`);m=e.S(m);let h=require(`remark-gfm`);h=e.S(h);let g=require(`remark-frontmatter`);g=e.S(g);let _=require(`rehype-slug`);_=e.S(_);let v=require(`unist-util-visit`),y=require(`shiki`);const b=new e.t({name:`routes`});function x(){b.invalidateAll()}function S(e){b.invalidate(e)}function C(t,n,r,i){let a;try{a=decodeURIComponent(t)}catch{let n=s.default.basename(t);throw e.d(`ENCODING_ERROR`,`Invalid character encoding`,{file:n}),new e._(`Security breach: Invalid characters or encoding in path: ${n}`)}if(a.length>260){let t=s.default.basename(a);throw e.d(`PATH_TOO_LONG`,`Path length exceeds limit`,{length:a.length,file:t}),new e.v(`Security breach: Path length exceeds limit of 260 characters: ${t}`)}let o=s.default.resolve(a),c=s.default.resolve(n),u=e.f(s.default.relative(c,o));if(u.startsWith(`../`)||u===`..`||o.includes(`\0`)||!e.b.test(u)){let n=s.default.basename(t);throw e.d(`PATH_TRAVERSAL_ATTEMPT`,`Path traversal or invalid characters detected`,{path:u}),new e.v(`Security breach: File is outside of docs directory, contains null bytes, or invalid characters: ${n}`)}let{data:d,content:f}=e.p(t),p=u.split(`/`),m,h;if(i?.versions&&p.length>0){let e=p[0],t=i.versions.prefix||``,n=i.versions.versions.find(n=>e===t+n.path||e===n.path);n&&(h=n.path,p=p.slice(1))}if(i?.i18n&&p.length>0){let e=p[0];i.i18n.locales[e]&&(m=e,p=p.slice(1))}let g;if(p.length>0){let e=p[0].match(/^\((.+)\)$/);e&&(g=e[1].toLowerCase(),p=p.slice(1))}let _=p.join(`/`),v;v=d.permalink?d.permalink.startsWith(`/`)?d.permalink:`/${d.permalink}`:e.c(_||`index.md`);let y=r;h&&(y+=`/`+h),m&&(y+=`/`+m),g&&(y+=`/`+g),y+=v===`/`?``:v,(!y||y===``)&&(y=`/`);let b=p[p.length-1],x=e.g(b),S=e.g(s.default.basename(t,s.default.extname(t))),C=d.sidebarPosition??e.s(b),w=p.length>=2?p[0]:void 0,T=w?e.g(w):void 0,E=p.length>=2&&/^index\.mdx?$/.test(x),D=new l.default,O=[];for(let t of f.matchAll(/^(#{2,4})\s+(.+)$/gm)){let n=t[1].length,r=e.m(t[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,`$1`).replace(/[_*`]/g,``).trim()).trim(),i=D.slug(r);O.push({level:n,text:r,id:i})}let k=d.title?e.m(String(d.title)):S,A=d.description?e.m(String(d.description)):``;!A&&f&&(A=e.h(f.replace(/^#+.*$/gm,``).replace(/\[([^\]]+)\]\([^\)]+\)/g,`$1`).replace(/[_*`]/g,``).replace(/\s+/g,` `)).trim().slice(0,160));let j=d.badge?e.m(String(d.badge)):void 0,M=d.icon?String(d.icon):void 0,N=ee(f);return{route:{path:y,componentPath:t,filePath:u,title:k,description:A,sidebarPosition:C,headings:O,locale:m,version:h,badge:j,icon:M,tab:g,_content:N,_rawContent:f},relativeDir:T,isGroupIndex:E,inferredTab:g,groupMeta:E?{title:d.groupTitle||d.title||(T?e.i(T):``),position:d.groupPosition??d.sidebarPosition??(w?e.s(w):void 0),icon:M}:void 0,inferredGroupPosition:w?e.s(w):void 0}}function ee(t){return e.h(t.replace(/^#+.*$/gm,``).replace(/\[([^\]]+)\]\([^\)]+\)/g,`$1`).replace(/\{[^\}]+\}/g,``).replace(/[_*`]/g,``).replace(/\s+/g,` `)).trim()}function w(e){return e.sort((e,t)=>!e.group&&!t.group?T(e,t):e.group?t.group?e.group===t.group?T(e,t):E(e,t):1:-1)}function T(e,t){return e.sidebarPosition!==void 0&&t.sidebarPosition!==void 0?e.sidebarPosition-t.sidebarPosition:e.sidebarPosition===void 0?t.sidebarPosition===void 0?e.title.localeCompare(t.title):1:-1}function E(e,t){return e.groupPosition!==void 0&&t.groupPosition!==void 0?e.groupPosition-t.groupPosition:e.groupPosition===void 0?t.groupPosition===void 0?(e.groupTitle||e.group).localeCompare(t.groupTitle||t.group):1:-1}let D=null;const O=new Map;async function k(t,n,r=`/docs`,a=!0){let o=performance.now();b.load(),O.clear(),(process.env.BOLTDOCS_FORCE_REPARSE===`true`||n?.i18n)&&b.invalidateAll();let s;!a&&D?s=D:(s=await(0,i.default)([`**/*.md`,`**/*.mdx`],{cwd:t,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),D=s),b.pruneStale(new Set(s));let c=[],l=0;for(let e=0;e<s.length;e+=50){let i=s.slice(e,e+50),a=await Promise.all(i.map(async e=>{let i=b.get(e);if(i)return l++,i;let a=C(e,t,r,n);return b.set(e,a),a}));c.push(...a),e+50<s.length&&await new Promise(e=>setImmediate(e))}b.save();let u=new Map,d=[];for(let t of c)if(t.isGroupIndex&&t.relativeDir&&d.push(t),t.relativeDir){let n=u.get(t.relativeDir);n?(n.position===void 0&&t.inferredGroupPosition!==void 0&&(n.position=t.inferredGroupPosition),!n.icon&&t.route.icon&&(n.icon=t.route.icon)):(n={title:e.i(t.relativeDir),position:t.inferredGroupPosition,icon:t.route.icon},u.set(t.relativeDir,n))}for(let e of d){let t=u.get(e.relativeDir);e.groupMeta&&(t.title=e.groupMeta.title,e.groupMeta.position!==void 0&&(t.position=e.groupMeta.position),e.groupMeta.icon&&(t.icon=e.groupMeta.icon))}let f=Array(c.length);for(let t=0;t<c.length;t++){let n=c[t],r=n.relativeDir,i=r?u.get(r):void 0;f[t]={...n.route,group:r,groupTitle:i?.title||(r?e.i(r):void 0),groupPosition:i?.position,groupIcon:i?.icon}}let p=f;if(n?.i18n){let e=A(f,n,r);p=[...f,...e]}let m=w(p),h=performance.now()-o;return console.log(`[boltdocs] Route generation: ${h.toFixed(2)}ms (${s.length} files, ${l} cache hits)`),m}function A(e,t,n){let r=t.i18n.defaultLocale,i=Object.keys(t.i18n.locales),a=[],o=new Map,s=[];for(let t of e){let e=t.locale||r;o.has(e)||o.set(e,new Set),o.get(e).add(t.path),e===r&&s.push(t)}for(let e of i){let i=o.get(e)||new Set;for(let o of s){let s=j(o.path,r,e,n,t);s!==o.path&&(i.has(s)||a.push({...o,path:s,locale:e}))}}return a}function j(e,t,n,r,i){let a=`${e}:${n}`,o=O.get(a);if(o)return o;let s=r;if(i?.versions){let t=i.versions.prefix||``;for(let n of i.versions.versions){let i=t+n.path;if(e.startsWith(`${r}/${i}`)){s+=`/`+i;break}if(e.startsWith(`${r}/${n.path}`)){s+=`/`+n.path;break}}}let c=e.substring(s.length),l=`/${t}`;if(c.startsWith(l+`/`))c=`/`+n+`/`+c.substring(l.length+1);else if(c===l)c=`/`+n;else if(c===`/`||c===``)c=`/`+n;else{let e=c.startsWith(`/`)?``:`/`;c=`/`+n+e+c}let u=s+c;return O.size>2e3&&O.clear(),O.set(a,u),u}const M=o.z.object({icon:o.z.string().max(50),link:o.z.string().url()}),N=o.z.object({text:o.z.string().max(2e3).optional()}),te=o.z.enum([`fs:read`,`fs:write`,`vite:config`,`mdx:remark`,`mdx:rehype`,`components`,`hooks:build`,`hooks:dev`]),P=o.z.object({name:o.z.string(),enforce:o.z.enum([`pre`,`post`]).optional(),version:o.z.string().optional(),boltdocsVersion:o.z.string().optional(),permissions:o.z.array(te).optional(),remarkPlugins:o.z.array(o.z.any()).optional(),rehypePlugins:o.z.array(o.z.any()).optional(),vitePlugins:o.z.array(o.z.any()).optional(),components:o.z.record(o.z.string(),o.z.string()).optional(),hooks:o.z.record(o.z.string(),o.z.any()).optional()}),ne=o.z.object({title:o.z.union([o.z.string(),o.z.record(o.z.string(),o.z.string())]).optional(),description:o.z.union([o.z.string(),o.z.record(o.z.string(),o.z.string())]).optional(),logo:o.z.union([o.z.string(),o.z.object({dark:o.z.string(),light:o.z.string(),alt:o.z.string().optional(),width:o.z.number().optional(),height:o.z.number().optional()})]).optional(),navbar:o.z.array(o.z.object({label:o.z.union([o.z.string(),o.z.record(o.z.string(),o.z.string())]),href:o.z.string()})).optional(),sidebar:o.z.record(o.z.string(),o.z.array(o.z.object({text:o.z.string(),link:o.z.string()}))).optional(),socialLinks:o.z.array(M).optional(),footer:N.optional(),breadcrumbs:o.z.boolean().optional(),editLink:o.z.string().refine(e=>!e||e.includes(`:path`),{message:`editLink must contain ':path' placeholder if specified`}).optional(),communityHelp:o.z.string().url().optional(),version:o.z.string().max(50).optional(),githubRepo:o.z.string().max(100).optional(),favicon:o.z.string().optional(),ogImage:o.z.string().optional(),poweredBy:o.z.boolean().optional(),tabs:o.z.array(o.z.object({id:o.z.string(),text:o.z.union([o.z.string(),o.z.record(o.z.string(),o.z.string())]),icon:o.z.string().optional()})).optional(),codeTheme:o.z.union([o.z.string(),o.z.object({light:o.z.string(),dark:o.z.string()})]).optional(),copyMarkdown:o.z.union([o.z.boolean(),o.z.object({text:o.z.string().optional(),icon:o.z.string().optional()})]).optional()}),re=o.z.union([o.z.string(),o.z.object({rules:o.z.array(o.z.object({userAgent:o.z.string(),allow:o.z.union([o.z.string(),o.z.array(o.z.string())]).optional(),disallow:o.z.union([o.z.string(),o.z.array(o.z.string())]).optional()})).optional(),sitemaps:o.z.array(o.z.string().url()).optional()})]),ie=o.z.object({defaultLocale:o.z.string(),locales:o.z.record(o.z.string(),o.z.string()),localeConfigs:o.z.record(o.z.string(),o.z.object({label:o.z.string().optional(),direction:o.z.enum([`ltr`,`rtl`]).optional(),htmlLang:o.z.string().optional(),calendar:o.z.string().optional()})).optional()}),ae=o.z.object({defaultVersion:o.z.string(),prefix:o.z.string().optional(),versions:o.z.array(o.z.object({label:o.z.string(),path:o.z.string()}))}),oe=o.z.object({headers:o.z.record(o.z.string(),o.z.string()).optional(),enableCSP:o.z.boolean().optional(),customHeaders:o.z.record(o.z.string(),o.z.string()).optional()}),se=o.z.object({siteUrl:o.z.string().url().optional(),docsDir:o.z.string().optional(),homePage:o.z.string().optional(),theme:ne.optional(),i18n:ie.optional(),versions:ae.optional(),plugins:o.z.array(P).optional(),robots:re.optional(),security:oe.optional(),vite:o.z.record(o.z.string(),o.z.unknown()).optional()});function ce(e){return e}const F=[`boltdocs.config.js`,`boltdocs.config.mjs`,`boltdocs.config.ts`];async function I(t,n=process.cwd()){let i=n,o={docsDir:s.default.resolve(t),theme:{title:`Boltdocs`,description:`A Vite documentation framework`,navbar:[{label:`Home`,href:`/`},{label:`Documentation`,href:`/docs`}],codeTheme:{light:`github-light`,dark:`github-dark`},poweredBy:!0,breadcrumbs:!0}},c={};for(let e of F){let t=s.default.resolve(i,e);if(a.default.existsSync(t))try{let e=await(0,r.loadConfigFromFile)({command:`serve`,mode:`development`},t,i);if(e){c=e.config;break}}catch(t){console.warn(`[boltdocs] Failed to load config from ${e}:`,t)}}let l={title:c.title,description:c.description,logo:c.logo,favicon:c.favicon,ogImage:c.ogImage,navbar:c.navbar,sidebar:c.sidebar,socialLinks:c.socialLinks,footer:c.footer,githubRepo:c.githubRepo,tabs:c.tabs,codeTheme:c.codeTheme,copyMarkdown:c.copyMarkdown,breadcrumbs:c.breadcrumbs,poweredBy:c.poweredBy,communityHelp:c.communityHelp,version:c.version,editLink:c.editLink,...c.theme||{}},u=Object.fromEntries(Object.entries(l).filter(([e,t])=>t!==void 0));u.navbar&&=u.navbar.map(e=>({label:e.label||e.text||``,href:e.href||e.link||e.to||``}));let d={docsDir:s.default.resolve(t),homePage:c.homePage,theme:{...o.theme,...u},i18n:c.i18n,versions:c.versions,siteUrl:c.siteUrl,plugins:c.plugins||[],robots:c.robots,security:c.security,vite:c.vite},f=se.safeParse(d);if(!f.success)throw new e.y(`Invalid Boltdocs configuration:\n${f.error.issues.map(e=>` - ${e.path.join(`.`)}: ${e.message}`).join(`
7
- `)}`);return f.data}function le(t,n){let r=e.a(n.title),i=e.a(n.description);return t.replace(/<title>.*?<\/title>/,`<title>${r}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${i}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${i}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${i}$2`)}function ue(t,n){let r=n?.siteUrl?.replace(/\/$/,``)||`https://example.com`,i=new Date().toISOString().split(`T`)[0],a=[{url:`/`,priority:`1.0`,changefreq:`daily`}];if(n?.i18n){let e=n.i18n.defaultLocale;for(let t of Object.keys(n.i18n.locales))t!==e&&a.push({url:`/${t}/`,priority:`1.0`,changefreq:`daily`})}return`<?xml version="1.0" encoding="UTF-8"?>
8
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
9
- ${[...a,...t.map(e=>({url:e,priority:`0.8`,changefreq:`weekly`}))].map(t=>` <url>
10
- <loc>${e.o(r)}${e.o(t.url)}</loc>
11
- <lastmod>${i}</lastmod>
12
- <changefreq>${t.changefreq}</changefreq>
13
- <priority>${t.priority}</priority>
14
- </url>`).join(`
15
- `)}
16
- </urlset>`}function de(e){if(typeof e.robots==`string`)return e.robots;let t=e.siteUrl?.replace(/\/$/,``)||``,n=e.robots||{},r=n.rules||[{userAgent:`*`,allow:`/`}],i=n.sitemaps||(t?[`${t}/sitemap.xml`]:[]),a=``;for(let e of r){if(a+=`User-agent: ${e.userAgent}\n`,e.disallow){let t=Array.isArray(e.disallow)?e.disallow:[e.disallow];for(let e of t)a+=`Disallow: ${e}\n`}if(e.allow){let t=Array.isArray(e.allow)?e.allow:[e.allow];for(let e of t)a+=`Allow: ${e}\n`}a+=`
17
- `}for(let e of i)a+=`Sitemap: ${e}\n`;return a.trim()}const fe=(0,d.fileURLToPath)(require(`url`).pathToFileURL(__filename).href),pe=s.default.dirname(fe),me=(0,f.createRequire)(require(`url`).pathToFileURL(__filename).href);async function he(t){let{docsDir:n,docsDirName:r,outDir:i,config:o}=t,c=await k(n,o),l=[`tsx`,`ts`,`jsx`,`js`].map(e=>s.default.resolve(n,`pages-external/index.${e}`)).find(e=>a.default.existsSync(e));if(l)try{let e=a.default.readFileSync(l,`utf-8`),t=e.match(/pages\s*:\s*{([^}]+)}/s);if(t){let e=t[1].split(`,`).map(e=>e.split(`:`)[0].trim().replace(/['"]/g,``)).filter(e=>e&&e.startsWith(`/`));for(let t of e)c.some(e=>e.path===t)||c.push({path:t,title:t.slice(1).charAt(0).toUpperCase()+t.slice(2),filePath:``,componentPath:``,_content:``})}e.includes(`homePage`)&&!c.some(e=>e.path===`/`)&&c.push({path:`/`,title:`Home`,filePath:``,componentPath:``,_content:``})}catch(e){console.warn(`[boltdocs] Failed to parse external routes for SSG:`,e)}let u=s.default.resolve(pe,`../client/ssr.js`);if(!a.default.existsSync(u)){console.error(`[boltdocs] SSR module not found at`,u,`- Did you build the core package?`);return}let d=me(`module`),f=d.prototype.require;d.prototype.require=function(e,...t){return e.startsWith(`virtual:boltdocs-`)?e===`virtual:boltdocs-layout`?{__esModule:!0,default:function(e){try{let t=f.apply(this,[s.default.resolve(pe,`../client/index.js`)]).DefaultLayout||(({children:e})=>e);return f.apply(this,[`react`]).createElement(t,e)}catch{return e.children}}}:e===`virtual:boltdocs-mdx-components`?{__esModule:!0,default:{}}:e===`virtual:boltdocs-config`?{__esModule:!0,default:o}:{__esModule:!0,default:e.includes(`routes`)?[]:{}}:f.apply(this,[e,...t])};let{render:p}=me(u);d.prototype.require=f;let m=s.default.join(i,`index.html`);if(!a.default.existsSync(m)){console.warn(`[boltdocs] No index.html found in outDir, skipping SSG.`);return}let h=a.default.readFileSync(m,`utf-8`);await Promise.all(c.map(async t=>{let n=e.l(o?.theme?.title,t.locale)||`Boltdocs`,l=e.l(o?.theme?.description,t.locale)||``,u=`${t.title} | ${n}`,d=t.description||l,f={};f[`/${r}/${t.filePath}`]={default:()=>null};try{let n=await p({path:t.path,routes:c,config:o||{},docsDirName:r,modules:f,homePage:void 0}),l=le(h,{title:e.a(u),description:e.a(d)}).replace(`<!--app-html-->`,n).replace(`<div id="root"></div>`,`<div id="root">${n}</div>`),m=s.default.join(i,t.path);await a.default.promises.mkdir(m,{recursive:!0}),await a.default.promises.writeFile(s.default.join(m,`index.html`),l,`utf-8`)}catch(e){console.error(`[boltdocs] Error SSR rendering route ${t.path}:`,e&&(e.stack||e))}}));let g=ue(c.map(e=>e.path),o);a.default.writeFileSync(s.default.join(i,`sitemap.xml`),g,`utf-8`);let _=de(o);a.default.writeFileSync(s.default.join(i,`robots.txt`),_,`utf-8`),console.log(`[boltdocs] Generated ${c.length} static pages + sitemap.xml + robots.txt`);let{flushCache:v}=await Promise.resolve().then(()=>require(`./cache-Cr8W2zgZ.cjs`)).then(e=>e.r);await v()}function ge(t,n){let r=t.homePage?`import HomePage from '${e.f(t.homePage)}';`:``,i=s.default.resolve(process.cwd(),`index.css`),o=a.default.existsSync(i)?`import './index.css';`:``,c=t.homePage?`homePage: HomePage,`:``,l=n?.plugins?.flatMap(e=>Object.entries(e.components||{}))||[],u=l.map(([t,n])=>`import * as _comp_${t} from '${e.f(n)}';
18
- const ${t} = _comp_${t}.default || _comp_${t}['${t}'] || _comp_${t};`).join(`
19
- `),d=l.map(([e])=>e).join(`, `),f=s.default.basename(t.docsDir||`docs`),p=s.default.resolve(process.cwd(),t.docsDir||`docs`),m=[`tsx`,`ts`,`jsx`,`js`].map(e=>s.default.resolve(p,`pages-external/index.${e}`)).find(e=>a.default.existsSync(e)),h=m?`import * as _external_module from '${e.f(m)}';`:``;return c=m?`homePage: _external_module.homePage || HomePage,`:t.homePage?`homePage: HomePage,`:``,`
20
- import { createBoltdocsApp as _createApp } from 'boltdocs/client';
21
- import _routes from 'virtual:boltdocs-routes';
22
- import _config from 'virtual:boltdocs-config';
23
- import _user_mdx_components from 'virtual:boltdocs-mdx-components';
24
- ${o}
25
- ${r}
26
- ${u}
27
- ${h}
28
-
29
- _createApp({
30
- target: '#root',
31
- routes: _routes,
32
- docsDirName: '${f}',
33
- config: _config,
34
- modules: import.meta.glob('/${f}/**/*.{md,mdx}'),
35
- hot: import.meta.hot,
36
- ${c}
37
- ${m?`externalPages: _external_module.pages, externalLayout: _external_module.layout,`:``}
38
- components: { ${d}${d?`, `:``} ...(_user_mdx_components || {}) },
39
- });
40
- `}function _e(e){return`<!doctype html>
41
- <html lang="en">
42
- <head>
43
- <meta charset="UTF-8" />
44
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
45
- <title>${e.theme?.title||`Boltdocs`}</title>
46
- </head>
47
- <body>
48
- <div id="root"></div>
49
- </body>
50
- </html>`}function L(e,t){let n=t.theme,r=n?.title||`Boltdocs`,i=n?.description||``,a=n?.favicon;!a&&n?.logo&&(a=typeof n.logo==`string`?n.logo:n.logo.light||n.logo.dark);let o=[a?`<link rel="icon" href="${a}">`:``,`<meta name="description" content="${i}">`,`<meta property="og:title" content="${r}">`,`<meta property="og:description" content="${i}">`,n?.ogImage?`<meta property="og:image" content="${n.ogImage}">`:``,`<meta property="og:type" content="website">`,`<meta name="twitter:card" content="summary_large_image">`,`<meta name="twitter:title" content="${r}">`,`<meta name="twitter:description" content="${i}">`,n?.ogImage?`<meta name="twitter:image" content="${n.ogImage}">`:``,`<meta name="generator" content="Boltdocs">`].filter(Boolean).join(`
51
- `);return e=e.includes(`<title>`)?e.replace(/<title>.*?<\/title>/,`<title>${r}</title>`):e.replace(`</head>`,` <title>${r}</title>\n </head>`),e=e.replace(`</head>`,` ${o}\n
52
- <script>
53
- (function() {
54
- try {
55
- var stored = localStorage.getItem("boltdocs-theme");
56
- var theme = stored || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
57
- if (theme === "light") {
58
- document.documentElement.classList.add("theme-light");
59
- document.documentElement.dataset.theme = "light";
60
- } else {
61
- document.documentElement.classList.remove("theme-light");
62
- document.documentElement.dataset.theme = "dark";
63
- }
64
- } catch (e) {}
65
- })();
66
- <\/script>
67
- </head>`),!e.includes(`src/main`)&&!e.includes(`virtual:boltdocs-entry`)&&(e=e.replace(`</body>`,` <script type="module">import "virtual:boltdocs-entry";<\/script>
68
- </body>`)),e}function ve(e){let t=[];for(let n of e)if(t.push({id:n.path,title:n.title,content:n._content||``,url:n.path,display:n.groupTitle?`${n.groupTitle} > ${n.title}`:n.title,locale:n.locale,version:n.version}),n.headings)for(let e of n.headings)t.push({id:`${n.path}#${e.id}`,title:e.text,content:`${e.text} in ${n.title}`,url:`${n.path}#${e.id}`,display:`${n.title} > ${e.text}`,locale:n.locale,version:n.version});return t}const R={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function z(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}var B=class e extends Error{pluginName;constructor(t,n){super(`[plugin:${t}] ${n}`),this.name=`PluginError`,this.pluginName=t,Object.setPrototypeOf(this,e.prototype)}},V=class e extends B{constructor(t,n){super(t,`Validation failed: ${n}`),this.name=`PluginValidationError`,Object.setPrototypeOf(this,e.prototype)}},H=class e extends B{constructor(t,n){super(t,`Compatibility error: ${n}`),this.name=`PluginCompatibilityError`,Object.setPrototypeOf(this,e.prototype)}},U=class e extends B{constructor(t,n){super(t,`Missing required permission: '${n}'`),this.name=`PluginPermissionError`,Object.setPrototypeOf(this,e.prototype)}},W=class e extends B{hookName;constructor(t,n,r){super(t,`Error in hook '${n}': ${r.message}`),this.name=`PluginHookError`,this.hookName=n,this.stack=r.stack,Object.setPrototypeOf(this,e.prototype)}},G=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let n=this.getNamespaceKey(e,t),r=this.data.get(n);if(r!==void 0)return typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r}set(e,t,n){let r=this.getNamespaceKey(e,t),i=typeof n==`object`&&n?JSON.parse(JSON.stringify(n)):n;this.data.set(r,i)}has(e,t){let n=this.getNamespaceKey(e,t);return this.data.has(n)}};const K=P.extend({version:o.z.string().optional(),boltdocsVersion:o.z.string().optional(),permissions:o.z.array(o.z.string()).optional(),hooks:o.z.object({beforeBuild:o.z.function().optional(),afterBuild:o.z.function().optional(),beforeDev:o.z.function().optional(),afterDev:o.z.function().optional(),configResolved:o.z.function().optional(),buildEnd:o.z.function().optional()}).optional()});function q(e,t){let n=[],r=new Set;for(let i of e){let e=K.safeParse(i);if(!e.success)throw new V(i.name||`unknown`,e.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `));let a=e.data;if(r.has(a.name))throw new V(a.name,`Duplicate plugin name detected`);if(r.add(a.name),a.boltdocsVersion&&!p.default.satisfies(t,a.boltdocsVersion))throw new H(a.name,`Plugin expects Boltdocs version ${a.boltdocsVersion}, but current is ${t}`);if(a.components){for(let[e,t]of Object.entries(a.components))if((t.includes(`..`)||s.default.isAbsolute(t))&&t.includes(`..`))throw new V(a.name,`Component '${e}' has an invalid path: traversal sequences are not allowed.`)}n.push(a)}return n}function J(e,t){return e.permissions?e.permissions.includes(t):!1}var Y=class{static checkPermission(e,t){if(!J(e,t))throw new U(e.name,t)}static getSanitizedCapabilities(e){return{remarkPlugins:J(e,`mdx:remark`)?e.remarkPlugins:[],rehypePlugins:J(e,`mdx:rehype`)?e.rehypePlugins:[],vitePlugins:J(e,`vite:config`)?e.vitePlugins:[],components:J(e,`components`)?e.components:{}}}static async executeWithIsolation(e,t,n,r){try{return this.checkPermission(e,t),await r()}catch(t){if(t instanceof U){console.warn(`[boltdocs] Skipping hook '${n}' for plugin '${e.name}': ${t.message}`);return}throw t}}},ye=class{plugins;config;store;constructor(e,t){this.plugins=e,this.config=t,this.store=new G}async runHook(e,...t){let n=this.getSortedPlugins();for(let r of n){if(!r.hooks?.[e])continue;let n=this.createContext(r),i=e.toLowerCase().includes(`build`),a=e.toLowerCase().includes(`dev`),o=i?`hooks:build`:a?`hooks:dev`:void 0;try{o?await Y.executeWithIsolation(r,o,e,()=>r.hooks[e](n,...t)):await r.hooks[e](n,...t)}catch(t){let i=new W(r.name,e,t instanceof Error?t:Error(String(t)));n.logger.error(i)}}}getSortedPlugins(){let e=this.plugins.filter(e=>e.enforce===`pre`),t=this.plugins.filter(e=>!e.enforce),n=this.plugins.filter(e=>e.enforce===`post`);return[...e,...t,...n]}createContext(e){return{config:Object.freeze({...this.config}),meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(e,t)=>this.store.get(e,t),set:(e,t,n)=>this.store.set(e,t,n),has:(e,t)=>this.store.has(e,t)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:e=>console.log(`${t} INFO: ${e}`),warn:e=>console.warn(`${t} WARN: ${e}`),error:e=>{let n=e instanceof Error?e.message:e;console.error(`${t} ERROR: ${n}`)},debug:e=>console.debug(`${t} DEBUG: ${e}`)}}};function be(e){return e}function xe(t={},n){let i=s.default.resolve(process.cwd(),t.docsDir||`docs`),o=e.f(i),c=n,l,d=!1,f,p=[];return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){d=t.command===`build`;let n=e.envDir||process.cwd(),a=(0,r.loadEnv)(t.mode,n,``);Object.assign(process.env,a),c||=await I(i);let o=(await Promise.resolve().then(()=>require(`./package-BY8Jd2j4.cjs`))).version,s=q(c.plugins||[],o);return c.plugins=s,f=new ye(s,c),p=s.flatMap(e=>Y.getSanitizedCapabilities(e).vitePlugins||[]),d&&await f.runHook(`beforeBuild`),{optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{dedupe:[`react`,`react-dom`]}}},configResolved(e){l=e,f?.runHook(`configResolved`,c)},async configureServer(t){await f?.runHook(`beforeDev`),t.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(R).forEach(([e,n])=>{t.setHeader(e,n)}),c.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,z(c)),n()}),t.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){let e=de(c);t.statusCode=200,t.setHeader(`Content-Type`,`text/plain`),t.end(e);return}n()}),t.middlewares.use(async(e,n,r)=>{let i=e.url?.split(`?`)[0]||`/`,a=e.headers.accept||``,o=i===`/`||i.startsWith(`/docs`)||c.i18n&&Object.keys(c.i18n.locales).some(e=>i.startsWith(`/${e}/docs`)||i===`/${e}`)||!0,s=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(i);if(a.includes(`text/html`)&&!s&&o){let r=_e(c);r=L(r,c),r=await t.transformIndexHtml(e.url||`/`,r),n.statusCode=200,n.setHeader(`Content-Type`,`text/html`),n.end(r);return}r()});let n=F.map(e=>s.default.resolve(process.cwd(),e)),r=[`tsx`,`jsx`],a=r.map(e=>s.default.resolve(i,`layout.${e}`)),l=[`tsx`,`ts`,`jsx`,`js`],u=l.map(e=>s.default.resolve(i,`mdx-components.${e}`)),d=l.map(e=>s.default.resolve(i,`pages-external/index.${e}`));t.watcher.add([...n,...u,...a,...d]);let p=async(n,a)=>{try{let s=e.f(n);if(F.some(e=>s.endsWith(e))){t.restart();return}if(l.some(e=>s.endsWith(`mdx-components.${e}`))){let e=t.moduleGraph.getModuleById(`\0virtual:boltdocs-mdx-components`);e&&t.moduleGraph.invalidateModule(e),t.ws.send({type:`full-reload`});return}if(r.some(e=>s.endsWith(`layout.${e}`))){let e=t.moduleGraph.getModuleById(`\0virtual:boltdocs-layout`);e&&t.moduleGraph.invalidateModule(e),t.ws.send({type:`full-reload`});return}if(s.includes(`/pages-external/`)||s.includes(`\\pages-external\\`)){let e=t.moduleGraph.getModuleById(`\0virtual:boltdocs-entry`);e&&t.moduleGraph.invalidateModule(e),t.ws.send({type:`full-reload`});return}if(!s.startsWith(o)||!e.u(s))return;if(a===`add`||a===`unlink`){x(),c=await I(i);let e=t.moduleGraph.getModuleById(`\0virtual:boltdocs-config`);e&&t.moduleGraph.invalidateModule(e),t.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:c?.theme,i18n:c?.i18n,versions:c?.versions,siteUrl:c?.siteUrl}})}else S(n);let u=await k(i,c,`/docs`,a!==`change`),d=t.moduleGraph.getModuleById(`\0virtual:boltdocs-routes`);d&&t.moduleGraph.invalidateModule(d),t.ws.send({type:`custom`,event:`boltdocs:routes-update`,data:u})}catch(e){console.error(`[boltdocs] HMR error during ${a} event:`,e)}};t.watcher.on(`add`,e=>p(e,`add`)),t.watcher.on(`unlink`,e=>p(e,`unlink`)),t.watcher.on(`change`,e=>p(e,`change`)),await f?.runHook(`afterDev`)},resolveId(e){if(e===`virtual:boltdocs-routes`||e===`virtual:boltdocs-config`||e===`virtual:boltdocs-entry`||e===`virtual:boltdocs-mdx-components`||e===`virtual:boltdocs-layout`||e===`virtual:boltdocs-search`)return`\0`+e},async load(n){if(n===`\0virtual:boltdocs-routes`){let e=await k(i,c);return`export default ${JSON.stringify(e,null,2)};`}if(n===`\0virtual:boltdocs-config`){let e={theme:c?.theme,i18n:c?.i18n,versions:c?.versions,siteUrl:c?.siteUrl,plugins:c?.plugins?.map(e=>({name:e.name}))};return`export default ${JSON.stringify(e,null,2)};`}if(n===`\0virtual:boltdocs-entry`)return ge(t,c);if(n===`\0virtual:boltdocs-mdx-components`){let t=[`tsx`,`ts`,`jsx`,`js`],n=null;for(let e of t){let t=s.default.resolve(i,`mdx-components.${e}`);if(a.default.existsSync(t)){n=t;break}}if(n){let t=e.f(n);return`import * as components from '${t}';
69
- const mdxComponents = components.default || components;
70
- export default mdxComponents;
71
- export * from '${t}';`}return`export default {};`}if(n===`\0virtual:boltdocs-layout`){let t=[`tsx`,`jsx`],n=null;for(let e of t){let t=s.default.resolve(i,`layout.${e}`);if(a.default.existsSync(t)){n=t;break}}return n?`import UserLayout from '${e.f(n)}';
72
- export default UserLayout;`:`import { DefaultLayout } from 'boltdocs/client';
73
- export default DefaultLayout;`}if(n===`\0virtual:boltdocs-search`){let e=ve(await k(i,c));return`export default ${JSON.stringify(e,null,2)};`}},transformIndexHtml:{order:`pre`,handler(e){return L(e,c)}},async closeBundle(){if(!d)return;let e=l?.build?.outDir?s.default.resolve(l.root,l.build.outDir):s.default.resolve(process.cwd(),`dist`);await he({docsDir:i,docsDirName:s.default.basename(i||`docs`),outDir:e,config:c});let{flushCache:t}=await Promise.resolve().then(()=>require(`./cache-Cr8W2zgZ.cjs`)).then(e=>e.r);await t(),await f?.runHook(`afterBuild`),await f?.runHook(`buildEnd`)}},(0,u.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),{name:`vite-plugin-boltdocs-extra-plugins`,async configResolved(){}},...p]}const X=new e.n(`mdx`);let Z=null;async function Se(e){if(Z)return Z;let t=typeof e==`object`?[e.light,e.dark]:[e??`github-dark`];return[`github-light`,`github-dark`].forEach(e=>{t.includes(e)||t.push(e)}),Z=await(0,y.createHighlighter)({themes:t,langs:[`tsx`,`jsx`,`ts`,`js`,`json`,`md`,`mdx`,`css`,`html`,`bash`,`sh`,`yaml`,`yml`]}),Z}function Ce(e){return async t=>{let n=e?.theme?.codeTheme??{light:`github-light`,dark:`github-dark`},r=await Se(n);(0,v.visit)(t,[`mdxJsxFlowElement`,`mdxJsxTextElement`],e=>{if(e.name!==`ComponentPreview`)return;let t=e.attributes?.find(e=>e.name===`code`),i=``;if(t){if(typeof t.value==`string`)i=t.value;else if(t.value?.type===`mdxJsxAttributeValueExpression`){let e=t.value.value??``;i=e.match(/^[`'"]([\s\S]+)[`'"]$/)?.[1]??e}}if(!i)return;let a=typeof n==`object`?{themes:{light:n.light,dark:n.dark},lang:`tsx`}:{theme:n,lang:`tsx`},o=r.codeToHtml(i,a);e.attributes=(e.attributes??[]).filter(e=>e.name!==`highlightedHtml`),e.attributes.push({type:`mdxJsxAttribute`,name:`highlightedHtml`,value:o})})}}function we(e){return async t=>{let n=e?.theme?.codeTheme||{light:`github-light`,dark:`github-dark`},r=await Se(n);(0,v.visit)(t,`element`,e=>{if(e.tagName===`pre`&&e.children?.[0]?.tagName===`code`){let t=e.children[0],i=(t.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):`text`,o=t.children[0]?.value||``,s=(t.data?.meta||t.properties?.metastring||``).match(/title\s*=\s*"([^"]*)"/),c=s?s[1]:void 0,l={lang:a};typeof n==`object`?l.themes={light:n.light,dark:n.dark}:l.theme=n;let u=r.codeToHtml(o,l);e.properties[`data-highlighted`]=`true`,e.properties[`data-highlighted-html`]=u,e.properties[`data-lang`]=a,c&&(e.properties.title=c),e.children=[]}})}}function Te(){return e=>{(0,v.visit)(e,`code`,e=>{if(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.lang&&(e.data.hProperties[`data-lang`]=e.lang),!e.meta)return;let t=e.meta,n=t.match(/title\s*=\s*"([^"]*)"/);n&&(e.data.hProperties.title=n[1]),e.data.hProperties.metastring=t})}}let Ee=!1,Q=0,$=0;function De(e,t=m.default){let n=e?.plugins?.flatMap(e=>Y.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>Y.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[h.default,g.default,Te,[Ce,e],...n],rehypePlugins:[_.default,[we,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){Q=0,$=0,Ee||=(X.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){if(!t.endsWith(`.md`)&&!t.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);console.log(`[boltdocs] Transforming MDX: ${t}`),$++;let r=`${t}:${c.default.createHash(`md5`).update(e).digest(`hex`)}:v4`,a=X.get(r);if(a)return Q++,{code:a,map:null};let o=await i.transform.call(this,e,t,n);return o&&typeof o==`object`&&o.code&&X.set(r,o.code),o},async buildEnd(){$>0&&console.log(`[boltdocs] MDX Cache Performance: ${Q}/${$} hits (${Math.round(Q/$*100)||0}%)`),X.save(),await X.flush(),i.buildEnd&&await i.buildEnd.call(this)}}}async function Oe(e){let t=await I(e?.docsDir||`docs`);return[...xe({...e,homePage:e?.homePage||t.homePage},t),De(t)]}async function ke(e,r=`development`){let i=await I(`docs`,e),a=r===`production`?{...R}:{};return i.security?.enableCSP&&(a[`Content-Security-Policy`]=z(i)),{root:e,mode:r,plugins:[(0,t.default)(),(0,n.default)(),await Oe({docsDir:i.docsDir,homePage:i.homePage})],resolve:{alias:{"use-sync-external-store/shim/index.js":`react`,"use-sync-external-store/shim":`react`,"use-sync-external-store":`react`}},server:{headers:{...a,...i.vite?.server?.headers},...i.vite?.server},preview:{headers:{...a,...i.vite?.preview?.headers},...i.vite?.preview},...i.vite}}Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return I}});
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- import{g as e,t,v as n}from"./use-search-D25n0PrV.mjs";import{useCallback as r,useEffect as i}from"react";import{useNavigate as a}from"react-router-dom";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";function l({routes:l}){let{isOpen:u,setIsOpen:d,query:f,setQuery:p,list:m}=t(l),h=a();i(()=>{let e=e=>{(/Mac/.test(navigator.userAgent)?e.metaKey:e.ctrlKey)&&(e.key===`k`||e.key===`j`)&&(e.preventDefault(),d(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d]);let g=r(e=>{let t=String(e);if(d(!1),t.includes(`#`)){let[e,n]=t.split(`#`);h(e),setTimeout(()=>{let e=document.getElementById(n);e&&e.scrollIntoView({behavior:`smooth`})},100)}else h(t)},[h,d]);return c(o,{children:[s(n.SearchTrigger,{onPress:()=>d(!0)}),s(e.Root,{isOpen:u,onOpenChange:d,children:c(e.Autocomplete,{onSelectionChange:g,children:[s(e.Input,{value:f,onChange:e=>p(e.target.value)}),s(e.List,{items:m,children:t=>c(e.Item,{onPress:()=>g(t.id),textValue:t.title,children:[s(e.Item.Icon,{isHeading:t.isHeading}),c(`div`,{className:`flex flex-col justify-center gap-0.5`,children:[s(e.Item.Title,{children:t.title}),s(e.Item.Bio,{children:t.bio})]})]},t.id)})]})})]})}export{l as SearchDialog};
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- const e=require(`./use-search-WuzdH1cJ.js`);let t=require(`react`),n=require(`react-router-dom`),r=require(`react/jsx-runtime`);function i({routes:i}){let{isOpen:a,setIsOpen:o,query:s,setQuery:c,list:l}=e.t(i),u=(0,n.useNavigate)();(0,t.useEffect)(()=>{let e=e=>{(/Mac/.test(navigator.userAgent)?e.metaKey:e.ctrlKey)&&(e.key===`k`||e.key===`j`)&&(e.preventDefault(),o(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o]);let d=(0,t.useCallback)(e=>{let t=String(e);if(o(!1),t.includes(`#`)){let[e,n]=t.split(`#`);u(e),setTimeout(()=>{let e=document.getElementById(n);e&&e.scrollIntoView({behavior:`smooth`})},100)}else u(t)},[u,o]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e.r.SearchTrigger,{onPress:()=>o(!0)}),(0,r.jsx)(e.n.Root,{isOpen:a,onOpenChange:o,children:(0,r.jsxs)(e.n.Autocomplete,{onSelectionChange:d,children:[(0,r.jsx)(e.n.Input,{value:s,onChange:e=>c(e.target.value)}),(0,r.jsx)(e.n.List,{items:l,children:t=>(0,r.jsxs)(e.n.Item,{onPress:()=>d(t.id),textValue:t.title,children:[(0,r.jsx)(e.n.Item.Icon,{isHeading:t.isHeading}),(0,r.jsxs)(`div`,{className:`flex flex-col justify-center gap-0.5`,children:[(0,r.jsx)(e.n.Item.Title,{children:t.title}),(0,r.jsx)(e.n.Item.Bio,{children:t.bio})]})]},t.id)})]})})]})}exports.SearchDialog=i;
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- import e,{createContext as t,use as n,useCallback as r,useContext as i,useEffect as a,useImperativeHandle as o,useMemo as s,useRef as c,useState as l}from"react";import{useLocation as u}from"react-router-dom";import{Check as d,ChevronDown as f,ChevronLeft as p,ChevronRight as m,CornerDownLeft as ee,Dot as te,ExternalLink as ne,FileText as re,Hash as ie,Moon as ae,Search as h,Sun as oe}from"lucide-react";import*as g from"react-aria-components";import{Breadcrumb as se,Breadcrumbs as ce,Button as le,Link as _,Separator as ue,ToggleButton as de}from"react-aria-components";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{clsx as fe}from"clsx";import{twMerge as pe}from"tailwind-merge";import{cva as me}from"class-variance-authority";import he from"scroll-into-view-if-needed";import{Index as ge}from"flexsearch";import x from"virtual:boltdocs-search";const S=t(null);function C(){let e=n(S);if(!e)throw Error(`useConfig must be used within a ConfigProvider`);return e}const w=t({preload:()=>{},routes:[]});function T(){return n(w)}function _e({routes:e,modules:t,children:n}){let i=c(null),a=r(n=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{let r=n.split(`#`)[0].split(`?`)[0],i=e.find(e=>e.path===r||r===`/`&&e.path===``);if(i?.filePath){let e=Object.keys(t).find(e=>e.endsWith(`/`+i.filePath));e&&t[e]().catch(e=>{console.error(`[boltdocs] Failed to preload route ${n}:`,e)})}},100)},[e,t]);return y(w.Provider,{value:{preload:a,routes:e},children:n})}const E=t(void 0),D=`boltdocs-storage`;function ve(){try{let e=localStorage.getItem(D);if(e){let t=JSON.parse(e);return t?.state||t}}catch{}return{}}function ye({children:e}){let t=ve(),[n,i]=l(t.currentLocale),[o,s]=l(t.currentVersion),[c,u]=l(!1);a(()=>{u(!0)},[]),a(()=>{if(c){let e={currentLocale:n,currentVersion:o};try{localStorage.setItem(D,JSON.stringify({state:e}))}catch{}}},[n,o,c]);let d={currentLocale:n,currentVersion:o,hasHydrated:c,setLocale:r(e=>{i(e)},[]),setVersion:r(e=>{s(e)},[]),setHasHydrated:r(e=>{u(e)},[])};return y(E.Provider,{value:d,children:e})}function be(){let e=i(E);if(!e)throw Error(`useBoltdocsContext must be used within a BoltdocsProvider`);return e}function O(e){return e(be())}function k(){let{routes:e}=T(),t=C(),n=u(),r=O(e=>e.currentLocale),i=O(e=>e.currentVersion),a=O(e=>e.hasHydrated),o=e.find(e=>e.path===n.pathname),s=t.i18n?o?.locale||(a?r:void 0)||t.i18n.defaultLocale:void 0,c=t.versions?o?.version||(a?i:void 0)||t.versions.defaultVersion:void 0,l=e.filter(n=>{let r=t.i18n?(n.locale||t.i18n.defaultLocale)===s:!0,i=t.versions?(n.version||t.versions.defaultVersion)===c:!0;if(!(r&&i))return!1;let a=t.i18n;if(a){let t=!!o?.locale,r=!!n.locale;if(e.some(e=>e!==n&&e.filePath===n.filePath&&e.version===n.version&&(e.locale||a.defaultLocale)===(n.locale||a.defaultLocale))&&t!==r)return!1}return!0}),d=t.i18n?.localeConfigs?.[s]?.label||t.i18n?.locales[s]||s,f=t.versions?.versions.find(e=>e.path===c)?.label||c;return{routes:l,allRoutes:e,currentRoute:o,currentLocale:s,currentLocaleLabel:d,availableLocales:t.i18n?Object.entries(t.i18n.locales).map(([e,n])=>({key:e,label:t.i18n?.localeConfigs?.[e]?.label||n,isCurrent:e===s})):[],currentVersion:c,currentVersionLabel:f,availableVersions:t.versions?t.versions.versions.map(e=>({key:e.path,label:e.label,isCurrent:e.path===c})):[],config:t}}function A(e){let t=C(),{currentLocale:n,currentVersion:r}=k();if(!t||typeof e!=`string`||e.startsWith(`http`)||e.startsWith(`//`))return e;let i=t.i18n,a=t.versions;if(!i&&!a)return e;let o=e.startsWith(`/docs`),s=e.split(`/`).filter(Boolean),c=0;s[c]===`docs`&&c++,a&&s.length>c&&a.versions.find(e=>e.path===s[c])&&c++,i&&s.length>c&&i.locales[s[c]]&&c++;let l=s.slice(c),u=[];o&&(u.push(`docs`),a&&r&&u.push(r)),i&&n&&n!==i.defaultLocale&&u.push(n),u.push(...l);let d=`/${u.join(`/`)}`;return d.length>1&&d.endsWith(`/`)?d.slice(0,-1):d||`/`}function j(...e){return pe(fe(e))}const M=e.forwardRef((e,t)=>{let{href:n,prefetch:r=`hover`,onMouseEnter:i,onFocus:a,...o}=e,s=A(n??``),{preload:c}=T(),l=e=>{i?.(e),r===`hover`&&typeof s==`string`&&s.startsWith(`/`)&&c(s)},u=e=>{a?.(e),r===`hover`&&typeof s==`string`&&s.startsWith(`/`)&&c(s)};return y(_,{...o,ref:t,href:s,onMouseEnter:l,onFocus:u})});M.displayName=`Link`;const N=e.forwardRef((e,t)=>{let{href:n,end:r=!1,className:i,children:a,...o}=e,s=u(),c=A(n??``),l=r?s.pathname===c:s.pathname.startsWith(c),d=typeof i==`function`?i({isActive:l}):j(i,l&&`active`),f=typeof a==`function`?a({isActive:l}):a;return y(M,{...o,ref:t,href:n,className:d,children:f})});N.displayName=`NavLink`;const P=me(`flex flex-row items-center justify-center w-auto font-semibold tracking-tight no-underline whitespace-nowrap select-none outline-none transition-all duration-200 cursor-pointer pressed:scale-[0.97] hover:-translate-y-px leading-none`,{variants:{variant:{primary:`bg-primary-500 text-white shadow-md hover:brightness-110 hover:shadow-lg`,secondary:`bg-bg-surface text-text-main border border-border-subtle hover:bg-bg-muted hover:border-border-strong`,outline:`bg-transparent text-text-main border border-border-strong hover:bg-bg-surface hover:border-primary-500`,ghost:`bg-transparent text-text-muted hover:bg-bg-surface hover:text-text-main`,danger:`bg-[var(--color-danger-500)]/10 text-[var(--color-danger-500)] border border-[var(--color-danger-500)]/20 hover:bg-[var(--color-danger-500)]/15`,success:`bg-[var(--color-success-500)]/10 text-[var(--color-success-500)] border border-[var(--color-success-500)]/20 hover:bg-[var(--color-success-500)]/15`,warning:`bg-[var(--color-warning-500)]/10 text-[var(--color-warning-500)] border border-[var(--color-warning-500)]/20 hover:bg-[var(--color-warning-500)]/15`,info:`bg-[var(--color-info-500)]/10 text-[var(--color-info-500)] border border-[var(--color-info-500)]/20 hover:bg-[var(--color-info-500)]/15`,subtle:`bg-primary-500/10 text-primary-500 hover:bg-primary-500/20`,link:`bg-transparent text-primary-500 !p-0 !min-h-0 hover:underline`},size:{sm:`min-h-8 px-3.5 text-[0.8125rem] gap-1.5`,md:`min-h-10 px-5 text-[0.9375rem] gap-2`,lg:`min-h-12 px-7 text-[1.05rem] gap-2.5`},rounded:{none:`rounded-none`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,full:`rounded-full`},iconSize:{sm:`w-8 h-8 p-0`,md:`w-10 h-10 p-0`,lg:`w-12 h-12 p-0`},disabled:{true:`opacity-50 cursor-not-allowed pointer-events-none`,false:null}},defaultVariants:{variant:`primary`,size:`md`,rounded:`md`}}),xe=({href:e,icon:t,iconPosition:n=`left`,isIconOnly:r,children:i,className:a,variant:o,size:s,rounded:c,iconSize:l,disabled:u,...d})=>{let f=r||!i&&!!t,p=f?y(`span`,{className:`inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]`,children:t}):b(v,{children:[t&&n===`left`&&y(`span`,{className:`inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]`,children:t}),y(`span`,{className:`flex items-center`,children:i}),t&&n===`right`&&y(`span`,{className:`inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]`,children:t})]});return e?y(g.Link,{href:e,className:j(P({variant:o,size:s,rounded:c,iconSize:f?l:void 0,disabled:u}),a),...d,children:p}):y(g.Button,{className:j(P({variant:o,size:s,rounded:c,iconSize:f?l:void 0,disabled:u}),a),...d,children:p})};function F(e){let{size:t=20,...n}=e;return{...n,width:t,height:t}}const I=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...F(e),children:[y(`title`,{children:`GitHub`}),y(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})]}),Se=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...F(e),children:[y(`title`,{children:`Discord`}),y(`path`,{d:`M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z`})]}),Ce=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...F(e),children:[y(`title`,{children:`X`}),y(`path`,{d:`M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z`})]}),we=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...F(e),children:[y(`title`,{children:`Bluesky`}),y(`path`,{d:`M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037-.856 3.061-3.978 3.842-6.755 3.37 4.854.826 6.089 3.562 3.422 6.299-5.065 5.196-7.28-1.304-7.847-2.97-.104-.305-.152-.448-.153-.327 0-.121-.05.022-.153.327-.568 1.666-2.782 8.166-7.847 2.97-2.667-2.737-1.432-5.473 3.422-6.3-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026`})]}),Te=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...F(e),children:[y(`title`,{children:`TypeScript`}),y(`path`,{fill:`#2563EB`,d:`M3.234 9.093V7.318h8.363v1.775H8.479V17.5H6.352V9.093H3.234zm15.263 1.153c-.04-.4-.21-.712-.512-.934-.301-.222-.71-.333-1.228-.333-.351 0-.648.05-.89.149-.242.096-.427.23-.557.403a.969.969 0 0 0-.189.586.838.838 0 0 0 .115.477c.086.136.204.254.353.353.149.097.321.181.517.254.195.07.404.13.626.179l.915.219c.444.1.852.232 1.223.397.371.166.693.37.965.612.271.242.482.527.631.855.152.328.23.704.234 1.129-.004.623-.163 1.163-.478 1.62-.311.454-.762.807-1.352 1.06-.587.248-1.294.372-2.123.372-.822 0-1.538-.126-2.147-.378-.607-.252-1.081-.624-1.422-1.118-.338-.497-.516-1.112-.532-1.845h2.083c.023.342.12.627.293.855.176.226.41.397.701.513a2.8 2.8 0 0 0 1 .168c.364 0 .68-.053.949-.159a1.45 1.45 0 0 0 .631-.442c.15-.189.224-.406.224-.651a.846.846 0 0 0-.204-.577c-.132-.156-.328-.288-.586-.398a5.964 5.964 0 0 0-.94-.298l-1.109-.278c-.858-.21-1.536-.536-2.033-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.491-1.615.335-.461.794-.82 1.377-1.08.584-.258 1.247-.387 1.99-.387.755 0 1.414.13 1.978.388.567.258 1.007.618 1.322 1.079.315.46.477.994.488 1.6h-2.064z`})]}),Ee=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...F(e),children:[y(`title`,{children:`JavaScript`}),y(`path`,{fill:`#F59E0B`,d:`M8.383 7.318h2.127v7.1c0 .656-.147 1.226-.442 1.71a2.924 2.924 0 01-1.218 1.118c-.52.262-1.125.393-1.815.393-.613 0-1.17-.107-1.67-.323a2.67 2.67 0 01-1.183-.994c-.292-.448-.436-1.01-.433-1.686h2.143c.006.269.061.5.164.691.106.19.25.335.432.438.186.1.405.15.657.15.265 0 .488-.057.67-.17.186-.116.327-.285.423-.507.096-.222.145-.496.145-.82v-7.1zm9.43 2.928c-.04-.4-.21-.712-.511-.934-.302-.222-.711-.333-1.228-.333-.352 0-.648.05-.89.149-.242.096-.428.23-.557.403a.969.969 0 00-.19.586.838.838 0 00.115.477c.087.136.204.254.353.353.15.097.322.181.517.254.196.07.405.13.627.179l.915.219c.444.1.851.232 1.223.397.37.166.692.37.964.612s.482.527.631.855a2.7 2.7 0 01.234 1.129c-.003.623-.162 1.163-.477 1.62-.312.454-.763.807-1.353 1.06-.586.248-1.294.372-2.122.372-.822 0-1.538-.126-2.148-.378-.607-.252-1.08-.624-1.422-1.118-.338-.497-.515-1.112-.532-1.845h2.083c.023.342.121.627.293.855.176.226.41.397.702.513.295.112.628.168.999.168.364 0 .68-.053.95-.159.271-.106.482-.253.63-.442.15-.189.224-.406.224-.651a.846.846 0 00-.203-.577c-.133-.156-.329-.288-.587-.398a5.964 5.964 0 00-.94-.298l-1.108-.278c-.859-.21-1.537-.536-2.034-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.492-1.615.334-.461.793-.82 1.377-1.08.583-.258 1.246-.387 1.989-.387.755 0 1.415.13 1.978.388.567.258 1.008.618 1.323 1.079.314.46.477.994.487 1.6h-2.063z`})]}),De=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...F(e),children:[y(`title`,{children:`JSON`}),y(`path`,{fill:`#F59E0B`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),Oe=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...F(e),children:[y(`title`,{children:`CSS`}),y(`path`,{fill:`#0EA5E9`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),ke=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...F(e),children:[y(`title`,{children:`HTML`}),y(`path`,{fill:`#EA580C`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),Ae=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...F(e),children:[y(`title`,{children:`React`}),y(`path`,{fill:`#0E8ADC`,d:`M12 13.677a1.677 1.677 0 100-3.354 1.677 1.677 0 000 3.354z`}),y(`path`,{stroke:`#0E8ADC`,d:`M12 15.436c4.97 0 9-1.538 9-3.436s-4.03-3.436-9-3.436S3 10.102 3 12s4.03 3.436 9 3.436z`}),y(`path`,{stroke:`#0E8ADC`,d:`M9.024 13.718c2.485 4.305 5.832 7.025 7.476 6.076 1.644-.949.961-5.208-1.524-9.512C12.491 5.977 9.144 3.257 7.5 4.206c-1.644.949-.961 5.208 1.524 9.512z`}),y(`path`,{stroke:`#0E8ADC`,d:`M9.024 10.282c-2.485 4.304-3.168 8.563-1.524 9.512 1.644.95 4.99-1.771 7.476-6.076 2.485-4.304 3.168-8.563 1.524-9.512-1.644-.95-4.99 1.771-7.476 6.076z`})]}),je=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...F(e),children:[y(`title`,{children:`Markdown`}),y(`path`,{fill:`#60A5FA`,d:`M3 15.714V8h2.323l2.322 2.836L9.968 8h2.322v7.714H9.968V11.29l-2.323 2.836-2.322-2.836v4.424H3zm14.516 0l-3.484-3.743h2.323V8h2.322v3.97H21l-3.484 3.744z`})]}),Me=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...F(e),children:[y(`title`,{children:`Shell`}),y(`path`,{stroke:`#14B8A6`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M4.336 17l6-6-6-6M12.336 19h8`})]}),Ne=e=>b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...F(e),children:[y(`title`,{children:`YAML`}),y(`path`,{fill:`#A78BFA`,d:`M6.533 5.864h2.755l2.654 5.011h.113l2.654-5.011h2.756l-4.245 7.522V17.5h-2.443v-4.114L6.533 5.864z`})]}),L=({className:e,children:t,...n})=>y(g.Tooltip,{...n,offset:8,className:t=>j(`group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none`,`data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100`,`data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75`,`data-[placement=top]:slide-in-from-bottom-1`,`data-[placement=bottom]:slide-in-from-top-1`,`data-[placement=left]:slide-in-from-right-1`,`data-[placement=right]:slide-in-from-left-1`,typeof e==`function`?e(t):e),children:e=>b(v,{children:[y(g.OverlayArrow,{children:b(`svg`,{width:8,height:8,viewBox:`0 0 8 8`,className:`fill-bg-surface/90 stroke-border-subtle group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90`,children:[y(`title`,{children:`Arrow`}),y(`path`,{d:`M0 0 L4 4 L8 0`})]})}),typeof t==`function`?t(e):t]})}),R=({content:e,children:t,delay:n=500,closeDelay:r=0,...i})=>b(g.TooltipTrigger,{delay:n,closeDelay:r,children:[t,y(L,{...i,children:e})]});R.Root=R,R.Content=L;const z=({children:e,className:t,...n})=>y(`header`,{className:j(`boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md`,t),...n,children:e}),Pe=({children:e,className:t})=>y(`div`,{className:j(`mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6`,t),children:e}),Fe=({children:e,className:t})=>y(`div`,{className:j(`flex flex-1 items-center justify-start gap-4 min-w-0`,t),children:e}),Ie=({children:e,className:t})=>y(`div`,{className:j(`flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0`,t),children:e}),Le=({children:e,className:t})=>y(`div`,{className:j(`hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full`,t),children:e}),Re=({src:e,alt:t,width:n=24,height:r=24,className:i})=>y(M,{href:`/`,className:j(`flex items-center gap-2 shrink-0 outline-none`,i),children:e?y(`img`,{src:e,alt:t,width:n,height:r,className:`h-6 w-6 object-contain`}):null}),ze=({children:e,className:t})=>y(M,{href:`/`,children:y(`span`,{className:j(`text-lg font-bold tracking-tight hidden sm:inline-block`,t),children:e})}),Be=({children:e,className:t})=>y(`nav`,{className:j(`hidden md:flex items-center gap-6 text-sm font-medium`,t),children:e}),Ve=({label:e,href:t,active:n,to:r,className:i})=>b(M,{href:t,target:r===`external`?`_blank`:void 0,className:j(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,{"text-primary-500":n,"text-text-muted hover:text-text-main":!n},i),children:[e,r===`external`&&y(`span`,{className:`ml-1 inline-block`,children:y(ne,{size:12})})]}),He=({className:e,onPress:t})=>{let[n,r]=l(!1),i=n&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return a(()=>{r(!0)},[]),b(le,{onPress:t,className:j(`flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer`,`transition-all duration-200 hover:border-border-strong hover:text-text-main hover:bg-bg-muted hover:shadow-sm active:scale-[0.98]`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,`w-full max-w-[720px] justify-between`,e),children:[b(`div`,{className:`flex items-center gap-2`,children:[y(h,{size:16}),y(`span`,{className:`hidden sm:inline-block`,children:`Search docs...`})]}),b(`div`,{className:`hidden sm:flex items-center gap-1 pointer-events-none select-none`,children:[y(`kbd`,{className:`flex h-5 items-center justify-center rounded border border-border-subtle bg-bg-main px-1.5 font-mono text-[10px] font-medium`,children:i?`⌘`:`Ctrl`}),y(`kbd`,{className:`flex h-5 w-5 items-center justify-center rounded border border-border-subtle bg-bg-main font-mono text-[10px] font-medium`,children:`K`})]})]})},Ue=({className:e,theme:t,onThemeChange:n})=>y(de,{isSelected:t===`dark`,onChange:n,className:j(`rounded-md p-2 text-text-muted outline-none cursor-pointer`,`transition-all duration-300 hover:bg-bg-surface hover:text-text-main hover:rotate-12 active:scale-90`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,e),"aria-label":`Toggle theme`,children:y(t===`dark`?oe:ae,{size:20})}),We=({name:e})=>{if(e===`github`)return y(I,{});if(e===`discord`)return y(Se,{});if(e===`x`)return y(Ce,{});if(e===`bluesky`)return y(we,{})};z.Root=z,z.Left=Fe,z.Right=Ie,z.Center=Le,z.Logo=Re,z.Title=ze,z.Links=Be,z.Link=Ve,z.SearchTrigger=He,z.Theme=Ue,z.Socials=({icon:e,link:t,className:n})=>y(M,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:j(`rounded-md p-2 text-text-muted outline-none transition-colors`,`hover:bg-bg-surface hover:text-text-main`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,n),children:y(We,{name:e})}),z.Split=({className:e})=>y(ue,{orientation:`vertical`,className:j(`h-6 w-px bg-border-subtle mx-1`,e)}),z.Content=Pe;const B=({children:e,className:t,...n})=>y(`nav`,{className:j(`relative flex items-center`,t),...n,children:e});B.Root=B,B.List=({children:e,className:t})=>y(`div`,{className:j(`flex list-none items-center gap-1`,t),children:e}),B.Item=({children:e,label:t,className:n})=>b(g.MenuTrigger,{children:[b(g.Button,{className:j(`flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium outline-none transition-colors cursor-pointer`,`text-text-muted hover:bg-bg-surface hover:text-text-main`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,n),children:[t,y(f,{size:14,className:`transition-transform`})]}),y(g.Popover,{placement:`bottom start`,className:`entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards`,children:y(g.Menu,{className:`w-56 outline-none rounded-xl border border-border-subtle bg-bg-surface p-2 shadow-xl ring-1 ring-border-strong/5`,children:e})})]}),B.Link=({label:e,href:t,description:n,className:r,children:i,...a})=>y(g.MenuItem,{href:t,className:j(`block rounded-lg px-3 py-2 text-sm outline-none cursor-pointer transition-colors`,`hover:bg-bg-muted focus:bg-bg-muted`,r),...a,children:i||b(v,{children:[y(`div`,{className:`font-semibold text-text-main`,children:e}),n&&y(`div`,{className:`text-xs text-text-muted line-clamp-1 mt-0.5`,children:n})]})});const V=({children:e,isOpen:t,onOpenChange:n,className:r})=>y(g.ModalOverlay,{isOpen:t,onOpenChange:n,isDismissable:!0,className:j(`fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20`,`entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out`),children:y(g.Modal,{className:j(`mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none`,`entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95`,r),children:y(g.Dialog,{className:`flex flex-col max-h-[70vh] focus:outline-none`,children:e})})});V.Root=V,V.Autocomplete=({children:e,className:t,onSelectionChange:n,...r})=>{let i=g.Autocomplete;return y(`div`,{className:t,children:y(i,{...r,onSelectionChange:n,className:`flex flex-col min-h-0`,children:e})})},V.Input=({className:e,...t})=>b(g.SearchField,{className:`flex items-center gap-3 border-b border-border-subtle px-4 py-4`,autoFocus:!0,children:[y(h,{className:`h-5 w-5 text-text-muted`}),y(g.Input,{...t,className:j(`w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none`,e),placeholder:`Search documentation...`}),y(`div`,{className:`flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted`,children:y(`kbd`,{className:`font-sans`,children:`ESC`})})]}),V.List=({children:e,className:t,...n})=>y(g.ListBox,{...n,className:j(`flex-1 overflow-y-auto p-2 outline-none`,t),children:e}),V.Item=Object.assign(({children:e,className:t,...n})=>y(g.ListBoxItem,{...n,className:j(`group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors`,`text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white`,t),children:t=>b(v,{children:[e,(t.isFocused||t.isSelected)&&b(`div`,{className:`ml-auto opacity-50 flex items-center gap-1`,children:[y(`span`,{className:`text-[10px]`,children:`Select`}),y(ee,{size:10})]})]})}),{Icon:({isHeading:e,className:t})=>y(`div`,{className:j(`shrink-0`,t),children:y(e?ie:re,{size:18})}),Title:({children:e,className:t})=>y(`span`,{className:j(`block font-medium truncate flex-1 text-sm`,t),children:e}),Bio:({children:e,className:t})=>y(`span`,{className:j(`ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100`,t),children:e})});function Ge(e,t){let n=c(e);a(()=>{n.current!==e&&(t(e),n.current=e)},[e,t])}function H(e){return e.startsWith(`#`)?e.slice(1):null}var Ke=class{items=[];single=!1;observer=null;onChange;callback(e){if(e.length===0)return;for(let t of e){let e=this.items.find(e=>e.id===t.target.id);e&&(e.active=t.isIntersecting,e.fallback=!t.isIntersecting&&t.boundingClientRect.top<100)}let t=-1;for(let e=this.items.length-1;e>=0;e--)if(this.items[e].fallback){t=e;break}t===-1&&this.items.length>0&&(t=0),this.items=this.items.map((e,n)=>({...e,active:n===t,t:n===t?Date.now():e.t})),this.onChange?.()}setItems(e){let t=this.observer;if(t)for(let e of this.items){let n=document.getElementById(e.id);n&&t.unobserve(n)}this.items=[];for(let t of e){let e=H(t.url);e&&this.items.push({id:e,active:!1,fallback:!1,t:0,original:t})}this.watchItems(),typeof window<`u`&&(setTimeout(()=>this.watchItems(),100),setTimeout(()=>this.watchItems(),500),setTimeout(()=>this.watchItems(),1e3)),this.onChange?.()}watch(e){this.observer||(this.observer=new IntersectionObserver(this.callback.bind(this),e),this.watchItems())}watchItems(){if(this.observer)for(let e of this.items){let t=document.getElementById(e.id);t&&this.observer.observe(t)}}unwatch(){this.observer?.disconnect(),this.observer=null}};const U=t(null),W=t(null);function G(){let e=n(U);if(!e)throw Error(`Component must be used under the <AnchorProvider /> component.`);return e}function qe(){let e=G();return s(()=>{let t;for(let n of e)n.active&&(!t||n.t>t.t)&&(t=n);return t?.id},[e])}function Je(){let e=G();return s(()=>{let t=[];for(let n of e)n.active&&t.push(n.id);return t},[e])}function Ye({containerRef:e,children:t}){return y(W.Provider,{value:e,children:t})}function Xe({toc:e,single:t=!1,children:n}){let r=s(()=>new Ke,[]),[i,o]=l(r.items);return r.single=t,a(()=>{r.setItems(e)},[r,e]),a(()=>(r.watch({rootMargin:`-100px 0% 0% 0%`,threshold:0}),r.onChange=()=>o([...r.items]),()=>{r.unwatch()}),[r]),y(U.Provider,{value:i,children:n})}const K=({children:e,className:t})=>y(`nav`,{className:j(`sticky top-navbar hidden xl:flex flex-col shrink-0`,`w-toc`,`py-8 pl-6 pr-4`,t),children:e}),Ze=({children:e,className:t,...n})=>y(`div`,{className:j(`mb-4 text-xs font-bold uppercase tracking-wider text-text-main`,t),...n,children:e}),q=({children:e,className:t,ref:n,...r})=>{let i=c(null);return o(n,()=>i.current),y(`div`,{ref:i,className:j(`relative overflow-y-auto boltdocs-otp-content`,t),...r,children:e})};q.displayName=`OnThisPageContent`,K.Root=K,K.Header=Ze,K.Content=q,K.List=({children:e,className:t})=>y(`ul`,{className:j(`relative space-y-1 text-sm border-l border-border-subtle`,t),children:e}),K.Item=({level:e,children:t,className:n})=>y(`li`,{className:j(e===3&&`pl-3`,n),children:t}),K.Link=({children:e,href:t,active:r,onClick:i,className:o})=>{let s=n(U),u=n(W),d=t?H(t):null,f=c(null),[p,m]=l(r);return Ge(d&&s?s.find(e=>e.id===d)?.active:null,e=>{e!==null&&e!==p&&(m(!!e),e&&f.current&&u?.current&&he(f.current,{behavior:`smooth`,block:`center`,inline:`center`,scrollMode:`if-needed`,boundary:u.current}))}),a(()=>{r!==void 0&&m(r)},[r]),y(`a`,{ref:f,href:t,onClick:i,"data-active":p,className:j(`block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main`,p?`text-primary-500 font-medium`:`text-text-muted`,o),children:e})},K.Indicator=({style:e,className:t})=>y(`div`,{className:j(`absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300`,t),style:e});const J=({children:e,className:t})=>y(`nav`,{className:j(`grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle`,t),children:e});J.Root=J,J.Link=({children:e,to:t,direction:n,className:r})=>{let i=n===`next`;return b(g.Link,{href:t,className:j(`flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none`,`transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,i?`text-right justify-end`:`text-left justify-start`,r),children:[!i&&y(p,{className:`mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1`}),y(`div`,{className:`flex flex-col gap-1 flex-1`,children:e}),i&&y(m,{className:`ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1`})]})},J.Title=({children:e,className:t})=>y(`span`,{className:j(`text-xs font-medium uppercase tracking-wider text-text-muted`,t),children:e}),J.Description=({children:e,className:t})=>y(`span`,{className:j(`text-base font-bold text-text-main truncate`,t),children:e}),J.Icon=({children:e})=>y(v,{children:e});const Y=({children:e,className:t=``,...n})=>y(`div`,{className:j(`w-full`,t),...n,children:e});Y.Root=Y,Y.List=({children:e,className:t=``})=>y(`div`,{role:`tablist`,className:j(`relative flex flex-row items-center border-b border-border-subtle`,t),children:e}),Y.Item=({children:e,id:t,selected:n,className:r=``,...i})=>y(`button`,{role:`tab`,"aria-selected":n,className:j(`flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors outline-none cursor-pointer bg-transparent border-none`,n?`text-primary-500`:`text-text-muted hover:text-text-main`,r),...i,children:e}),Y.Content=({children:e,className:t=``})=>y(`div`,{className:j(`p-4 outline-none`,t),children:e}),Y.Indicator=({className:e=``,style:t})=>y(`div`,{className:j(`absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300`,e),style:t});const Qe=({badge:e})=>{let t={new:`bg-primary-500/20 text-primary-500`,updated:`bg-gray-500/20 text-gray-500`,deprecated:`bg-red-500/20 text-red-500`};if(typeof e==`object`&&e?.expires){let t=new Date(e.expires),n=new Date,r=t.getTime()-n.getTime();if(Math.ceil(r/(1e3*60*60*24))===0)return null}let n=typeof e==`string`?e:e?.text;return y(`span`,{className:j(`ml-auto flex h-4.5 items-center rounded-full text-[9px] font-medium px-1.5 py-0.5 text-center whitespace-nowrap`,t[n]||t.new),children:n})},X=({children:e,className:t})=>y(`aside`,{className:j(`boltdocs-sidebar sticky top-navbar hidden lg:flex flex-col shrink-0`,`w-sidebar h-full`,`overflow-y-auto border-r border-border-subtle bg-bg-main`,`py-6 px-4`,t),children:y(`nav`,{className:`flex-1 space-y-6`,children:e})});X.Root=X,X.Group=({children:e,title:t,icon:n,isOpen:r=!0,onToggle:i,className:a})=>b(`div`,{className:j(`space-y-1`,a),children:[t&&b(g.Button,{onPress:i,className:j(`flex w-full items-center justify-between px-2 py-1.5 text-xs font-bold uppercase tracking-wider outline-none cursor-pointer`,`text-text-muted hover:text-text-main transition-colors`,`focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md`),children:[b(`div`,{className:`flex items-center gap-2`,children:[n&&y(n,{size:14}),t]}),y(m,{size:14,className:j(`transition-transform duration-200`,r&&`rotate-90`)})]}),r&&y(`div`,{className:`space-y-0.5`,children:e})]}),X.GroupItem=({children:e,className:t})=>y(`div`,{className:j(t),children:e}),X.Link=({label:e,href:t,active:n,icon:r,badge:i,className:a})=>b(M,{href:t,className:j(`group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none`,`transition-all duration-200 ease-in-out`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,n?`bg-primary-500/10 text-primary-500 font-medium`:`text-text-muted hover:bg-bg-surface hover:text-text-main hover:translate-x-1`,a),children:[r&&y(r,{size:16,className:j(n?`text-primary-500`:`text-text-muted group-hover:text-text-main`)}),y(`span`,{className:`truncate`,children:e}),i&&y(Qe,{badge:i})]});const Z=({children:e,className:t,...n})=>y(ce,{className:j(`flex items-center gap-1.5 pl-0! mb-0 text-sm text-text-muted`,t),...n,children:e});Z.Root=Z,Z.Item=({children:e,className:t,...n})=>y(se,{className:j(`flex items-center mb-0 gap-1.5`,t),...n,children:e}),Z.Link=({children:e,href:t,className:n,...r})=>y(_,{href:t,className:j(`transition-colors outline-none hover:text-text-main focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,`current:font-medium current:text-text-main current:pointer-events-none cursor-pointer`,n),...r,children:e}),Z.Separator=({className:e})=>y(m,{size:14,className:j(`shrink-0 text-text-dim`,e)});const $e=({children:e,className:t,vertical:n=!1})=>y(`div`,{className:j(`inline-flex`,n?`flex-col`:`flex-row`,!n&&[`[&>*:not(:first-child)]:-ml-px`,`[&>*:first-child]:rounded-r-none`,`[&>*:last-child]:rounded-l-none`,`[&>*:not(:first-child):not(:last-child)]:rounded-none`,t?.includes(`rounded-full`)&&[`[&>*:first-child]:rounded-l-full`,`[&>*:last-child]:rounded-r-full`],t?.includes(`rounded-xl`)&&[`[&>*:first-child]:rounded-l-xl`,`[&>*:last-child]:rounded-r-xl`],t?.includes(`rounded-lg`)&&[`[&>*:first-child]:rounded-l-lg`,`[&>*:last-child]:rounded-r-lg`]],n&&[`[&>*:not(:first-child)]:-mt-px`,`[&>*:first-child]:rounded-b-none`,`[&>*:last-child]:rounded-t-none`,`[&>*:not(:first-child):not(:last-child)]:rounded-none`,t?.includes(`rounded-full`)&&[`[&>*:first-child]:rounded-t-full`,`[&>*:last-child]:rounded-b-full`]],t),children:e}),Q=({children:e,className:t,showArrow:n,...r})=>b(g.Popover,{offset:8,...r,className:g.composeRenderProps(t,e=>j(`z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none transition-none`,e)),children:[n&&y(g.OverlayArrow,{className:`group`,children:y(`svg`,{viewBox:`0 0 12 12`,className:`block h-3 w-3 fill-bg-surface/80 stroke-border-subtle group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90`,"aria-hidden":`true`,children:y(`path`,{d:`M0 0 L6 6 L12 0`})})}),e]});function et(t){let[n,r]=e.Children.toArray(t.children).slice(0,2);return b(g.MenuTrigger,{...t,children:[n,y(Q,{placement:t.placement,className:`min-w-35`,children:r})]})}function tt(t){let[n,r]=e.Children.toArray(t.children).slice(0,2);return b(g.SubmenuTrigger,{...t,children:[n,y(Q,{offset:-4,crossOffset:-4,children:r})]})}function $(e){return y(g.Menu,{...e,className:g.composeRenderProps(e.className,e=>j(`p-1.5 outline-none max-h-[inherit] overflow-auto max-w-75`,e))})}function nt(e){let t=e.textValue||(typeof e.children==`string`?e.children:void 0);return y(g.MenuItem,{...e,textValue:t,className:g.composeRenderProps(e.className,(e,{isFocused:t,isPressed:n,isDisabled:r})=>j(`group relative flex flex-row items-center gap-2 px-2 py-1 rounded-lg outline-none cursor-default hover:cursor-pointer transition-none`,`text-text-main text-[12px]`,{"bg-bg-surface-elevated text-primary-600 ring-1 ring-border-strong/5":t,"bg-bg-surface-elevanted":n,"opacity-40 grayscale pointer-events-none":r},e)),children:g.composeRenderProps(e.children,(e,{selectionMode:t,isSelected:n,hasSubmenu:r})=>b(v,{children:[t!==`none`&&b(`span`,{className:`flex items-center size-4 shrink-0 justify-center`,children:[n&&t===`multiple`&&y(d,{className:`size-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200`}),n&&t===`single`&&y(te,{className:`size-5 text-primary-500 animate-in zoom-in-50 duration-200`})]}),y(`div`,{className:`flex flex-row w-full transition-colors items-center gap-2 py-1 px-1`,children:e}),r&&y(m,{className:`size-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors`})]}))})}function rt({title:e,...t}){return b(g.MenuSection,{...t,className:j(`flex flex-col gap-0.5`,t.className),children:[e&&y(g.Header,{className:`px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none`,children:e}),y(g.Collection,{items:t.items,children:t.children})]})}function it(e){return y(g.Separator,{...e,className:`mx-2 my-1.5 border-t border-border-subtle/50`})}$.Root=$,$.Item=nt,$.Trigger=et,$.SubTrigger=tt,$.Section=rt,$.Separator=it;function at({className:e,variant:t=`rect`,...n}){return y(`div`,{className:j(`animate-pulse bg-bg-muted`,t===`circle`?`rounded-full`:`rounded-md`,e),...n})}function ot(e){let{currentLocale:t,currentVersion:n}=k(),[r,i]=l(!1),[o,c]=l(``),[u,d]=l(null);return a(()=>{if(!r||u)return;let e=new ge({preset:`match`,tokenize:`full`,resolution:9,cache:!0});for(let t of x)e.add(t.id,`${t.title} ${t.content}`);d(e)},[r,u]),{isOpen:r,setIsOpen:i,query:o,setQuery:c,list:s(()=>{if(!o)return e.filter(e=>{let r=!t||e.locale===t,i=!n||e.version===n;return r&&i}).slice(0,10).map(e=>({id:e.path,title:e.title,path:e.path,bio:e.description||``,groupTitle:e.groupTitle}));if(!u)return[];let r=u.search(o,{limit:20,suggest:!0}),i=[],a=new Set;for(let e of r){let r=x.find(t=>t.id===e);if(!r)continue;let o=!t||r.locale===t,s=!n||r.version===n;!o||!s||a.has(r.url)||(a.add(r.url),i.push({id:r.url,title:r.title,path:r.url,bio:r.display,groupTitle:r.display.split(` > `)[0],isHeading:r.url.includes(`#`)}))}return i.slice(0,10)},[o,u,t,n,e]),input:{value:o,onChange:e=>c(e.target.value)}}}export{xe as A,S as B,Ee as C,Me as D,Ae as E,A as F,k as I,ye as L,M,N,Te as O,j as P,O as R,I as S,je as T,C as V,B as _,$e as a,ke as b,Y as c,K as d,Ye as f,V as g,G as h,Q as i,P as j,Ne as k,J as l,Je as m,at as n,Z as o,qe as p,$ as r,X as s,ot as t,Xe as u,z as v,De as w,Oe as x,R as y,_e as z};