boltdocs 2.5.5 → 2.5.6

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 (96) hide show
  1. package/bin/boltdocs.js +1 -1
  2. package/dist/cache-Cr8W2zgZ.cjs +6 -0
  3. package/dist/cache-DFdakSmR.mjs +6 -0
  4. package/dist/client/index.d.mts +1276 -861
  5. package/dist/client/index.d.ts +1276 -861
  6. package/dist/client/index.js +6 -1
  7. package/dist/client/index.mjs +6 -1
  8. package/dist/client/ssr.cjs +6 -0
  9. package/dist/client/ssr.d.cts +80 -0
  10. package/dist/client/ssr.d.mts +63 -61
  11. package/dist/client/ssr.mjs +6 -1
  12. package/dist/client/theme/neutral.css +388 -0
  13. package/dist/node/cli-entry.cjs +8 -0
  14. package/dist/node/cli-entry.d.cts +2 -0
  15. package/dist/node/cli-entry.d.mts +2 -1
  16. package/dist/node/cli-entry.mjs +7 -5
  17. package/dist/node/index.cjs +6 -0
  18. package/dist/node/index.d.cts +574 -0
  19. package/dist/node/index.d.mts +385 -378
  20. package/dist/node/index.mjs +6 -1
  21. package/dist/node-CWXme96p.mjs +73 -0
  22. package/dist/node-VYfhzGrh.cjs +73 -0
  23. package/dist/package-BY8Jd2j4.cjs +6 -0
  24. package/dist/package-OFZf0s2j.mjs +6 -0
  25. package/dist/search-dialog-BeNyI_KQ.mjs +6 -0
  26. package/dist/search-dialog-dYsCAk5S.js +6 -0
  27. package/dist/use-search-D25n0PrV.mjs +6 -0
  28. package/dist/use-search-WuzdH1cJ.js +6 -0
  29. package/package.json +16 -12
  30. package/src/client/app/index.tsx +15 -12
  31. package/src/client/components/default-layout.tsx +21 -19
  32. package/src/client/hooks/use-i18n.ts +1 -1
  33. package/src/client/hooks/use-routes.ts +1 -1
  34. package/src/client/hooks/use-version.ts +1 -1
  35. package/src/client/store/boltdocs-context.tsx +119 -0
  36. package/CHANGELOG.md +0 -98
  37. package/dist/cache-3FOEPC2P.mjs +0 -1
  38. package/dist/chunk-5B5NKOW6.mjs +0 -77
  39. package/dist/chunk-J2PTDWZM.mjs +0 -1
  40. package/dist/chunk-TP5KMRD3.mjs +0 -1
  41. package/dist/chunk-Y4RE5KI7.mjs +0 -1
  42. package/dist/client/ssr.d.ts +0 -78
  43. package/dist/client/ssr.js +0 -1
  44. package/dist/node/cli-entry.d.ts +0 -1
  45. package/dist/node/cli-entry.js +0 -82
  46. package/dist/node/index.d.ts +0 -567
  47. package/dist/node/index.js +0 -77
  48. package/dist/package-QFIAETHR.mjs +0 -1
  49. package/dist/search-dialog-O6VLVSOA.mjs +0 -1
  50. package/src/client/store/use-boltdocs-store.ts +0 -44
  51. package/src/node/cache.ts +0 -408
  52. package/src/node/cli/build.ts +0 -53
  53. package/src/node/cli/dev.ts +0 -22
  54. package/src/node/cli/doctor.ts +0 -243
  55. package/src/node/cli/index.ts +0 -9
  56. package/src/node/cli/ui.ts +0 -54
  57. package/src/node/cli-entry.ts +0 -24
  58. package/src/node/config.ts +0 -382
  59. package/src/node/errors.ts +0 -44
  60. package/src/node/index.ts +0 -84
  61. package/src/node/mdx/cache.ts +0 -12
  62. package/src/node/mdx/highlighter.ts +0 -47
  63. package/src/node/mdx/index.ts +0 -122
  64. package/src/node/mdx/rehype-shiki.ts +0 -62
  65. package/src/node/mdx/remark-code-meta.ts +0 -35
  66. package/src/node/mdx/remark-shiki.ts +0 -61
  67. package/src/node/plugin/entry.ts +0 -87
  68. package/src/node/plugin/html.ts +0 -99
  69. package/src/node/plugin/index.ts +0 -478
  70. package/src/node/plugin/types.ts +0 -9
  71. package/src/node/plugins/index.ts +0 -17
  72. package/src/node/plugins/plugin-errors.ts +0 -62
  73. package/src/node/plugins/plugin-lifecycle.ts +0 -117
  74. package/src/node/plugins/plugin-sandbox.ts +0 -59
  75. package/src/node/plugins/plugin-store.ts +0 -54
  76. package/src/node/plugins/plugin-types.ts +0 -107
  77. package/src/node/plugins/plugin-validator.ts +0 -105
  78. package/src/node/routes/cache.ts +0 -28
  79. package/src/node/routes/index.ts +0 -293
  80. package/src/node/routes/parser.ts +0 -262
  81. package/src/node/routes/sorter.ts +0 -42
  82. package/src/node/routes/types.ts +0 -61
  83. package/src/node/schema/config.ts +0 -195
  84. package/src/node/schema/frontmatter.ts +0 -17
  85. package/src/node/search/index.ts +0 -55
  86. package/src/node/security/constants/index.ts +0 -10
  87. package/src/node/security/csp.ts +0 -31
  88. package/src/node/security/headers.ts +0 -27
  89. package/src/node/ssg/index.ts +0 -205
  90. package/src/node/ssg/meta.ts +0 -33
  91. package/src/node/ssg/options.ts +0 -15
  92. package/src/node/ssg/robots.ts +0 -53
  93. package/src/node/ssg/sitemap.ts +0 -55
  94. package/src/node/utils.ts +0 -349
  95. package/tsconfig.json +0 -26
  96. package/tsup.config.ts +0 -56
@@ -1 +1,6 @@
1
- import{a,b,d as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r}from"../chunk-5B5NKOW6.mjs";import"../chunk-TP5KMRD3.mjs";import"../chunk-Y4RE5KI7.mjs";r();export{i as BoltdocsPluginStore,f as PluginCompatibilityError,d as PluginError,h as PluginHookError,n as PluginLifecycleManager,g as PluginPermissionError,m as PluginSandbox,e as PluginValidationError,j as SecurePluginSchema,o as createPlugin,q as createViteConfig,p as default,a as defineConfig,c as generateStaticPages,l as hasPermission,b as resolveConfig,k as validatePlugins};
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m,v as h,x as g,y as _}from"../node-CWXme96p.mjs";d();export{m as BoltdocsPluginStore,n as PluginCompatibilityError,r as PluginError,u as PluginHookError,e as PluginLifecycleManager,s as PluginPermissionError,l as PluginSandbox,i as PluginValidationError,f as SecurePluginSchema,a as createPlugin,c as createViteConfig,p as default,_ as defineConfig,h as generateStaticPages,t as hasPermission,g as resolveConfig,o as validatePlugins};
@@ -0,0 +1,73 @@
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};
@@ -0,0 +1,73 @@
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}});
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ var e=`2.5.6`;Object.defineProperty(exports,`version`,{enumerable:!0,get:function(){return e}});
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ var e=`2.5.6`;export{e as version};
@@ -0,0 +1,6 @@
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};
@@ -0,0 +1,6 @@
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;
@@ -0,0 +1,6 @@
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};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`react`);l=c(l);let u=require(`react-router-dom`),d=require(`lucide-react`),f=require(`react-aria-components`);f=c(f);let p=require(`react/jsx-runtime`),m=require(`clsx`),ee=require(`tailwind-merge`),h=require(`flexsearch`),g=require(`virtual:boltdocs-search`);g=c(g);const _=(0,l.createContext)(null);function v(){let e=(0,l.use)(_);if(!e)throw Error(`useConfig must be used within a ConfigProvider`);return e}const y=(0,l.createContext)({preload:()=>{},routes:[]});function b(){return(0,l.use)(y)}function x({routes:e,modules:t,children:n}){let r=(0,l.useRef)(null),i=(0,l.useCallback)(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(0,p.jsx)(y.Provider,{value:{preload:i,routes:e},children:n})}const S=(0,l.createContext)(void 0),C=`boltdocs-storage`;function te(){try{let e=localStorage.getItem(C);if(e){let t=JSON.parse(e);return t?.state||t}}catch{}return{}}function w({children:e}){let t=te(),[n,r]=(0,l.useState)(t.currentLocale),[i,a]=(0,l.useState)(t.currentVersion),[o,s]=(0,l.useState)(!1);(0,l.useEffect)(()=>{s(!0)},[]),(0,l.useEffect)(()=>{if(o){let e={currentLocale:n,currentVersion:i};try{localStorage.setItem(C,JSON.stringify({state:e}))}catch{}}},[n,i,o]);let c={currentLocale:n,currentVersion:i,hasHydrated:o,setLocale:(0,l.useCallback)(e=>{r(e)},[]),setVersion:(0,l.useCallback)(e=>{a(e)},[]),setHasHydrated:(0,l.useCallback)(e=>{s(e)},[])};return(0,p.jsx)(S.Provider,{value:c,children:e})}function T(){let e=(0,l.useContext)(S);if(!e)throw Error(`useBoltdocsContext must be used within a BoltdocsProvider`);return e}function E(e){return e(T())}function D(){let{routes:e}=b(),t=v(),n=(0,u.useLocation)(),r=E(e=>e.currentLocale),i=E(e=>e.currentVersion),a=E(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 O(e){let t=v(),{currentLocale:n,currentVersion:r}=D();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 k(...e){return(0,ee.twMerge)((0,m.clsx)(e))}const A=l.default.forwardRef((e,t)=>{let{href:n,prefetch:r=`hover`,onMouseEnter:i,onFocus:a,...o}=e,s=O(n??``),{preload:c}=b(),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(0,p.jsx)(f.Link,{...o,ref:t,href:s,onMouseEnter:l,onFocus:u})});A.displayName=`Link`;const j=l.default.forwardRef((e,t)=>{let{href:n,end:r=!1,className:i,children:a,...o}=e,s=(0,u.useLocation)(),c=O(n??``),l=r?s.pathname===c:s.pathname.startsWith(c),d=typeof i==`function`?i({isActive:l}):k(i,l&&`active`),f=typeof a==`function`?a({isActive:l}):a;return(0,p.jsx)(A,{...o,ref:t,href:n,className:d,children:f})});j.displayName=`NavLink`;function M(e){let{size:t=20,...n}=e;return{...n,width:t,height:t}}const N=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...M(e),children:[(0,p.jsx)(`title`,{children:`GitHub`}),(0,p.jsx)(`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`})]}),P=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...M(e),children:[(0,p.jsx)(`title`,{children:`Discord`}),(0,p.jsx)(`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`})]}),F=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...M(e),children:[(0,p.jsx)(`title`,{children:`X`}),(0,p.jsx)(`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`})]}),I=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...M(e),children:[(0,p.jsx)(`title`,{children:`Bluesky`}),(0,p.jsx)(`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`})]}),L=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...M(e),children:[(0,p.jsx)(`title`,{children:`TypeScript`}),(0,p.jsx)(`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`})]}),R=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...M(e),children:[(0,p.jsx)(`title`,{children:`JavaScript`}),(0,p.jsx)(`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`})]}),z=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...M(e),children:[(0,p.jsx)(`title`,{children:`JSON`}),(0,p.jsx)(`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`})]}),B=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...M(e),children:[(0,p.jsx)(`title`,{children:`CSS`}),(0,p.jsx)(`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`})]}),V=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...M(e),children:[(0,p.jsx)(`title`,{children:`HTML`}),(0,p.jsx)(`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`})]}),H=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...M(e),children:[(0,p.jsx)(`title`,{children:`React`}),(0,p.jsx)(`path`,{fill:`#0E8ADC`,d:`M12 13.677a1.677 1.677 0 100-3.354 1.677 1.677 0 000 3.354z`}),(0,p.jsx)(`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`}),(0,p.jsx)(`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`}),(0,p.jsx)(`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`})]}),U=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...M(e),children:[(0,p.jsx)(`title`,{children:`Markdown`}),(0,p.jsx)(`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`})]}),W=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...M(e),children:[(0,p.jsx)(`title`,{children:`Shell`}),(0,p.jsx)(`path`,{stroke:`#14B8A6`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M4.336 17l6-6-6-6M12.336 19h8`})]}),G=e=>(0,p.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...M(e),children:[(0,p.jsx)(`title`,{children:`YAML`}),(0,p.jsx)(`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`})]}),K=({children:e,className:t,...n})=>(0,p.jsx)(`header`,{className:k(`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}),q=({children:e,className:t})=>(0,p.jsx)(`div`,{className:k(`mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6`,t),children:e}),J=({children:e,className:t})=>(0,p.jsx)(`div`,{className:k(`flex flex-1 items-center justify-start gap-4 min-w-0`,t),children:e}),Y=({children:e,className:t})=>(0,p.jsx)(`div`,{className:k(`flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0`,t),children:e}),X=({children:e,className:t})=>(0,p.jsx)(`div`,{className:k(`hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full`,t),children:e}),Z=({src:e,alt:t,width:n=24,height:r=24,className:i})=>(0,p.jsx)(A,{href:`/`,className:k(`flex items-center gap-2 shrink-0 outline-none`,i),children:e?(0,p.jsx)(`img`,{src:e,alt:t,width:n,height:r,className:`h-6 w-6 object-contain`}):null}),ne=({children:e,className:t})=>(0,p.jsx)(A,{href:`/`,children:(0,p.jsx)(`span`,{className:k(`text-lg font-bold tracking-tight hidden sm:inline-block`,t),children:e})}),Q=({children:e,className:t})=>(0,p.jsx)(`nav`,{className:k(`hidden md:flex items-center gap-6 text-sm font-medium`,t),children:e}),re=({label:e,href:t,active:n,to:r,className:i})=>(0,p.jsxs)(A,{href:t,target:r===`external`?`_blank`:void 0,className:k(`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`&&(0,p.jsx)(`span`,{className:`ml-1 inline-block`,children:(0,p.jsx)(d.ExternalLink,{size:12})})]}),ie=({className:e,onPress:t})=>{let[n,r]=(0,l.useState)(!1),i=n&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return(0,l.useEffect)(()=>{r(!0)},[]),(0,p.jsxs)(f.Button,{onPress:t,className:k(`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:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(d.Search,{size:16}),(0,p.jsx)(`span`,{className:`hidden sm:inline-block`,children:`Search docs...`})]}),(0,p.jsxs)(`div`,{className:`hidden sm:flex items-center gap-1 pointer-events-none select-none`,children:[(0,p.jsx)(`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`}),(0,p.jsx)(`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`})]})]})},ae=({className:e,theme:t,onThemeChange:n})=>(0,p.jsx)(f.ToggleButton,{isSelected:t===`dark`,onChange:n,className:k(`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:t===`dark`?(0,p.jsx)(d.Sun,{size:20}):(0,p.jsx)(d.Moon,{size:20})}),oe=({name:e})=>{if(e===`github`)return(0,p.jsx)(N,{});if(e===`discord`)return(0,p.jsx)(P,{});if(e===`x`)return(0,p.jsx)(F,{});if(e===`bluesky`)return(0,p.jsx)(I,{})};K.Root=K,K.Left=J,K.Right=Y,K.Center=X,K.Logo=Z,K.Title=ne,K.Links=Q,K.Link=re,K.SearchTrigger=ie,K.Theme=ae,K.Socials=({icon:e,link:t,className:n})=>(0,p.jsx)(A,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:k(`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:(0,p.jsx)(oe,{name:e})}),K.Split=({className:e})=>(0,p.jsx)(f.Separator,{orientation:`vertical`,className:k(`h-6 w-px bg-border-subtle mx-1`,e)}),K.Content=q;const $=({children:e,isOpen:t,onOpenChange:n,className:r})=>(0,p.jsx)(f.ModalOverlay,{isOpen:t,onOpenChange:n,isDismissable:!0,className:k(`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:(0,p.jsx)(f.Modal,{className:k(`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:(0,p.jsx)(f.Dialog,{className:`flex flex-col max-h-[70vh] focus:outline-none`,children:e})})});$.Root=$,$.Autocomplete=({children:e,className:t,onSelectionChange:n,...r})=>{let i=f.Autocomplete;return(0,p.jsx)(`div`,{className:t,children:(0,p.jsx)(i,{...r,onSelectionChange:n,className:`flex flex-col min-h-0`,children:e})})},$.Input=({className:e,...t})=>(0,p.jsxs)(f.SearchField,{className:`flex items-center gap-3 border-b border-border-subtle px-4 py-4`,autoFocus:!0,children:[(0,p.jsx)(d.Search,{className:`h-5 w-5 text-text-muted`}),(0,p.jsx)(f.Input,{...t,className:k(`w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none`,e),placeholder:`Search documentation...`}),(0,p.jsx)(`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:(0,p.jsx)(`kbd`,{className:`font-sans`,children:`ESC`})})]}),$.List=({children:e,className:t,...n})=>(0,p.jsx)(f.ListBox,{...n,className:k(`flex-1 overflow-y-auto p-2 outline-none`,t),children:e}),$.Item=Object.assign(({children:e,className:t,...n})=>(0,p.jsx)(f.ListBoxItem,{...n,className:k(`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=>(0,p.jsxs)(p.Fragment,{children:[e,(t.isFocused||t.isSelected)&&(0,p.jsxs)(`div`,{className:`ml-auto opacity-50 flex items-center gap-1`,children:[(0,p.jsx)(`span`,{className:`text-[10px]`,children:`Select`}),(0,p.jsx)(d.CornerDownLeft,{size:10})]})]})}),{Icon:({isHeading:e,className:t})=>(0,p.jsx)(`div`,{className:k(`shrink-0`,t),children:e?(0,p.jsx)(d.Hash,{size:18}):(0,p.jsx)(d.FileText,{size:18})}),Title:({children:e,className:t})=>(0,p.jsx)(`span`,{className:k(`block font-medium truncate flex-1 text-sm`,t),children:e}),Bio:({children:e,className:t})=>(0,p.jsx)(`span`,{className:k(`ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100`,t),children:e})});function se(e){let{currentLocale:t,currentVersion:n}=D(),[r,i]=(0,l.useState)(!1),[a,o]=(0,l.useState)(``),[s,c]=(0,l.useState)(null);return(0,l.useEffect)(()=>{if(!r||s)return;let e=new h.Index({preset:`match`,tokenize:`full`,resolution:9,cache:!0});for(let t of g.default)e.add(t.id,`${t.title} ${t.content}`);c(e)},[r,s]),{isOpen:r,setIsOpen:i,query:a,setQuery:o,list:(0,l.useMemo)(()=>{if(!a)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(!s)return[];let r=s.search(a,{limit:20,suggest:!0}),i=[],o=new Set;for(let e of r){let r=g.default.find(t=>t.id===e);if(!r)continue;let a=!t||r.locale===t,s=!n||r.version===n;!a||!s||o.has(r.url)||(o.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)},[a,s,t,n,e]),input:{value:a,onChange:e=>o(e.target.value)}}}Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return w}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boltdocs",
3
- "version": "2.5.5",
3
+ "version": "2.5.6",
4
4
  "description": "A lightweight documentation generator for React projects.",
5
5
  "main": "dist/node/index.js",
6
6
  "module": "dist/node/index.mjs",
@@ -31,8 +31,13 @@
31
31
  "import": "./dist/client/ssr.mjs",
32
32
  "require": "./dist/client/ssr.js"
33
33
  },
34
- "./theme/neutral.css": "./src/client/theme/neutral.css"
34
+ "./theme/neutral.css": "./dist/client/theme/neutral.css"
35
35
  },
36
+ "files": [
37
+ "dist",
38
+ "bin",
39
+ "src/client"
40
+ ],
36
41
  "keywords": [
37
42
  "docs",
38
43
  "documentation",
@@ -49,7 +54,7 @@
49
54
  "dependencies": {
50
55
  "@mdx-js/rollup": "3.1.1",
51
56
  "@tailwindcss/vite": "4.2.2",
52
- "@vitejs/plugin-react": "4.2.1",
57
+ "@vitejs/plugin-react": "^5.0.0",
53
58
  "cac": "7.0.0",
54
59
  "class-variance-authority": "0.7.1",
55
60
  "clsx": "2.1.1",
@@ -72,25 +77,24 @@
72
77
  "unist-util-visit": "5.1.0",
73
78
  "vite": "7.3.1",
74
79
  "vite-plugin-image-optimizer": "2.0.3",
75
- "zod": "4.3.6",
76
- "zustand": "5.0.12"
80
+ "zod": "4.3.6"
77
81
  },
78
82
  "peerDependencies": {
79
- "react": "19.1.0",
80
- "react-dom": "19.1.0"
83
+ "react": "19.2.5",
84
+ "react-dom": "19.2.5"
81
85
  },
82
86
  "devDependencies": {
83
87
  "@types/node": "25.3.2",
84
- "@types/react": "19.2.14",
85
- "@types/react-dom": "18.3.7",
88
+ "@types/react": "^19.2.14",
89
+ "@types/react-dom": "^19.2.3",
86
90
  "@types/react-router-dom": "5.3.3",
87
91
  "@types/semver": "7.7.1",
88
- "tsup": "8.5.1",
92
+ "tsdown": "^0.21.7",
89
93
  "typescript": "^5.9.3"
90
94
  },
91
95
  "scripts": {
92
- "build": "tsup",
93
- "dev": "tsup --watch",
96
+ "build": "tsdown --config-loader unrun",
97
+ "dev": "tsdown --watch --config-loader unrun",
94
98
  "format": "pnpm exec biome format --write",
95
99
  "lint": "pnpm exec biome lint --write",
96
100
  "check": "pnpm exec biome check --write"