boltdocs 2.5.6 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/bin/boltdocs.js +2 -2
  2. package/dist/client/index.cjs +6 -0
  3. package/dist/client/{index.d.mts → index.d.cts} +134 -252
  4. package/dist/client/index.d.ts +135 -253
  5. package/dist/client/index.js +1 -1
  6. package/dist/client/theme/neutral.css +90 -50
  7. package/dist/node/cli-entry.cjs +2 -2
  8. package/dist/node/cli-entry.mjs +2 -2
  9. package/dist/node/index.cjs +1 -1
  10. package/dist/node/index.d.cts +150 -205
  11. package/dist/node/index.d.mts +150 -205
  12. package/dist/node/index.mjs +1 -1
  13. package/dist/node-BgvNl2Ay.mjs +89 -0
  14. package/dist/node-vkbb0MK7.cjs +89 -0
  15. package/dist/{package-OFZf0s2j.mjs → package-CR0HF9x3.mjs} +1 -1
  16. package/dist/{package-BY8Jd2j4.cjs → package-Dgmsc_l5.cjs} +1 -1
  17. package/dist/search-dialog-3lvKsbVG.js +6 -0
  18. package/dist/search-dialog-DMK5OpgH.cjs +6 -0
  19. package/dist/use-search-C9bxCqfF.js +6 -0
  20. package/dist/use-search-DcfZSunO.cjs +6 -0
  21. package/package.json +19 -22
  22. package/src/client/app/config-context.tsx +38 -5
  23. package/src/client/app/doc-page.tsx +34 -0
  24. package/src/client/app/mdx-component.tsx +2 -3
  25. package/src/client/app/mdx-components-context.tsx +27 -2
  26. package/src/client/app/routes-context.tsx +34 -0
  27. package/src/client/app/scroll-handler.tsx +7 -4
  28. package/src/client/app/theme-context.tsx +71 -67
  29. package/src/client/components/default-layout.tsx +13 -14
  30. package/src/client/components/docs-layout.tsx +1 -2
  31. package/src/client/components/icons-dev.tsx +36 -5
  32. package/src/client/components/mdx/admonition.tsx +11 -27
  33. package/src/client/components/mdx/badge.tsx +1 -1
  34. package/src/client/components/mdx/button.tsx +3 -3
  35. package/src/client/components/mdx/card.tsx +1 -1
  36. package/src/client/components/mdx/code-block.tsx +90 -80
  37. package/src/client/components/mdx/component-preview.tsx +1 -5
  38. package/src/client/components/mdx/component-props.tsx +1 -1
  39. package/src/client/components/mdx/field.tsx +4 -5
  40. package/src/client/components/mdx/file-tree.tsx +6 -3
  41. package/src/client/components/mdx/hooks/use-code-block.ts +2 -2
  42. package/src/client/components/mdx/image.tsx +1 -1
  43. package/src/client/components/mdx/link.tsx +2 -2
  44. package/src/client/components/mdx/list.tsx +1 -1
  45. package/src/client/components/mdx/table.tsx +1 -1
  46. package/src/client/components/mdx/tabs.tsx +1 -1
  47. package/src/client/components/primitives/breadcrumbs.tsx +1 -7
  48. package/src/client/components/primitives/button-group.tsx +1 -1
  49. package/src/client/components/primitives/button.tsx +1 -1
  50. package/src/client/components/primitives/code-block.tsx +113 -0
  51. package/src/client/components/primitives/link.tsx +23 -41
  52. package/src/client/components/primitives/menu.tsx +5 -6
  53. package/src/client/components/primitives/navbar.tsx +6 -18
  54. package/src/client/components/primitives/navigation-menu.tsx +4 -4
  55. package/src/client/components/primitives/on-this-page.tsx +6 -10
  56. package/src/client/components/primitives/page-nav.tsx +4 -9
  57. package/src/client/components/primitives/popover.tsx +1 -1
  58. package/src/client/components/primitives/search-dialog.tsx +3 -6
  59. package/src/client/components/primitives/sidebar.tsx +80 -22
  60. package/src/client/components/primitives/skeleton.tsx +1 -1
  61. package/src/client/components/primitives/tabs.tsx +4 -11
  62. package/src/client/components/primitives/tooltip.tsx +3 -3
  63. package/src/client/components/ui-base/breadcrumbs.tsx +4 -6
  64. package/src/client/components/ui-base/copy-markdown.tsx +2 -7
  65. package/src/client/components/ui-base/github-stars.tsx +2 -2
  66. package/src/client/components/ui-base/head.tsx +58 -51
  67. package/src/client/components/ui-base/loading.tsx +2 -2
  68. package/src/client/components/ui-base/navbar.tsx +12 -14
  69. package/src/client/components/ui-base/not-found.tsx +1 -1
  70. package/src/client/components/ui-base/on-this-page.tsx +6 -6
  71. package/src/client/components/ui-base/page-nav.tsx +4 -8
  72. package/src/client/components/ui-base/search-dialog.tsx +10 -8
  73. package/src/client/components/ui-base/sidebar.tsx +76 -23
  74. package/src/client/components/ui-base/tabs.tsx +9 -8
  75. package/src/client/components/ui-base/theme-toggle.tsx +2 -2
  76. package/src/client/hooks/use-i18n.ts +3 -3
  77. package/src/client/hooks/use-localized-to.ts +1 -1
  78. package/src/client/hooks/use-navbar.ts +8 -6
  79. package/src/client/hooks/use-routes.ts +19 -11
  80. package/src/client/hooks/use-search.ts +1 -1
  81. package/src/client/hooks/use-sidebar.ts +48 -2
  82. package/src/client/hooks/use-tabs.ts +6 -2
  83. package/src/client/hooks/use-version.ts +3 -3
  84. package/src/client/index.ts +22 -22
  85. package/src/client/ssg/boltdocs-shell.tsx +127 -0
  86. package/src/client/ssg/create-routes.tsx +179 -0
  87. package/src/client/ssg/index.ts +3 -0
  88. package/src/client/ssg/mdx-page.tsx +37 -0
  89. package/src/client/store/boltdocs-context.tsx +46 -99
  90. package/src/client/theme/neutral.css +90 -50
  91. package/src/client/types.ts +5 -33
  92. package/src/client/utils/react-to-text.ts +34 -0
  93. package/dist/cache-Cr8W2zgZ.cjs +0 -6
  94. package/dist/cache-DFdakSmR.mjs +0 -6
  95. package/dist/client/index.mjs +0 -6
  96. package/dist/client/ssr.cjs +0 -6
  97. package/dist/client/ssr.d.cts +0 -80
  98. package/dist/client/ssr.d.mts +0 -80
  99. package/dist/client/ssr.mjs +0 -6
  100. package/dist/node-CWXme96p.mjs +0 -73
  101. package/dist/node-VYfhzGrh.cjs +0 -73
  102. package/dist/search-dialog-BeNyI_KQ.mjs +0 -6
  103. package/dist/search-dialog-dYsCAk5S.js +0 -6
  104. package/dist/use-search-D25n0PrV.mjs +0 -6
  105. package/dist/use-search-WuzdH1cJ.js +0 -6
  106. package/src/client/app/index.tsx +0 -348
  107. package/src/client/app/mdx-page.tsx +0 -15
  108. package/src/client/app/preload.tsx +0 -66
  109. package/src/client/app/router.tsx +0 -30
  110. package/src/client/integrations/codesandbox.ts +0 -179
  111. package/src/client/integrations/index.ts +0 -1
  112. package/src/client/ssr.tsx +0 -65
@@ -1,5 +1,4 @@
1
- import React from 'react'
2
- import type { BoltdocsConfig } from '@node/config'
1
+ export type { BoltdocsConfig } from '../shared/types'
3
2
 
4
3
  /**
5
4
  * Metadata provided by the server for a specific route.
@@ -38,6 +37,10 @@ export interface ComponentRoute {
38
37
  badge?: string | { text: 'updated' | 'new' | 'deprecated'; expires?: string }
39
38
  /** Optional icon for the route's group */
40
39
  groupIcon?: string
40
+ /** The sub-route group this route belongs to (from folders starting with _) */
41
+ subRouteGroup?: string
42
+ /** The nested sub-routes if this route acts as the parent of a subRouteGroup */
43
+ subRoutes?: ComponentRoute[]
41
44
  /** The extracted plain-text content of the page for search indexing */
42
45
  _content?: string
43
46
  /** The raw markdown content of the page */
@@ -49,37 +52,6 @@ export interface ComponentRoute {
49
52
  */
50
53
  export type SiteConfig = BoltdocsConfig
51
54
 
52
- /**
53
- * Configuration options for initializing the Boltdocs client app.
54
- */
55
- export interface CreateBoltdocsAppOptions {
56
- /** CSS selector for the DOM element where the app should mount (e.g. '#root') */
57
- target: string
58
- /** Initial routes generated by the Vite plugin (`virtual:boltdocs-routes`) */
59
- routes: ComponentRoute[]
60
- /** The name of the documentation directory (e.g. 'docs') */
61
- docsDirName: string
62
- /** Site configuration (`virtual:boltdocs-config`) */
63
- config: SiteConfig
64
- /** Dynamic import mapping from `import.meta.glob` for the documentation pages */
65
- modules: Record<string, () => Promise<{ default: React.ComponentType<any> }>>
66
- /** The `import.meta.hot` instance necessary for fast refresh/HMR updates */
67
- hot?: {
68
- accept: (cb?: (mod: any) => void) => void
69
- dispose: (cb: (data: any) => void) => void
70
- on: (event: string, cb: (data: any) => void) => void
71
- data: any
72
- }
73
- /** Optional custom React component to render when visiting the root path ('/') */
74
- homePage?: React.ComponentType
75
- /** Custom external pages mapped by their route path */
76
- externalPages?: Record<string, React.ComponentType>
77
- /** Optional custom layout for external pages */
78
- externalLayout?: React.ComponentType<{ children: React.ReactNode }>
79
- /** Optional custom MDX components provided by plugins */
80
- components?: Record<string, React.ComponentType>
81
- }
82
-
83
55
  /**
84
56
  * Tab configuration for the documentation site.
85
57
  */
@@ -0,0 +1,34 @@
1
+ import {
2
+ isValidElement,
3
+ type ReactNode,
4
+ type JSXElementConstructor,
5
+ } from "react";
6
+
7
+ type ResolverMap = Map<
8
+ string | JSXElementConstructor<object>,
9
+ (props: object) => string
10
+ >;
11
+
12
+ const reactToText = (node: ReactNode, resolvers?: ResolverMap): string => {
13
+ if (node == null || typeof node === "boolean") return "";
14
+
15
+ if (typeof node === "string" || typeof node === "number") return String(node);
16
+
17
+ if (Array.isArray(node))
18
+ return node.map((n) => reactToText(n, resolvers)).join("");
19
+
20
+ if (isValidElement(node)) {
21
+ const resolver = resolvers?.get(
22
+ node.type as string | JSXElementConstructor<object>,
23
+ );
24
+ if (resolver) return resolver(node.props as object);
25
+ return reactToText(
26
+ (node.props as { children?: ReactNode }).children,
27
+ resolvers,
28
+ );
29
+ }
30
+
31
+ return "";
32
+ };
33
+
34
+ export { reactToText };
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- 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(`fs`);l=c(l);let u=require(`gray-matter`);u=c(u);let d=require(`isomorphic-dompurify`);d=c(d);let f=require(`zod`),p=require(`path`);p=c(p);let m=require(`crypto`);m=c(m);let h=require(`zlib`);h=c(h);let g=require(`util`);const _=/^[a-zA-Z0-9\-_\/\.\(\)]+$/,v=f.z.object({title:f.z.string().max(200).optional(),description:f.z.string().max(500).optional(),sidebarPosition:f.z.number().optional(),sidebarLabel:f.z.string().max(100).optional(),category:f.z.string().max(50).optional(),order:f.z.number().optional(),badge:f.z.string().max(50).optional(),icon:f.z.string().max(50).optional()});var y=class e extends Error{constructor(t){super(t),this.name=`SecurityViolationError`,Object.setPrototypeOf(this,e.prototype)}},b=class e extends y{constructor(t){super(t),this.name=`PathTraversalError`,Object.setPrototypeOf(this,e.prototype)}},x=class e extends y{constructor(t){super(t),this.name=`EncodingSecurityError`,Object.setPrototypeOf(this,e.prototype)}},S=class e extends y{constructor(t){super(t),this.name=`ValidationError`,Object.setPrototypeOf(this,e.prototype)}};function C(e){return e.replace(/\\/g,`/`)}function w(e){return e.replace(/^\d+\./,``)}function T(e){let t=e.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function E(e){return/\.mdx?$/.test(e)}function D(e){try{return l.default.statSync(e).mtimeMs}catch{return 0}}function O(e){let t=l.default.readFileSync(e,`utf-8`);try{let{data:n,content:r,matter:i}=(0,u.default)(t);if(i&&i.length>10240)throw L(`FRONTMATTER_TOO_LARGE`,`Frontmatter block exceeds size limit`,{size:i.length,file:e}),new S(`Security breach: Frontmatter size exceeds limit of 10240 bytes`);let a=v.safeParse(n);a.success||console.warn(`[VALIDATION][${e}] Invalid frontmatter fields detected.`);let o={...a.success?a.data:{}};return o.title&&=N(o.title).trim(),o.description&&=N(o.description).trim(),{data:o,content:r}}catch(e){if(e instanceof S)throw e;return{data:{},content:t}}}function k(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function A(e){return k(e)}function j(e){let t=e.split(`/`).map(e=>w(I(e))).join(`/`).replace(/\/$/,``);return t=t.replace(/\.mdx?$/,``),(t===`index`||t.endsWith(`/index`))&&(t=t.replace(/index$/,``)),t.startsWith(`/`)||(t=`/`+t),t.length>1&&t.endsWith(`/`)&&(t=t.slice(0,-1)),t}function M(e){return d.default.sanitize(e,{ALLOWED_TAGS:`b.i.em.strong.a.p.br.code.pre.span.div.h1.h2.h3.h4.h5.h6.ul.ol.li.table.thead.tbody.tr.th.td.blockquote.hr`.split(`.`),ALLOWED_ATTR:[`href`,`title`,`target`,`class`,`id`,`src`,`alt`,`width`,`height`],FORCE_BODY:!0})}d.default.addHook(`afterSanitizeAttributes`,e=>{if(e.hasAttribute(`href`)){let t=e.getAttribute(`href`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`href`)}if(e.hasAttribute(`src`)){let t=e.getAttribute(`src`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`src`)}});function N(e){return d.default.sanitize(e,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function P(e){return e.charAt(0).toUpperCase()+e.slice(1)}function F(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function I(e){return e.replace(/[^a-zA-Z0-9\-_\/\.]/g,``).split(`/`).filter(e=>e!==`..`&&e!==`.`).map(e=>e.replace(/\.\.+/g,`.`)).join(`/`)}function L(e,t,n={}){let r=new Date().toISOString(),i={...n};for(let e in i)typeof i[e]==`string`&&i[e].includes(`:`)&&(i[e]=i[e].split(/[\\/]/).pop()||i[e]);console.error(`[SECURITY][${r}] TYPE: ${e} | MESSAGE: ${t} | DETAILS: ${JSON.stringify(i)}`)}var R=o({FileCache:()=>J,TransformCache:()=>Y,flushCache:()=>X});const z=(0,g.promisify)(l.default.writeFile),B=(0,g.promisify)(l.default.readFile),V=(0,g.promisify)(l.default.mkdir),H=(0,g.promisify)(l.default.rename);(0,g.promisify)(l.default.unlink);const U=process.env.BOLTDOCS_CACHE_DIR||`.boltdocs`,W=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||`2000`,10),G=process.env.BOLTDOCS_CACHE_COMPRESS!==`0`;var K=class{cache=new Map;constructor(e){this.limit=e}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.limit){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(e,t)}get size(){return this.cache.size}clear(){this.cache.clear()}};const q=new class{queue=Promise.resolve();pendingCount=0;add(e){this.pendingCount++,this.queue=this.queue.then(e).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}};var J=class{entries=new Map;cachePath=null;compress;constructor(e={}){if(this.compress=e.compress===void 0?G:e.compress,e.name){let t=e.root||process.cwd(),n=this.compress?`json.gz`:`json`;this.cachePath=p.default.resolve(t,U,`${e.name}.${n}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!==`1`&&!(!this.cachePath||!l.default.existsSync(this.cachePath)))try{let e=l.default.readFileSync(this.cachePath);this.cachePath.endsWith(`.gz`)&&(e=h.default.gunzipSync(e));let t=JSON.parse(e.toString(`utf-8`));this.entries=new Map(Object.entries(t))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE===`1`||!this.cachePath)return;let e=Object.fromEntries(this.entries),t=JSON.stringify(e),n=this.cachePath,r=this.compress;q.add(async()=>{try{await V(p.default.dirname(n),{recursive:!0});let e=Buffer.from(t);r&&(e=h.default.gzipSync(e));let i=`${n}.${m.default.randomBytes(4).toString(`hex`)}.tmp`;await z(i,e),await H(i,n)}catch{}})}get(e){let t=this.entries.get(e);return!t||D(e)!==t.mtime?null:t.data}set(e,t){this.entries.set(e,{data:t,mtime:D(e)})}isValid(e){let t=this.entries.get(e);return t?D(e)===t.mtime:!1}invalidate(e){this.entries.delete(e)}invalidateAll(){this.entries.clear()}pruneStale(e){for(let t of this.entries.keys())e.has(t)||this.entries.delete(t)}get size(){return this.entries.size}async flush(){await q.flush()}},Y=class{index=new Map;memoryCache=new K(W);baseDir;shardsDir;indexPath;constructor(e,t=process.cwd()){this.baseDir=p.default.resolve(t,U,`transform-${e}`),this.shardsDir=p.default.resolve(this.baseDir,`shards`),this.indexPath=p.default.resolve(this.baseDir,`index.json`)}load(){if(process.env.BOLTDOCS_NO_CACHE!==`1`&&l.default.existsSync(this.indexPath))try{let e=l.default.readFileSync(this.indexPath,`utf-8`);this.index=new Map(Object.entries(JSON.parse(e)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE===`1`)return;let e=JSON.stringify(Object.fromEntries(this.index)),t=this.indexPath;q.add(async()=>{await V(p.default.dirname(t),{recursive:!0}),await z(t,e)})}async getMany(e){let t=new Map,n=[];for(let r of e){let e=this.memoryCache.get(r);e?t.set(r,e):this.index.has(r)&&n.push(r)}if(n.length>0){let e=await Promise.all(n.map(async e=>{let t=this.index.get(e),n=p.default.resolve(this.shardsDir,`${t}.gz`);try{let t=await B(n),r=h.default.gunzipSync(t).toString(`utf-8`);return this.memoryCache.set(e,r),{key:e,val:r}}catch{return null}}));for(let n of e)n&&t.set(n.key,n.val)}return t}get(e){let t=this.memoryCache.get(e);if(t)return t;let n=this.index.get(e);if(!n)return null;let r=p.default.resolve(this.shardsDir,`${n}.gz`);if(!l.default.existsSync(r))return null;try{let t=l.default.readFileSync(r),n=h.default.gunzipSync(t).toString(`utf-8`);return this.memoryCache.set(e,n),n}catch{return null}}set(e,t){let n=m.default.createHash(`md5`).update(t).digest(`hex`);this.index.set(e,n),this.memoryCache.set(e,t);let r=p.default.resolve(this.shardsDir,`${n}.gz`);q.add(async()=>{if(l.default.existsSync(r))return;await V(this.shardsDir,{recursive:!0});let e=h.default.gzipSync(Buffer.from(t)),n=`${r}.${m.default.randomBytes(4).toString(`hex`)}.tmp`;await z(n,e),await H(n,r)})}get size(){return this.index.size}async flush(){await q.flush()}};async function X(){await q.flush()}Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return S}});
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- import e from"fs";import t from"gray-matter";import n from"isomorphic-dompurify";import{z as r}from"zod";import i from"path";import a from"crypto";import o from"zlib";import{promisify as s}from"util";var c=Object.defineProperty,l=(e,t)=>()=>(e&&(t=e(e=0)),t),u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),d=(e,t)=>{let n={};for(var r in e)c(n,r,{get:e[r],enumerable:!0});return t||c(n,Symbol.toStringTag,{value:`Module`}),n},f,p,m=l((()=>{f=/^[a-zA-Z0-9\-_\/\.\(\)]+$/,p=10*1024})),h,g=l((()=>{h=r.object({title:r.string().max(200).optional(),description:r.string().max(500).optional(),sidebarPosition:r.number().optional(),sidebarLabel:r.string().max(100).optional(),category:r.string().max(50).optional(),order:r.number().optional(),badge:r.string().max(50).optional(),icon:r.string().max(50).optional()})})),_,v,y,b,x=l((()=>{_=class e extends Error{constructor(t){super(t),this.name=`SecurityViolationError`,Object.setPrototypeOf(this,e.prototype)}},v=class e extends _{constructor(t){super(t),this.name=`PathTraversalError`,Object.setPrototypeOf(this,e.prototype)}},y=class e extends _{constructor(t){super(t),this.name=`EncodingSecurityError`,Object.setPrototypeOf(this,e.prototype)}},b=class e extends _{constructor(t){super(t),this.name=`ValidationError`,Object.setPrototypeOf(this,e.prototype)}}}));function S(e){return e.replace(/\\/g,`/`)}function C(e){return e.replace(/^\d+\./,``)}function w(e){let t=e.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function T(e){return/\.mdx?$/.test(e)}function E(t){try{return e.statSync(t).mtimeMs}catch{return 0}}function D(n){let r=e.readFileSync(n,`utf-8`);try{let{data:e,content:i,matter:a}=t(r);if(a&&a.length>10240)throw I(`FRONTMATTER_TOO_LARGE`,`Frontmatter block exceeds size limit`,{size:a.length,file:n}),new b(`Security breach: Frontmatter size exceeds limit of ${p} bytes`);let o=h.safeParse(e);o.success||console.warn(`[VALIDATION][${n}] Invalid frontmatter fields detected.`);let s={...o.success?o.data:{}};return s.title&&=M(s.title).trim(),s.description&&=M(s.description).trim(),{data:s,content:i}}catch(e){if(e instanceof b)throw e;return{data:{},content:r}}}function O(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function k(e){return O(e)}function A(e){let t=e.split(`/`).map(e=>C(F(e))).join(`/`).replace(/\/$/,``);return t=t.replace(/\.mdx?$/,``),(t===`index`||t.endsWith(`/index`))&&(t=t.replace(/index$/,``)),t.startsWith(`/`)||(t=`/`+t),t.length>1&&t.endsWith(`/`)&&(t=t.slice(0,-1)),t}function j(e){return n.sanitize(e,{ALLOWED_TAGS:`b.i.em.strong.a.p.br.code.pre.span.div.h1.h2.h3.h4.h5.h6.ul.ol.li.table.thead.tbody.tr.th.td.blockquote.hr`.split(`.`),ALLOWED_ATTR:[`href`,`title`,`target`,`class`,`id`,`src`,`alt`,`width`,`height`],FORCE_BODY:!0})}function M(e){return n.sanitize(e,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function N(e){return e.charAt(0).toUpperCase()+e.slice(1)}function P(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function F(e){return e.replace(/[^a-zA-Z0-9\-_\/\.]/g,``).split(`/`).filter(e=>e!==`..`&&e!==`.`).map(e=>e.replace(/\.\.+/g,`.`)).join(`/`)}function I(e,t,n={}){let r=new Date().toISOString(),i={...n};for(let e in i)typeof i[e]==`string`&&i[e].includes(`:`)&&(i[e]=i[e].split(/[\\/]/).pop()||i[e]);console.error(`[SECURITY][${r}] TYPE: ${e} | MESSAGE: ${t} | DETAILS: ${JSON.stringify(i)}`)}var L=l((()=>{m(),g(),x(),n.addHook(`afterSanitizeAttributes`,e=>{if(e.hasAttribute(`href`)){let t=e.getAttribute(`href`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`href`)}if(e.hasAttribute(`src`)){let t=e.getAttribute(`src`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`src`)}})})),R=d({FileCache:()=>Z,TransformCache:()=>Q,flushCache:()=>z});async function z(){await X.flush()}var B,V,H,U,W,G,K,q,J,Y,X,Z,Q,$=l((()=>{L(),B=s(e.writeFile),V=s(e.readFile),H=s(e.mkdir),U=s(e.rename),s(e.unlink),W=process.env.BOLTDOCS_CACHE_DIR||`.boltdocs`,G=`shards`,K=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||`2000`,10),q=process.env.BOLTDOCS_CACHE_COMPRESS!==`0`,J=class{cache=new Map;constructor(e){this.limit=e}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.limit){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(e,t)}get size(){return this.cache.size}clear(){this.cache.clear()}},Y=class{queue=Promise.resolve();pendingCount=0;add(e){this.pendingCount++,this.queue=this.queue.then(e).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}},X=new Y,Z=class{entries=new Map;cachePath=null;compress;constructor(e={}){if(this.compress=e.compress===void 0?q:e.compress,e.name){let t=e.root||process.cwd(),n=this.compress?`json.gz`:`json`;this.cachePath=i.resolve(t,W,`${e.name}.${n}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!==`1`&&!(!this.cachePath||!e.existsSync(this.cachePath)))try{let t=e.readFileSync(this.cachePath);this.cachePath.endsWith(`.gz`)&&(t=o.gunzipSync(t));let n=JSON.parse(t.toString(`utf-8`));this.entries=new Map(Object.entries(n))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE===`1`||!this.cachePath)return;let e=Object.fromEntries(this.entries),t=JSON.stringify(e),n=this.cachePath,r=this.compress;X.add(async()=>{try{await H(i.dirname(n),{recursive:!0});let e=Buffer.from(t);r&&(e=o.gzipSync(e));let s=`${n}.${a.randomBytes(4).toString(`hex`)}.tmp`;await B(s,e),await U(s,n)}catch{}})}get(e){let t=this.entries.get(e);return!t||E(e)!==t.mtime?null:t.data}set(e,t){this.entries.set(e,{data:t,mtime:E(e)})}isValid(e){let t=this.entries.get(e);return t?E(e)===t.mtime:!1}invalidate(e){this.entries.delete(e)}invalidateAll(){this.entries.clear()}pruneStale(e){for(let t of this.entries.keys())e.has(t)||this.entries.delete(t)}get size(){return this.entries.size}async flush(){await X.flush()}},Q=class{index=new Map;memoryCache=new J(K);baseDir;shardsDir;indexPath;constructor(e,t=process.cwd()){this.baseDir=i.resolve(t,W,`transform-${e}`),this.shardsDir=i.resolve(this.baseDir,G),this.indexPath=i.resolve(this.baseDir,`index.json`)}load(){if(process.env.BOLTDOCS_NO_CACHE!==`1`&&e.existsSync(this.indexPath))try{let t=e.readFileSync(this.indexPath,`utf-8`);this.index=new Map(Object.entries(JSON.parse(t)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE===`1`)return;let e=JSON.stringify(Object.fromEntries(this.index)),t=this.indexPath;X.add(async()=>{await H(i.dirname(t),{recursive:!0}),await B(t,e)})}async getMany(e){let t=new Map,n=[];for(let r of e){let e=this.memoryCache.get(r);e?t.set(r,e):this.index.has(r)&&n.push(r)}if(n.length>0){let e=await Promise.all(n.map(async e=>{let t=this.index.get(e),n=i.resolve(this.shardsDir,`${t}.gz`);try{let t=await V(n),r=o.gunzipSync(t).toString(`utf-8`);return this.memoryCache.set(e,r),{key:e,val:r}}catch{return null}}));for(let n of e)n&&t.set(n.key,n.val)}return t}get(t){let n=this.memoryCache.get(t);if(n)return n;let r=this.index.get(t);if(!r)return null;let a=i.resolve(this.shardsDir,`${r}.gz`);if(!e.existsSync(a))return null;try{let n=e.readFileSync(a),r=o.gunzipSync(n).toString(`utf-8`);return this.memoryCache.set(t,r),r}catch{return null}}set(t,n){let r=a.createHash(`md5`).update(n).digest(`hex`);this.index.set(t,r),this.memoryCache.set(t,n);let s=i.resolve(this.shardsDir,`${r}.gz`);X.add(async()=>{if(e.existsSync(s))return;await H(this.shardsDir,{recursive:!0});let t=o.gzipSync(Buffer.from(n)),r=`${s}.${a.randomBytes(4).toString(`hex`)}.tmp`;await B(r,t),await U(r,s)})}get size(){return this.index.size}async flush(){await X.flush()}}}));export{f as C,d as D,l as E,x as S,u as T,M as _,N as a,v as b,w as c,L as d,T as f,j as g,D as h,$ as i,A as l,S as m,Q as n,O as o,I as p,R as r,k as s,Z as t,P as u,C as v,m as w,b as x,y};
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- import{A as e,B as t,C as n,D as r,E as i,F as a,I as o,L as s,M as c,N as l,O as u,P as d,R as f,S as p,T as m,V as h,_ as g,a as _,b as v,c as y,d as b,f as ee,g as te,h as ne,i as re,j as ie,k as x,l as S,m as ae,n as C,o as w,p as oe,r as T,s as E,t as se,u as ce,v as D,w as le,x as ue,y as de,z as fe}from"../use-search-D25n0PrV.mjs";import O,{Children as k,Component as pe,Suspense as me,createContext as he,isValidElement as A,lazy as ge,startTransition as _e,use as ve,useCallback as j,useEffect as M,useLayoutEffect as ye,useMemo as N,useRef as P,useState as F}from"react";import{createRoot as be}from"react-dom/client";import{BrowserRouter as xe,Outlet as Se,Route as I,Routes as Ce,useHref as we,useLocation as L,useNavigate as Te}from"react-router-dom";import*as Ee from"lucide-react";import{AlertTriangle as De,ArrowLeft as Oe,Bookmark as ke,Check as Ae,ChevronDown as R,ChevronLeft as je,ChevronRight as Me,ChevronUp as Ne,ChevronsLeft as Pe,ChevronsRight as Fe,Circle as Ie,CircleHelp as Le,Copy as Re,ExternalLink as ze,File as Be,FileCode as Ve,FileImage as He,FileText as Ue,Flame as We,Folder as Ge,Home as Ke,Info as qe,Languages as Je,Lightbulb as Ye,Link as Xe,Monitor as Ze,Moon as Qe,Pencil as $e,ShieldAlert as et,Sun as tt,TextAlignStart as nt,Zap as rt}from"lucide-react";import*as z from"react-aria-components";import{Button as it,RouterProvider as at}from"react-aria-components";import{Fragment as B,jsx as V,jsxs as H}from"react/jsx-runtime";import ot from"virtual:boltdocs-layout";import{cva as U}from"class-variance-authority";import st from"virtual:boltdocs-mdx-components";var ct=Object.defineProperty,lt=(e,t)=>{let n={};for(var r in e)ct(n,r,{get:e[r],enumerable:!0});return t||ct(n,Symbol.toStringTag,{value:`Module`}),n};function ut(){return V(`div`,{className:`flex items-center justify-center min-h-[60vh] text-center`,children:H(`div`,{className:`space-y-4`,children:[V(`span`,{className:`text-8xl font-black tracking-tighter text-primary-500/20`,children:`404`}),V(`h1`,{className:`text-2xl font-bold text-text-main`,children:`Page Not Found`}),V(`p`,{className:`text-sm text-text-muted max-w-sm mx-auto`,children:`The page you're looking for doesn't exist or has been moved.`}),H(c,{href:`/`,className:`inline-flex items-center gap-2 rounded-lg bg-primary-500 px-5 py-2.5 text-sm font-semibold text-white outline-none transition-all hover:brightness-110 hover:shadow-lg focus-visible:ring-2 focus-visible:ring-primary-500/30`,children:[V(Oe,{size:16}),` Go to Home`]})]})})}const dt=he(void 0);function ft({children:e}){let[t,n]=F(`system`),[r,i]=F(`dark`),[a,o]=F(!1);return M(()=>{o(!0);let e=localStorage.getItem(`boltdocs-theme`),t=e===`light`||e===`dark`||e===`system`?e:`system`;n(t);let r=window.matchMedia(`(prefers-color-scheme: dark)`);((e,t)=>{i(e===`system`?t?`dark`:`light`:e)})(t,r.matches);let a=e=>{i(t=>(localStorage.getItem(`boltdocs-theme`)||`system`)===`system`?e.matches?`dark`:`light`:t)};return r.addEventListener(`change`,a),()=>r.removeEventListener(`change`,a)},[]),M(()=>{if(!a)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`).matches,n=t===`system`?e?`dark`:`light`:t;i(n);let r=document.documentElement;n===`light`?(r.classList.add(`theme-light`),r.dataset.theme=`light`):(r.classList.remove(`theme-light`),r.dataset.theme=`dark`)},[t,a]),V(dt.Provider,{value:{theme:t,resolvedTheme:r,setTheme:e=>{n(e),localStorage.setItem(`boltdocs-theme`,e)}},children:e})}function W(){let e=ve(dt);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e}function pt({children:e}){let t=Te();return V(at,{navigate:(e,n)=>{_e(()=>{t(e,n)})},useHref:we,children:e})}function mt(){let{pathname:e,hash:t}=L();return ye(()=>{let e=document.querySelector(`.boltdocs-content`)||window,n=()=>e===window?window.scrollY:e.scrollTop,r=(t,n=`auto`)=>{e===window?window.scrollTo({top:t,behavior:n}):e.scrollTo({top:t,behavior:n})};if(t){let i=t.replace(`#`,``),a=document.getElementById(i);if(a){let t=e===window?0:e.getBoundingClientRect().top;r(a.getBoundingClientRect().top-t-80+n(),`smooth`);return}}r(0)},[e,t]),null}function ht(){return V(ot,{children:V(Se,{})})}const gt=he({});function _t(){return ve(gt)}function vt({components:e,children:t}){return V(gt.Provider,{value:e,children:t})}function yt({Component:e}){return V(e,{components:_t()})}const bt=({className:t,variant:n,size:r,rounded:i,iconSize:a,disabled:o,...s})=>V(e,{className:d(`group`,ie({variant:n,size:r,rounded:i,iconSize:a,disabled:o,className:t})),...s}),xt=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);return t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t),!0}};function St(e){let{title:t}=e,[n,r]=F(!1),[i,a]=F(!1),[o,s]=F(!1),c=P(null);h();let l=j(async()=>{xt(c.current?.textContent??``),r(!0),setTimeout(()=>r(!1),2e3)},[]);return M(()=>{s((c.current?.textContent?.length??0)>120)},[e.children,e.highlightedHtml]),{copied:n,isExpanded:i,setIsExpanded:a,isExpandable:o,preRef:c,handleCopy:l,shouldTruncate:o&&!i}}const Ct={ts:u,tsx:i,js:n,jsx:i,json:le,css:ue,html:v,md:m,mdx:m,bash:r,sh:r,yaml:x,yml:x};function G(e){let{children:t,hideCopy:n=!1,highlightedHtml:r,"data-highlighted-html":i,title:a,"data-lang":o,plain:s=!1,...c}=e,l=r||i;h();let u=e.lang||o||``,{copied:f,isExpanded:p,setIsExpanded:m,isExpandable:g,preRef:_,handleCopy:v,shouldTruncate:y}=St(e),b=Ct[u];return H(`div`,{className:d(`group relative overflow-hidden bg-(--color-code-bg)`,`contain-layout contain-paint`,{"my-6 rounded-lg border border-border-subtle":!s,"[&>pre]:max-h-62.5 [&>pre]:overflow-hidden":y},e.className),children:[a&&H(`div`,{className:`flex items-center gap-2 border-b border-border-subtle bg-bg-surface/50 px-4 py-2 text-[13px] font-medium text-text-muted`,children:[b?V(b,{size:14}):V(Be,{size:14,className:`opacity-60`}),V(`span`,{children:a})]}),V(`div`,{className:`absolute top-3 right-4 z-50 flex items-center gap-2 transition-all duration-300 opacity-0 group-hover:opacity-100`,children:!n&&V(de,{content:f?`Copied!`:`Copy code`,children:V(z.Button,{onPress:v,className:d(`grid place-items-center size-8 bg-transparent outline-none cursor-pointer transition-all duration-200 hover:scale-110 active:scale-95 [&>svg]:size-4 [&>svg]:stroke-2`,f?`text-emerald-400`:`text-text-muted hover:text-text-main`),"aria-label":`Copy code`,children:V(f?Ae:Re,{size:20})})})}),l?V(`div`,{ref:_,className:`shiki-wrapper [&>pre]:m-0! [&>pre]:rounded-none! [&>pre]:border-none! [&>pre]:bg-inherit! [&>pre>code]:grid! [&>pre>code]:p-5! [&>.shiki.shiki-themes]:bg-transparent!`,dangerouslySetInnerHTML:{__html:l}}):V(`pre`,{ref:_,className:`m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]`,...c,children:t}),g&&V(`div`,{className:d(y?`absolute bottom-0 inset-x-0 h-24 bg-linear-to-t from-(--color-code-bg) to-transparent flex items-end justify-center pb-4 z-10`:`relative flex justify-center py-4`),children:V(z.Button,{onPress:()=>m(!p),className:`rounded-full bg-bg-surface border border-border-subtle px-5 py-2 text-[0.8125rem] font-medium text-text-main outline-none cursor-pointer transition-all hover:bg-border-subtle hover:-translate-y-px backdrop-blur-md`,children:p?`Show less`:`Expand code`})})]})}function wt({initialIndex:e=0,tabs:t}){let n=t[e]?.props.disabled?t.findIndex(e=>!e.props.disabled):e,[r,i]=F(n===-1?0:n),a=P([]),[o,s]=F({opacity:0,transform:`translateX(0)`,width:0});return M(()=>{let e=a.current[r];e&&s({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[r,t]),{active:r,setActive:i,tabRefs:a,indicatorStyle:o,handleKeyDown:j(e=>{let n=0;if(e.key===`ArrowRight`?n=1:e.key===`ArrowLeft`&&(n=-1),n!==0){let e=(r+n+t.length)%t.length;for(;t[e].props.disabled&&e!==r;)e=(e+n+t.length)%t.length;e!==r&&!t[e].props.disabled&&(i(e),a.current[e]?.focus())}},[r,t])}}const Tt=U(`relative flex items-center border-b border-border-subtle gap-1 overflow-x-auto no-scrollbar`,{variants:{size:{default:`px-0`,compact:`px-2`}},defaultVariants:{size:`default`}}),Et=U(`flex items-center gap-2 px-4 py-2.5 text-sm font-medium outline-none transition-all duration-200 cursor-pointer bg-transparent border-none select-none whitespace-nowrap`,{variants:{isActive:{true:`text-primary-500`,false:`text-text-muted hover:text-text-main`},isDisabled:{true:`opacity-40 pointer-events-none`,false:``}},defaultVariants:{isActive:!1,isDisabled:!1}});function Dt({children:e}){return V(`div`,{className:`py-4`,children:typeof e==`string`?V(G,{className:`language-bash`,children:V(`code`,{children:e.trim()})}):e})}function Ot({defaultIndex:e=0,children:t}){let n=N(()=>k.toArray(t).filter(e=>A(e)&&e.props?.label),[t]),{active:r,setActive:i,tabRefs:a,indicatorStyle:o}=wt({initialIndex:e,tabs:n});return V(`div`,{className:`my-8 w-full group/tabs`,children:H(z.Tabs,{selectedKey:r.toString(),onSelectionChange:e=>i(Number(e)),className:`w-full`,children:[H(z.TabList,{"aria-label":`Content Tabs`,className:d(Tt()),children:[n.map((e,t)=>{let{label:n,icon:r,disabled:i}=e.props,o=t.toString();return H(z.Tab,{id:o,isDisabled:i,ref:e=>{a.current[t]=e},className:({isSelected:e,isDisabled:t})=>d(Et({isActive:e,isDisabled:t})),children:[!!r&&V(`span`,{className:`shrink-0 [&>svg]:w-4 [&>svg]:h-4`,children:r}),V(`span`,{children:n})]},o)}),V(`div`,{className:`absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none`,style:o,"aria-hidden":`true`})]}),n.map((e,t)=>V(z.TabPanel,{id:t.toString(),children:n[t]},t))]})})}function kt({src:e,poster:t,alt:n,children:r,controls:i,preload:a=`metadata`,...o}){let s=P(null),[c,l]=F(!1);return M(()=>{let e=s.current;if(!e)return;let t=new IntersectionObserver(([e])=>{e.isIntersecting&&(l(!0),t.disconnect())},{rootMargin:`200px`});return t.observe(e),()=>t.disconnect()},[]),V(`div`,{ref:s,className:`my-6 overflow-hidden rounded-lg border border-border-subtle`,children:c?H(`video`,{className:`block w-full h-auto`,src:e,poster:t,controls:!0,preload:a,playsInline:!0,...o,children:[r,`Your browser does not support the video tag.`]}):V(`div`,{className:`aspect-video bg-bg-surface animate-pulse`,role:`img`,"aria-label":n||`Video`})})}const At=U(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-tight`,{variants:{variant:{default:`bg-bg-surface text-text-muted border-border-subtle`,primary:`bg-primary-500/15 text-primary-400 border-primary-500/20`,success:`bg-emerald-500/15 text-emerald-400 border-emerald-500/20`,warning:`bg-amber-500/15 text-amber-400 border-amber-500/20`,danger:`bg-red-500/15 text-red-400 border-red-500/20`,info:`bg-sky-500/15 text-sky-400 border-sky-500/20`}},defaultVariants:{variant:`default`}});function jt({variant:e=`default`,children:t,className:n=``,...r}){return V(`span`,{className:d(At({variant:e}),n),...r,children:t})}const Mt=U(`grid gap-4 my-6`,{variants:{cols:{1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,4:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-4`}},defaultVariants:{cols:3}});function Nt({cols:e=3,children:t,className:n=``,...r}){return V(`div`,{className:d(Mt({cols:e}),n),...r,children:t})}function Pt({title:e,icon:t,href:n,children:r,className:i=``,...a}){let o=P(null),s=P(null),c=j(e=>{let t=o.current||s.current;if(!t)return;let{left:n,top:r}=t.getBoundingClientRect();t.style.setProperty(`--x`,`${e.clientX-n}px`),t.style.setProperty(`--y`,`${e.clientY-r}px`)},[]),l=H(B,{children:[V(`div`,{className:`pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 group-hover:opacity-100`,style:{background:`radial-gradient(400px circle at var(--x) var(--y), color-mix(in oklch, var(--color-primary-500), transparent 90%), transparent 80%)`}}),t&&V(`div`,{className:`mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-primary-500/10 text-primary-400 text-lg transition-transform duration-300 group-hover:scale-105 group-hover:-rotate-3`,children:t}),H(`div`,{className:`space-y-1.5`,children:[e&&V(`h3`,{className:`text-sm font-bold text-text-main`,children:e}),r&&V(`div`,{className:`text-sm text-text-muted leading-relaxed`,children:r})]})]}),u=d(`group relative block rounded-xl border border-border-subtle bg-bg-surface p-5 outline-none overflow-hidden`,`transition-all duration-200 hover:border-primary-500/40 hover:shadow-lg hover:shadow-primary-500/5`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,i);return n?V(z.Link,{ref:s,href:n,className:d(u,`no-underline cursor-pointer`),onMouseMove:c,...a,children:l}):V(`div`,{ref:o,role:`presentation`,className:u,onMouseMove:c,...a,children:l})}const Ft={note:V(ke,{size:18}),tip:V(Ye,{size:18}),info:V(qe,{size:18}),warning:V(De,{size:18}),danger:V(et,{size:18}),important:V(We,{size:18}),caution:V(rt,{size:18})},It={note:`Note`,tip:`Tip`,info:`Info`,warning:`Warning`,danger:`Danger`,important:`Important`,caution:`Caution`},Lt=U(`py-4 px-4 rounded-lg`,{variants:{type:{note:`border-primary-400 bg-primary-500/5 text-primary-400`,tip:`border-emerald-500 bg-emerald-500/5 text-emerald-500`,info:`border-sky-500 bg-sky-500/5 text-sky-500`,warning:`border-amber-500 bg-amber-500/5 text-amber-500`,danger:`border-red-500 bg-red-500/5 text-red-500`,important:`border-orange-500 bg-orange-500/5 text-orange-500`,caution:`border-yellow-500 bg-yellow-500/5 text-yellow-500`}},defaultVariants:{type:`note`}});function K({type:e=`note`,title:t,children:n,className:r=``,...i}){return H(`div`,{className:d(Lt({type:e}),r),role:e===`warning`||e===`danger`?`alert`:`note`,...i,children:[H(`div`,{className:`flex items-center flex-row gap-2 mb-2`,children:[V(`span`,{className:d(`shrink-0`,Lt({type:e})),children:Ft[e]}),V(`span`,{className:`text-sm font-bold tracking-tight text-text-main`,children:t||It[e]})]}),V(`div`,{className:`text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0`,children:n})]})}const Rt=e=>V(K,{type:`note`,...e}),zt=e=>V(K,{type:`tip`,...e}),Bt=e=>V(K,{type:`warning`,...e}),Vt=e=>V(K,{type:`danger`,...e}),Ht=e=>V(K,{type:`info`,...e}),Ut=e=>V(K,{type:`important`,...e}),Wt=e=>V(K,{type:`caution`,...e}),Gt=U(`my-6 transition-all duration-200`,{variants:{variant:{default:`list-disc pl-5 text-text-muted marker:text-primary-500/50`,number:`list-decimal pl-5 text-text-muted marker:text-primary-500/50 marker:font-bold`,checked:`list-none p-0`,arrow:`list-none p-0`,bubble:`list-none p-0`},cols:{1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,4:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-4`},isGrid:{true:`grid gap-x-8 gap-y-3`,false:`space-y-2`},dense:{true:`space-y-1`,false:`space-y-2`}},compoundVariants:[{variant:`default`,dense:!0,className:`space-y-0.5`}],defaultVariants:{variant:`default`,cols:1,isGrid:!1,dense:!1}}),Kt=U(`group flex items-start gap-3 text-sm leading-relaxed transition-all duration-200`,{variants:{variant:{default:``,number:``,checked:`hover:translate-x-0.5`,arrow:`hover:translate-x-0.5`,bubble:`hover:translate-x-0.5`},dense:{true:`py-0`,false:`py-0.5`}},defaultVariants:{variant:`default`,dense:!1}}),qt=U(`mt-1 shrink-0 flex items-center justify-center transition-transform group-hover:scale-110`,{variants:{variant:{bubble:`h-5 w-5 rounded-full bg-primary-500/10 text-primary-500 text-[10px] font-bold`,default:``}},defaultVariants:{variant:`default`}});function Jt({icon:e,children:t,variant:n,dense:r}){return H(`li`,{className:d(Kt({variant:n,dense:r})),children:[e&&V(`span`,{className:d(qt({variant:n===`bubble`?`bubble`:`default`})),children:e}),V(`div`,{className:`flex-1 text-text-muted group-hover:text-text-main transition-colors`,children:t})]})}const Yt={checked:e=>V(Ae,{size:14,className:d(`text-emerald-500 shrink-0`,e)}),arrow:e=>V(Me,{size:14,className:d(`text-primary-400 shrink-0`,e)}),bubble:e=>V(Ie,{size:6,fill:`currentColor`,className:d(`text-primary-500 shrink-0`,e)}),default:()=>null,number:()=>null};function Xt({variant:e=`default`,cols:t=1,dense:n=!1,children:r,className:i,...a}){let o=t!==void 0&&Number(t)>1,s=Yt[e],c=Gt({variant:e,cols:t,dense:n,isGrid:o,className:i});return e===`default`||e===`number`?V(e===`number`?`ol`:`ul`,{className:c,...a,children:r}):V(`ul`,{className:c,...a,children:k.map(r,t=>{if(!A(t))return t;let r=t,i=r.type===`li`?r.props.children:r.props.children||t;return V(Jt,{icon:s(),variant:e,dense:n,children:i})})})}const Zt={ts:u,tsx:i,js:n,jsx:i,json:le,css:ue,html:v,md:m,mdx:m,bash:r,sh:r,yaml:x,yml:x},q={CODE:/\.(ts|tsx|js|jsx|json|mjs|cjs|astro|vue|svelte)$/i,TEXT:/\.(md|mdx|txt)$/i,IMAGE:/\.(png|jpg|jpeg|svg|gif)$/i};function Qt(e){return typeof e==`string`?e:typeof e==`number`?e.toString():Array.isArray(e)?e.map(Qt).join(``):A(e)&&e.props&&typeof e.props==`object`&&`children`in e.props?Qt(e.props.children):``}function $t(e,t){let n=e.toLowerCase(),r=`shrink-0 transition-colors duration-200`;if(t)return V(Ge,{size:16,strokeWidth:2,className:d(r,`text-primary-400`),fill:`currentColor`,fillOpacity:.15});let i=Zt[n.split(`.`).pop()||``];if(i)return V(i,{size:16});let a=d(r,`text-text-dim group-hover:text-text-main`);return q.CODE.test(n)?V(Ve,{size:16,strokeWidth:2,className:a}):q.TEXT.test(n)?V(Ue,{size:16,strokeWidth:2,className:a}):q.IMAGE.test(n)?V(He,{size:16,strokeWidth:2,className:a}):V(Be,{size:16,strokeWidth:2,className:a})}function en(e,t){if(!A(e))return!1;let n=e.type;if(typeof n==`string`)return n===t;if(typeof n==`function`)return n.name===t||n.name?.toLowerCase()===t;let r=e.props;return r?.originalType===t||r?.mdxType===t}function tn(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function J(e,t=`root`){if(!A(e))return[];let n=[];if(en(e,`ul`))return k.forEach(e.props.children,(e,r)=>{n.push(...J(e,`${t}-${r}`))}),n;if(en(e,`li`)){let r=k.toArray(e.props.children),i=r.findIndex(e=>en(e,`ul`)),a=i!==-1,o=a?r.slice(0,i):r,s=a?r.slice(i):[],{name:c,comment:l}=tn(Qt(o)),u=c.endsWith(`/`),d=u?c.slice(0,-1):c,f=a||u;return n.push({id:`${t}-${d}`,name:d,comment:l,isFolder:f,children:a?J(s[0],`${t}-${d}`):void 0}),n}return e.props&&typeof e.props==`object`&&`children`in e.props&&k.forEach(e.props.children,(e,r)=>{n.push(...J(e,`${t}-${r}`))}),n}function nn({item:e}){return H(z.TreeItem,{id:e.id,textValue:e.name,className:`outline-none group focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md`,children:[V(z.TreeItemContent,{children:({isExpanded:t,hasChildItems:n})=>H(`div`,{className:`flex items-center gap-2 py-1 px-1.5 rounded-md transition-colors hover:bg-primary-500/5 cursor-pointer`,children:[V(`div`,{style:{width:`calc((var(--tree-item-level) - 1) * 1rem)`},className:`shrink-0`}),n?V(z.Button,{slot:`chevron`,className:`outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors`,children:V(Me,{size:14,strokeWidth:3,className:d(`transition-transform duration-200`,t&&`rotate-90`)})}):V(`div`,{className:`w-[18px]`}),$t(e.name,e.isFolder),V(`span`,{className:d(`text-sm transition-colors truncate select-none`,e.isFolder?`font-semibold text-text-main`:`text-text-muted group-hover:text-text-main`),children:e.name}),e.comment&&H(`span`,{className:`ml-2 text-xs italic text-text-dim opacity-70 group-hover:opacity-100 transition-opacity whitespace-nowrap overflow-hidden text-ellipsis font-sans`,children:[`//`,` `,e.comment]})]})}),e.children&&V(z.Collection,{items:e.children,children:e=>V(nn,{item:e})})]})}function rn({children:e}){let t=N(()=>J(e),[e]);return V(`div`,{className:`my-8`,children:V(z.Tree,{items:t,"aria-label":`File Tree`,className:d(`rounded-xl border border-border-subtle bg-bg-surface/50 p-4 font-mono text-sm shadow-sm backdrop-blur-sm outline-none`,`max-h-[500px] overflow-y-auto scrollbar-thin scrollbar-thumb-border-subtle`,`focus-visible:ring-2 focus-visible:ring-primary-500/20`),children:e=>V(nn,{item:e})})})}function an({data:e,sortable:t=!1,paginated:n=!1,pageSize:r=10}){let[i,a]=F(null),[o,s]=F(1),c=N(()=>{if(!e)return[];let n=[...e];return t&&i!==null&&n.sort((e,t)=>{let n=e[i.key],r=t[i.key],a=typeof n==`string`?n:``,o=typeof r==`string`?r:``;return a<o?i.direction===`asc`?-1:1:a>o?i.direction===`asc`?1:-1:0}),n},[e,i,t]);return{sortConfig:i,currentPage:o,setCurrentPage:s,totalPages:Math.ceil(c.length/r),paginatedData:N(()=>{if(!n)return c;let e=(o-1)*r;return c.slice(e,e+r)},[c,n,o,r]),requestSort:e=>{if(!t)return;let n=`asc`;i&&i.key===e&&i.direction===`asc`&&(n=`desc`),a({key:e,direction:n})}}}function on({headers:e,data:t,children:n,className:r=``,sortable:i=!1,paginated:a=!1,pageSize:o=10}){let{sortConfig:s,currentPage:c,setCurrentPage:l,totalPages:u,paginatedData:f,requestSort:p}=an({data:t,sortable:i,paginated:a,pageSize:o}),m=e=>i?s?.key===e?s.direction===`asc`?V(Ne,{size:14,className:`ml-1 text-primary-400`}):V(R,{size:14,className:`ml-1 text-primary-400`}):V(R,{size:14,className:`ml-1 opacity-30`}):null,h=n||H(B,{children:[e&&V(`thead`,{children:V(`tr`,{children:e.map((e,t)=>V(`th`,{onClick:()=>p(t),className:d(`text-left px-3 py-2.5 border-b-2 border-border-subtle text-text-main font-semibold text-sm`,i&&`cursor-pointer select-none hover:text-primary-400 transition-colors`),children:H(`div`,{className:`flex items-center`,children:[e,m(t)]})},t))})}),f&&V(`tbody`,{children:f.map((e,t)=>V(`tr`,{className:`transition-colors hover:bg-bg-surface`,children:e.map((e,t)=>V(`td`,{className:`px-3 py-2 border-b border-border-subtle text-sm text-text-muted`,children:e},t))},t))})]});return H(`div`,{className:d(`my-6 rounded-lg border border-border-subtle overflow-hidden`,r),children:[V(`div`,{className:`overflow-x-auto`,children:V(`table`,{className:`w-full border-collapse text-sm`,children:h})}),a&&u>1&&H(`div`,{className:`flex items-center justify-between border-t border-border-subtle px-4 py-3`,children:[H(`span`,{className:`text-xs text-text-muted`,children:[`Page `,c,` of `,u]}),H(`div`,{className:`flex items-center gap-1`,children:[V(z.Button,{onPress:()=>l(1),isDisabled:c===1,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:V(Pe,{size:16})}),V(z.Button,{onPress:()=>l(e=>Math.max(e-1,1)),isDisabled:c===1,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:V(je,{size:16})}),V(z.Button,{onPress:()=>l(e=>Math.min(e+1,u)),isDisabled:c===u,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:V(Me,{size:16})}),V(z.Button,{onPress:()=>l(u),isDisabled:c===u,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:V(Fe,{size:16})})]})]})]})}function sn({name:e,type:t,defaultValue:n,required:r=!1,children:i,id:a,className:o=``}){return H(`article`,{className:d(`group relative my-6 rounded-xl border border-border-subtle bg-bg-surface p-5 transition-all duration-300`,`hover:border-primary-500/30 hover:shadow-lg hover:shadow-primary-500/5`,o),id:a,children:[H(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4`,children:[H(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[V(`code`,{className:`inline-flex items-center rounded-md bg-primary-500/10 px-2.5 py-1 font-mono text-sm font-bold text-primary-400 border border-primary-500/20 shadow-sm transition-colors group-hover:bg-primary-500/15`,children:e}),t&&V(`span`,{className:`rounded-md bg-bg-muted/80 border border-border-subtle px-2 py-0.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider shadow-sm`,children:t}),r&&H(`div`,{className:`flex items-center gap-1.5 rounded-full bg-red-500/10 px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-red-400 border border-red-500/20 shadow-sm`,children:[V(`span`,{className:`h-1 w-1 rounded-full bg-red-400 animate-pulse`}),`Required`]})]}),n&&H(`div`,{className:`flex items-center gap-2 text-[11px] text-text-muted bg-bg-muted/30 px-2.5 py-1 rounded-md border border-border-subtle/50`,children:[V(`span`,{className:`font-semibold opacity-60 uppercase tracking-tighter`,children:`Default`}),V(`code`,{className:`font-mono text-text-main font-medium`,children:n})]})]}),V(`div`,{className:`text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30`,children:i})]})}function cn({to:e,children:t,className:n=``,...r}){let i=e&&(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`));return V(c,{href:e,className:d(`text-blue-600 hover:text-blue-800 hover:underline cursor-pointer`,n),target:i?`_blank`:void 0,rel:i?`noopener noreferrer`:void 0,...r,children:t})}function ln({src:e,alt:t,theme:n,...r}){let{theme:i}=W();return n&&n!==i?null:V(`img`,{src:e,alt:t||``,...r})}function un({title:e,props:t,className:n=``}){return H(`div`,{className:d(`my-6`,n),children:[e&&V(`h3`,{className:`text-base font-bold text-text-main mb-3`,children:e}),V(`div`,{className:`overflow-x-auto rounded-lg border border-border-subtle`,children:H(`table`,{className:`w-full border-collapse text-sm`,children:[V(`thead`,{children:H(`tr`,{children:[V(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Property`}),V(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Type`}),V(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Default`}),V(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Description`})]})}),V(`tbody`,{children:t.map((e,t)=>H(`tr`,{className:`transition-colors hover:bg-bg-surface`,children:[H(`td`,{className:`px-4 py-2.5 border-b border-border-subtle`,children:[V(`code`,{className:`rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400`,children:e.name}),e.required&&V(`span`,{className:`ml-1 text-red-400 font-bold`,children:`*`})]}),V(`td`,{className:`px-4 py-2.5 border-b border-border-subtle`,children:V(`code`,{className:`rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted`,children:e.type})}),V(`td`,{className:`px-4 py-2.5 border-b border-border-subtle`,children:e.defaultValue?V(`code`,{className:`rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400`,children:e.defaultValue}):V(`span`,{className:`text-text-dim`,children:`—`})}),V(`td`,{className:`px-4 py-2.5 border-b border-border-subtle text-text-muted`,children:e.description})]},`${e.name}-${t}`))})]})})]})}function dn(e){let{code:t,children:n,preview:r}=e;return{initialCode:N(()=>(t??(typeof n==`string`?n:``)).trim(),[t,n]),previewElement:N(()=>r??(typeof n==`string`?null:n),[r,n])}}function fn(e){let{highlightedHtml:t,hideCode:n=!1,hideCopy:r=!1}=e,{initialCode:i,previewElement:a}=dn(e);return H(`div`,{className:`my-6 overflow-hidden rounded-xl border border-border-subtle`,children:[V(`div`,{className:`flex items-center justify-center p-8 bg-bg-surface`,children:a}),!n&&V(`div`,{className:`border-t border-border-subtle`,children:V(G,{hideCopy:r,lang:`tsx`,highlightedHtml:t,plain:!0,children:i})})]})}const pn=e=>{let[t,n]=F(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function mn({content:t,mdxRaw:n,config:r}){let i=n||t||``,{copied:a,handleCopy:o,handleOpenRaw:s}=pn(i),c=r!==!1,l=typeof r==`object`&&r.text||`Copy Markdown`;return!c||!i?null:V(`div`,{className:`relative inline-flex z-100 flex-shrink-0 w-max translate-y-0 active:translate-y-px transition-transform duration-200`,children:H(_,{className:`rounded-xl border border-border-subtle bg-bg-surface/40 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:shadow-lg hover:shadow-primary-500/5 group overflow-hidden`,children:[V(e,{variant:`ghost`,onPress:o,icon:V(a?Ae:Re,{size:16}),iconPosition:`left`,className:d(`px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 border-none shrink-0`,`text-text-main transition-all duration-300 hover:bg-primary-500/5`,a&&`text-emerald-500 hover:bg-emerald-500/5`),children:a?`Copied!`:l}),H(T.Trigger,{placement:`bottom end`,children:[V(e,{variant:`ghost`,isIconOnly:!0,icon:V(R,{size:14}),className:d(`px-3.5 h-9 border-l border-border-subtle/50 text-text-muted rounded-none bg-transparent shrink-0`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`)}),H(T.Root,{className:`w-52`,children:[H(T.Item,{onAction:o,children:[V(Re,{size:16,className:`size-4 mt-0.5 text-text-muted group-hover:text-primary-500`}),V(`span`,{className:`font-medium text-[0.8125rem]`,children:`Copy Markdown`})]}),H(T.Item,{onAction:s,children:[V(ze,{size:16,className:`size-4 mt-0.5 text-text-muted group-hover:text-primary-500`}),V(`span`,{className:`font-medium text-[0.8125rem]`,children:`View as Markdown`})]})]})]})]})})}var hn=lt({Admonition:()=>K,Badge:()=>jt,Button:()=>bt,Card:()=>Pt,Cards:()=>Nt,Caution:()=>Wt,CodeBlock:()=>G,ComponentPreview:()=>fn,ComponentProps:()=>un,CopyMarkdown:()=>mn,Danger:()=>Vt,Field:()=>sn,FileTree:()=>rn,Image:()=>ln,Important:()=>Ut,InfoBox:()=>Ht,Link:()=>cn,List:()=>Xt,Note:()=>Rt,Tab:()=>Dt,Table:()=>on,Tabs:()=>Ot,Tip:()=>zt,Video:()=>kt,Warning:()=>Bt});function gn(){return V(`div`,{className:d(`w-full h-full relative overflow-y-auto transition-opacity duration-300 animate-fade-in`),children:H(`div`,{className:`mx-auto max-w-(--spacing-content-max) px-4 py-8 space-y-10`,children:[H(`div`,{className:`flex gap-2`,children:[V(C,{className:`h-3 w-16`}),V(C,{className:`h-3 w-24`})]}),V(C,{className:`h-10 w-[60%] sm:h-12`}),H(`div`,{className:`space-y-3`,children:[V(C,{className:`h-4 w-full`}),V(C,{className:`h-4 w-[95%]`}),V(C,{className:`h-4 w-[40%]`})]}),H(`div`,{className:`space-y-6 pt-4`,children:[V(C,{className:`h-7 w-32`}),H(`div`,{className:`space-y-3`,children:[V(C,{className:`h-4 w-full`}),V(C,{className:`h-4 w-[98%]`}),V(C,{className:`h-4 w-[92%]`}),V(C,{className:`h-4 w-[60%]`})]})]}),V(C,{className:`h-32 w-full rounded-lg bg-bg-muted/50`}),H(`div`,{className:`space-y-6 pt-4`,children:[V(C,{className:`h-7 w-48`}),H(`div`,{className:`space-y-3`,children:[V(C,{className:`h-4 w-full`}),V(C,{className:`h-4 w-[85%]`})]})]})]})})}const Y=({level:e,id:t,children:n,...r})=>H(`h${e}`,{id:t,...r,className:`boltdocs-heading`,children:[n,t&&V(`a`,{href:`#${t}`,className:`header-anchor`,"aria-label":`Anchor`,children:V(Xe,{size:16})})]}),_n={...hn,Loading:gn,h1:e=>V(Y,{level:1,...e}),h2:e=>V(Y,{level:2,...e}),h3:e=>V(Y,{level:3,...e}),h4:e=>V(Y,{level:4,...e}),h5:e=>V(Y,{level:5,...e}),h6:e=>V(Y,{level:6,...e}),pre:e=>V(G,{...e,children:e.children})};function vn(){let{currentLocale:e,config:t}=o();return M(()=>{if(!t.i18n)return;let n=t.i18n.localeConfigs?.[e];document.documentElement.lang=n?.htmlLang||e||`en`,document.documentElement.dir=n?.direction||`ltr`},[e,t.i18n]),null}function yn(){let e=L(),{config:t}=o(),n=f(e=>e.setLocale),r=f(e=>e.setVersion),i=f(e=>e.currentLocale),a=f(e=>e.currentVersion);return M(()=>{let o=e.pathname.split(`/`).filter(Boolean),s=0,c=t.versions?.defaultVersion,l=t.i18n?.defaultLocale;if(o[s]===`docs`&&s++,t.versions&&o.length>s){let e=t.versions.versions.find(e=>e.path===o[s]);e&&(c=e.path,s++)}t.i18n&&o.length>s&&t.i18n.locales[o[s]]?l=o[s]:t.i18n&&o.length===0&&(l=i||t.i18n.defaultLocale),l!==i&&n(l),c!==a&&r(c)},[e.pathname,t,n,r,i,a]),null}function bn({initialRoutes:e,initialConfig:n,docsDirName:r,modules:i,hot:a,homePage:o,externalPages:c,externalLayout:l,components:u={}}){let[d,f]=F(e),[p,m]=F(n),h=c||{},g=l||ot,_=N(()=>d.filter(e=>!(o&&(e.path===`/`||e.path===``))&&!h[e.path===``?`/`:e.path]).map(e=>{let t=Object.keys(i).find(t=>t===`/${r}/${e.filePath}`||t.endsWith(`/${r}/${e.filePath}`)||t.endsWith(`/${r}\\${e.filePath.replace(/\\/g,`/`)}`)),n=t?i[t]:null;return{...e,Component:O.lazy(async()=>n?await n():{default:ut})}}),[d,i,r,o,h]);M(()=>{a&&(a.on(`boltdocs:routes-update`,e=>{f(e)}),a.on(`boltdocs:config-update`,e=>{m(e)}))},[a]);let v=N(()=>({..._n,...st,...u}),[u]),y=v.Loading;return V(s,{children:V(ft,{children:V(vt,{components:v,children:V(t.Provider,{value:p,children:V(pt,{children:H(fe,{routes:d,modules:i,children:[V(mt,{}),V(yn,{}),V(vn,{}),H(Ce,{children:[V(I,{element:V(ht,{}),children:_.map(e=>V(I,{path:e.path===``?`/`:e.path,element:V(O.Suspense,{fallback:V(y,{}),children:V(yt,{Component:e.Component})})},e.path))},`docs-layout`),o&&H(B,{children:[V(I,{path:`/`,element:V(g,{children:V(o,{})})}),p.i18n&&Object.keys(p.i18n.locales).map(e=>V(I,{path:`/${e}`,element:V(g,{children:V(o,{})})},`home-${e}`))]}),Object.entries(h).map(([e,t])=>{let n=e===`/`?``:e;return H(O.Fragment,{children:[V(I,{path:e,element:V(g,{children:V(t,{})})}),p.i18n&&Object.keys(p.i18n.locales).map(r=>V(I,{path:`/${r}${n}`,element:V(g,{children:V(t,{})})},`${e}-${r}`))]},e)}),V(I,{path:`*`,element:V(ot,{children:V(ut,{})})})]})]})})})})})})}function xn(e){let{target:t,routes:n,docsDirName:r,config:i,modules:a,hot:o,homePage:s,externalPages:c,externalLayout:l,components:u}=e,d=document.querySelector(t);if(!d)throw Error(`[boltdocs] Mount target "${t}" not found in document.`);let f=V(O.StrictMode,{children:V(xe,{children:V(bn,{initialRoutes:n,initialConfig:i,docsDirName:r,modules:a,hot:o,homePage:s,externalPages:c,externalLayout:l,components:u})})});d.innerHTML=``,be(d).render(f)}function X(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function Sn(){let e=h(),{theme:t}=W(),n=L(),{currentLocale:r}=o(),i=e.theme||{},a=X(i.title,r)||`Boltdocs`,s=i.navbar||[],c=i.socialLinks||[],l=i.githubRepo,u=s.map(t=>{let i=t.href||t.to||t.link||``;return{label:X(t.label||t.text,r),href:i,active:(t=>{let r=n.pathname;if(r===t)return!0;if(!t||t===`/`)return r===`/`;let i=t=>{let n=t.split(`/`).filter(Boolean),r=0;return e.i18n?.locales&&n[r]&&e.i18n.locales[n[r]]&&r++,e.versions?.versions&&n[r]&&e.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},a=i(t),o=i(r);return a.length===0?o.length===0:o.length<a.length?!1:a.every((e,t)=>o[t]===e)})(i),to:i.startsWith(`http`)||i.startsWith(`//`)?`external`:void 0}}),d=i.logo;return{links:u,title:a,logo:d?typeof d==`string`?d:t===`dark`?d.dark:d.light:null,logoProps:{alt:(d&&typeof d==`object`?d.alt:void 0)||a,width:d&&typeof d==`object`?d.width:void 0,height:d&&typeof d==`object`?d.height:void 0},github:l?`https://github.com/${l}`:null,social:c,config:e,theme:t}}function Cn(e){let t=h(),n=L(),r=e=>e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e,i=r(n.pathname),a=e.find(e=>r(e.path)===i),o=a?.tab?.toLowerCase(),s=o?e.filter(e=>!e.tab||e.tab.toLowerCase()===o):e,c=[],l=new Map;for(let e of s)e.group?(l.has(e.group)||l.set(e.group,{slug:e.group,title:e.groupTitle||e.group,routes:[],icon:e.groupIcon}),l.get(e.group).routes.push(e)):c.push(e);return{groups:Array.from(l.values()),ungrouped:c,activeRoute:a,activePath:i,config:t}}function wn(e=[]){let[t,n]=F(null);return{headings:e,activeId:t,setActiveId:n}}function Tn(e=[],t=[]){let n=L(),r=P([]),[i,a]=F({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),o=t.find(e=>e.path===n.pathname)?.tab?.toLowerCase(),s=e.findIndex(e=>e.id.toLowerCase()===o),c=s===-1?0:s;return M(()=>{let e=r.current[c];e&&a({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[c,e.length,n.pathname]),{tabs:e,activeIndex:c,indicatorStyle:i,tabRefs:r,activeTabId:o}}function Z(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function En(){let e=Te(),t=o(),{allRoutes:n,currentRoute:r,currentVersion:i,currentLocale:a,config:s}=t,c=s.versions,l=f(e=>e.setVersion),u=t=>{if(!c||t===i)return;l(t);let o=`/docs/${t}`;if(r){let e=Z(r.filePath,r.version,r.locale),i=n.find(n=>Z(n.filePath,n.version,n.locale)===e&&(n.version||c.defaultVersion)===t&&(a?n.locale===a:!n.locale));if(i)o=i.path;else{let e=n.find(e=>Z(e.filePath,e.version,e.locale)===`index.md`&&(e.version||c.defaultVersion)===t&&(a?e.locale===a:!e.locale));o=e?e.path:`/docs/${t}${a?`/${a}`:``}`}}e(o)},d=t.availableVersions.map(e=>({...e,label:e.label,value:e.key}));return{currentVersion:i,currentVersionLabel:t.currentVersionLabel,availableVersions:d,handleVersionChange:u}}function Dn(){let e=Te(),{allRoutes:t,currentRoute:n,currentLocale:r,config:i}=o(),a=i.i18n,s=f(e=>e.setLocale);return{currentLocale:r,currentLocaleLabel:i.i18n?.localeConfigs?.[r]?.label||i.i18n?.locales[r]||r,availableLocales:i.i18n?Object.entries(i.i18n.locales).map(([e,t])=>({key:e,label:i.i18n?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===r})):[],handleLocaleChange:i=>{if(!a||i===r)return;s(i);let o=`/`;if(n){let e=Z(n.filePath,n.version,n.locale),r=t.find(t=>Z(t.filePath,t.version,t.locale)===e&&(t.locale||a.defaultLocale)===i&&t.version===n.version);if(r)o=r.path;else{let e=t.find(e=>Z(e.filePath,e.version,e.locale)===`index.md`&&(e.locale||a.defaultLocale)===i&&e.version===n.version);o=e?e.path:i===a.defaultLocale?n.version?`/${n.version}`:`/`:n.version?`/${n.version}/${i}`:`/${i}`}}else{let e=t.find(e=>(e.filePath===`index.mdx`||e.filePath===`index.md`)&&(e.locale||a.defaultLocale)===i&&!e.version);o=e?e.path:i===a.defaultLocale?`/`:`/${i}`}e(o)}}}function On(){let{routes:e,currentRoute:t}=o(),n=L();if(!t)return{prevPage:null,nextPage:null,currentRoute:null};let r=t.tab?.toLowerCase(),i=r?e.filter(e=>e.tab?.toLowerCase()===r):e.filter(e=>!e.tab),a=i.findIndex(e=>e.path===n.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:t}}function kn(){let{currentRoute:e}=o(),t=[];return e&&(e.groupTitle&&t.push({label:e.groupTitle}),t.push({label:e.title,href:e.path})),{crumbs:t,activeRoute:e}}const An=()=>L();function jn({children:e,className:t,style:n}){return V(`div`,{className:d(`h-screen flex flex-col overflow-hidden bg-bg-main text-text-main`,t),style:n,children:e})}function Mn({children:e,className:t,style:n}){return V(`div`,{className:d(`mx-auto flex flex-1 w-full max-w-(--breakpoint-3xl) bg-bg-main overflow-hidden`,t),style:n,children:e})}function Nn({children:e,className:t,style:n}){return V(`main`,{className:d(`boltdocs-content flex-1 min-w-0 overflow-y-auto`,`contain-layout`,t),style:n,children:e})}function Pn({children:e,className:t,style:n}){let{pathname:r}=An();return V(`div`,{className:d(`boltdocs-page mx-auto pt-4 pb-20 px-4 sm:px-8`,{"max-w-content-max":r.includes(`/docs/`)},t),style:n,children:e})}function Fn({children:e,className:t,style:n}){return V(`div`,{className:d(`flex items-center justify-between mb-10`,t),style:n,children:e})}function In({children:e,className:t,style:n}){return V(`div`,{className:d(`mt-20`,t),style:n,children:e})}const Q=Object.assign(jn,{Body:Mn,Content:Nn,ContentMdx:Pn,ContentHeader:Fn,ContentFooter:In});function Ln(){let{theme:e,setTheme:t}=W(),[n,r]=F(!1);if(M(()=>{r(!0)},[]),!n)return V(`div`,{className:`h-9 w-9`});let i=e===`system`?Ze:e===`dark`?Qe:tt;return H(T.Trigger,{placement:`bottom right`,children:[V(it,{className:`flex h-9 w-9 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-bg-surface hover:text-text-main outline-none focus-visible:ring-2 focus-visible:ring-primary-500`,"aria-label":`Selection theme`,children:V(i,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),H(T.Root,{selectionMode:`single`,selectedKeys:[e],onSelectionChange:e=>{let n=Array.from(e)[0];t(n)},children:[H(T.Item,{id:`light`,children:[V(tt,{size:16}),V(`span`,{children:`Light`})]}),H(T.Item,{id:`dark`,children:[V(Qe,{size:16}),V(`span`,{children:`Dark`})]}),H(T.Item,{id:`system`,children:[V(Ze,{size:16}),V(`span`,{children:`System`})]})]})]})}async function Rn(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:zn(i.stargazers_count)}const zn=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function Bn({repo:e}){let[t,n]=F(null);return M(()=>{e&&Rn(e).then(e=>n(e)).catch(()=>n(`0`))},[e]),H(`a`,{href:`https://github.com/${e}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-muted transition-all hover:bg-bg-main hover:border-border-strong hover:text-text-main`,children:[V(p,{className:`h-4 w-4`}),t&&V(`span`,{className:`tabular-nums`,children:t})]})}function Vn({tabs:e,routes:t}){let{currentLocale:n}=o(),{indicatorStyle:r,tabRefs:i,activeIndex:a}=Tn(e,t),s=e=>{if(!e)return null;if(e.trim().startsWith(`<svg`))return V(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:e}});let t=Ee[e];return t?V(t,{size:16}):V(`img`,{src:e,alt:``,className:`h-4 w-4 object-contain`})};return V(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6`,children:H(y.List,{className:`border-none py-0`,children:[e.map((e,r)=>{let o=r===a,l=t.find(t=>t.tab&&t.tab.toLowerCase()===e.id.toLowerCase());return H(c,{href:l?l.path:`#`,ref:e=>{i.current[r]=e},className:`relative flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors outline-none ${o?`text-primary-500`:`text-text-muted hover:text-text-main`}`,children:[s(e.icon),V(`span`,{children:X(e.text,n)})]},e.id)}),V(y.Indicator,{style:r})]})})}const Hn=ge(()=>import(`../search-dialog-BeNyI_KQ.mjs`).then(e=>({default:e.SearchDialog})));function Un(){let{links:e,title:t,logo:n,logoProps:r,github:i,social:a,config:s}=Sn(),{routes:c,allRoutes:l,currentVersion:u,currentLocale:d}=o(),{pathname:f}=L(),p=s.theme||{},m=f.startsWith(`/docs`),h=p?.tabs&&p.tabs.length>0;return H(D.Root,{className:h?`border-b-0`:``,children:[H(D.Content,{children:[H(D.Left,{children:[n&&V(D.Logo,{src:n,alt:r?.alt||t,width:r?.width??24,height:r?.height??24}),V(D.Title,{children:t}),s.versions&&u&&V(Gn,{})]}),V(D.Center,{children:V(me,{fallback:V(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-bg-surface`}),children:V(Hn,{routes:c||[]})})}),H(D.Right,{children:[V(D.Links,{children:e.map(e=>V(B,{children:V(Wn,{link:e},e.href)}))}),s.i18n&&d&&V(Kn,{}),V(D.Split,{}),V(Ln,{}),i&&V(Bn,{repo:p?.githubRepo??``}),a.length>0&&V(D.Split,{}),V(`div`,{className:`flex items-center gap-1`,children:a.map(({icon:e,link:t})=>V(D.Socials,{icon:e,link:t,className:`p-1.5`},t))})]})]}),m&&h&&p?.tabs&&V(`div`,{className:`w-full border-b border-border-subtle bg-bg-main`,children:V(Vn,{tabs:p.tabs,routes:l||c||[]})})]})}function Wn({link:e}){let t=a(e.href||``);return V(D.Link,{...e,href:t})}function Gn(){let{currentVersionLabel:t,availableVersions:n,handleVersionChange:r}=En();return n.length===0?null:H(T.Trigger,{children:[V(e,{variant:`outline`,size:`sm`,rounded:`lg`,iconPosition:`right`,icon:V(R,{className:`w-3.5 h-3.5 text-text-muted/60`}),className:`h-8 border-border-subtle/60 bg-bg-surface/30 backdrop-blur-sm transition-all duration-200 hover:border-primary-500/50 hover:bg-primary-500/5`,children:V(`span`,{className:`font-semibold text-[0.8125rem]`,children:t})}),V(T.Root,{children:V(T.Section,{items:n,children:e=>V(T.Item,{onPress:()=>r(e.value),children:e.label},`${e.value??``}`)})})]})}function Kn(){let{currentLocale:t,availableLocales:n,handleLocaleChange:r}=Dn();return n.length===0?null:H(T.Trigger,{children:[V(e,{variant:`outline`,size:`sm`,rounded:`lg`,iconPosition:`right`,icon:V(R,{className:`w-3.5 h-3.5 text-text-muted/60`}),className:`h-8 border-border-subtle/60 bg-bg-surface/30 backdrop-blur-sm transition-all duration-200 hover:border-primary-500/50 hover:bg-primary-500/5 px-2.5`,children:H(`div`,{className:`flex items-center gap-1.5`,children:[V(Je,{className:`w-3.5 h-3.5 text-primary-500`}),V(`span`,{className:`font-bold text-[0.75rem] tracking-wider uppercase opacity-90`,children:t||`en`})]})}),V(T.Root,{children:V(T.Section,{items:n,children:e=>V(T.Item,{onPress:()=>r(e.value),children:H(`div`,{className:`flex items-center justify-between w-full gap-4`,children:[V(`span`,{children:e.label}),V(`span`,{className:`text-[10px] font-bold opacity-40 uppercase tracking-tighter`,children:e.value})]})},`${e.value??``}`)})})]})}function qn(){return V(`div`,{className:`flex items-center justify-center mt-10 mb-4 px-4 w-full`,children:H(`a`,{href:`https://github.com/jesusalcaladev/boltdocs`,target:`_blank`,rel:`noopener noreferrer`,className:`group relative flex items-center gap-2 px-4 py-2 rounded-full border border-border-subtle bg-bg-surface/50 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:bg-bg-surface hover:shadow-xl hover:shadow-primary-500/5 select-none`,children:[V(rt,{className:`w-3.5 h-3.5 text-text-muted group-hover:text-primary-500 transition-colors duration-300`,fill:`currentColor`}),H(`span`,{className:`text-[11px] font-medium text-text-muted group-hover:text-text-main transition-colors duration-300 tracking-wide`,children:[`Powered by`,` `,V(`strong`,{className:`font-bold text-text-main/80 group-hover:text-text-main`,children:`Boltdocs`})]})]})})}function Jn(e){if(e)return Ee[e]||void 0}function Yn({group:e,activePath:t,getIcon:n}){let r=N(()=>e.routes.some(e=>e.path===t),[e.routes,t]),[i,a]=F(!0);return M(()=>{r&&a(!0)},[r]),V(E.Group,{title:e.title,isOpen:i,onToggle:()=>a(!i),children:e.routes.map(e=>{let r=t===(e.path.endsWith(`/`)?e.path.slice(0,-1):e.path);return V(E.Link,{label:e.title,href:e.path,active:r,icon:n(e.icon),badge:e.badge},e.path)})})}function Xn({routes:e,config:t}){let{groups:n,ungrouped:r,activePath:i}=Cn(e),a=t.theme||{};return H(E.Root,{children:[r.length>0&&V(E.Group,{className:`mb-6`,children:r.map(e=>{let t=i===(e.path.endsWith(`/`)?e.path.slice(0,-1):e.path);return V(E.Link,{label:e.title,href:e.path,active:t,icon:Jn(e.icon),badge:e.badge},e.path)})}),n.map(e=>V(Yn,{group:e,activePath:i,getIcon:Jn},e.slug)),a?.poweredBy&&V(`div`,{className:`mt-auto pt-8`,children:V(qn,{})})]})}function Zn({headings:e=[],editLink:t,communityHelp:n,filePath:r}){let{headings:i}=wn(e),a=O.useMemo(()=>i.map(e=>({title:e.text,url:`#${e.id}`,depth:e.level})),[i]);return i.length===0?null:V(ce,{toc:a,children:V(Qn,{headings:i,editLink:t,communityHelp:n,filePath:r})})}function Qn({headings:e,editLink:t,communityHelp:n,filePath:r}){let i=oe(),[a,o]=F({opacity:0}),s=P(null),c=P(null);M(()=>{if(!i||!s.current)return;let e=s.current.querySelector(`a[href="#${i}"]`);e&&o({transform:`translateY(${e.offsetTop}px)`,height:`${e.offsetHeight}px`,opacity:1})},[i]);let l=j((e,t)=>{e.preventDefault();let n=document.getElementById(t);n&&(n.scrollIntoView({behavior:`smooth`}),window.history.pushState(null,``,`#${t}`))},[]);return H(b.Root,{children:[H(b.Header,{className:`flex flex-row gap-x-2`,children:[V(nt,{size:16}),`On this page`]}),V(ee,{containerRef:c,children:H(b.Content,{className:`max-h-[450px] boltdocs-otp-scroll-area`,ref:c,children:[V(b.Indicator,{style:a}),V(`ul`,{className:`relative space-y-2 border-l border-border-subtle`,ref:s,children:e.map(e=>V(b.Item,{level:e.level,children:V(b.Link,{href:`#${e.id}`,active:i===e.id,onClick:t=>l(t,e.id),className:`pl-4`,children:e.text})},e.id))})]})}),(t||n)&&H(`div`,{className:`mt-8 pt-8 border-t border-border-subtle space-y-4`,children:[V(`p`,{className:`text-xs font-bold uppercase tracking-wider text-text-main`,children:`Need help?`}),H(`ul`,{className:`space-y-3`,children:[t&&r&&V(`li`,{children:H(`a`,{href:t.replace(`:path`,r),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors`,children:[V($e,{size:16}),`Edit this page`]})}),n&&V(`li`,{children:H(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors`,children:[V(Le,{size:16}),`Community help`]})})]})]})]})}function $n({siteTitle:e,siteDescription:t,routes:n}){let r=L();return M(()=>{let i=n.find(e=>e.path===r.pathname),a=i?.title,o=i?.description||t||``;document.title=a?`${a} | ${e}`:e;let s=document.querySelector(`meta[name="description"]`);s||(s=document.createElement(`meta`),s.name=`description`,document.head.appendChild(s)),s.content=o,$(`property`,`og:title`,document.title),$(`property`,`og:description`,o),$(`property`,`og:type`,`article`),$(`property`,`og:url`,window.location.href),$(`name`,`twitter:card`,`summary`),$(`name`,`twitter:title`,document.title),$(`name`,`twitter:description`,o);let c=document.querySelector(`link[rel="canonical"]`);c||(c=document.createElement(`link`),c.rel=`canonical`,document.head.appendChild(c)),c.href=window.location.origin+r.pathname},[r.pathname,e,t,n]),null}function $(e,t,n){let r=document.querySelector(`meta[${e}="${t}"]`);r||(r=document.createElement(`meta`),r.setAttribute(e,t),document.head.appendChild(r)),r.content=n}function er(){let{crumbs:e,activeRoute:t}=kn(),n=h().theme||{};return e.length===0||!n?.breadcrumbs?null:H(w.Root,{children:[V(w.Item,{children:V(w.Link,{href:`/`,children:V(Ke,{size:14})})}),e.map((e,n)=>H(w.Item,{children:[V(w.Separator,{}),V(w.Link,{href:e.href,className:d({"font-medium text-text-main":e.href===t?.path}),children:e.label})]},`crumb-${e.href}-${e.label}-${n}`))]})}function tr(){let{prevPage:e,nextPage:t}=On();return!e&&!t?null:H(S.Root,{className:`animate-in fade-in slide-in-from-bottom-4 duration-700`,children:[e?H(S.Link,{to:e.path,direction:`prev`,children:[V(S.Title,{children:`Previous`}),V(S.Description,{children:e.title})]}):V(`div`,{}),t&&H(S.Link,{to:t.path,direction:`next`,children:[V(S.Title,{children:`Next`}),V(S.Description,{children:t.title})]})]})}var nr=class extends pe{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`Uncaught error in Boltdocs Layout:`,e,t)}render(){return this.state.hasError?this.props.fallback||H(`div`,{className:`flex flex-col items-center justify-center min-h-[40vh] text-center gap-4 px-4`,children:[V(`div`,{className:`text-lg font-bold text-red-400`,children:`Something went wrong`}),V(`p`,{className:`text-sm text-text-muted max-w-md`,children:this.state.error?.message||`An unexpected error occurred while rendering this page.`}),V(e,{className:`rounded-lg border border-border-subtle bg-bg-surface px-5 py-2 text-sm font-medium text-text-main transition-colors hover:bg-bg-muted cursor-pointer`,onPress:()=>this.setState({hasError:!1}),children:`Try again`})]}):this.props.children}};function rr({children:e}){let{routes:t,allRoutes:n,currentRoute:r,currentLocale:i}=o(),{pathname:a}=L(),s=h(),c=_t().CopyMarkdown||mn,l=a.startsWith(`/docs`);return H(Q,{children:[V($n,{siteTitle:X(s.theme?.title,i)||`Boltdocs`,siteDescription:X(s.theme?.description,i)||``,routes:n}),V(Un,{}),H(Q.Body,{children:[l&&V(Xn,{routes:t,config:s}),V(Q.Content,{children:H(Q.ContentMdx,{children:[l&&H(Q.ContentHeader,{children:[V(er,{}),V(c,{mdxRaw:r?._rawContent,route:r,config:s.theme?.copyMarkdown})]}),V(nr,{children:e}),l&&V(Q.ContentFooter,{children:V(tr,{})})]})}),l&&V(Zn,{headings:r?.headings,editLink:s.theme?.editLink,communityHelp:s.theme?.communityHelp,filePath:r?.filePath})]})]})}export{K as Admonition,ce as AnchorProvider,jt as Badge,er as Breadcrumbs,bt as Button,_ as ButtonGroup,Pt as Card,Nt as Cards,Wt as Caution,G as CodeBlock,fn as ComponentPreview,un as ComponentProps,mn as CopyMarkdown,Vt as Danger,rr as DefaultLayout,Q as DocsLayout,nr as ErrorBoundary,sn as Field,rn as FileTree,$n as Head,ln as Image,Ut as Important,Ht as InfoBox,cn as Link,Xt as List,gn as Loading,Un as Navbar,ut as NotFound,Rt as Note,Zn as OnThisPage,tr as PageNav,w as PrimitiveBreadcrumbs,e as PrimitiveButton,c as PrimitiveLink,T as PrimitiveMenu,l as PrimitiveNavLink,D as PrimitiveNavbar,g as PrimitiveNavigationMenu,b as PrimitiveOnThisPage,S as PrimitivePageNav,re as PrimitivePopover,E as PrimitiveSidebar,C as PrimitiveSkeleton,y as PrimitiveTabs,de as PrimitiveTooltip,ee as ScrollProvider,te as SearchDialogPrimitive,Xn as Sidebar,Dt as Tab,on as Table,Ot as Tabs,zt as Tip,kt as Video,Bt as Warning,d as cn,xn as createBoltdocsApp,oe as useActiveAnchor,ae as useActiveAnchors,kn as useBreadcrumbs,h as useConfig,Dn as useI18n,ne as useItems,a as useLocalizedTo,An as useLocation,_t as useMdxComponents,Sn as useNavbar,wn as useOnThisPage,On as usePageNav,o as useRoutes,se as useSearch,Cn as useSidebar,Tn as useTabs,W as useTheme,En as useVersion};
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});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-dom/server`);u=c(u);let d=require(`react-router-dom/server.js`);require(`react-dom/client`);let f=require(`react-router-dom`),p=require(`lucide-react`),m=require(`react-aria-components`);m=c(m);let h=require(`react/jsx-runtime`),g=require(`clsx`),_=require(`tailwind-merge`),v=require(`virtual:boltdocs-layout`);v=c(v);let y=require(`class-variance-authority`),b=require(`virtual:boltdocs-mdx-components`);b=c(b);const x=(0,l.createContext)(null);function S(){let e=(0,l.use)(x);if(!e)throw Error(`useConfig must be used within a ConfigProvider`);return e}const C=(0,l.createContext)({preload:()=>{},routes:[]});function ee(){return(0,l.use)(C)}function te({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,h.jsx)(C.Provider,{value:{preload:i,routes:e},children:n})}const w=(0,l.createContext)(void 0),T=`boltdocs-storage`;function ne(){try{let e=localStorage.getItem(T);if(e){let t=JSON.parse(e);return t?.state||t}}catch{}return{}}function re({children:e}){let t=ne(),[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(T,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,h.jsx)(w.Provider,{value:c,children:e})}function ie(){let e=(0,l.useContext)(w);if(!e)throw Error(`useBoltdocsContext must be used within a BoltdocsProvider`);return e}function E(e){return e(ie())}function D(){let{routes:e}=ee(),t=S(),n=(0,f.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}),u=t.i18n?.localeConfigs?.[s]?.label||t.i18n?.locales[s]||s,d=t.versions?.versions.find(e=>e.path===c)?.label||c;return{routes:l,allRoutes:e,currentRoute:o,currentLocale:s,currentLocaleLabel:u,availableLocales:t.i18n?Object.entries(t.i18n.locales).map(([e,n])=>({key:e,label:t.i18n?.localeConfigs?.[e]?.label||n,isCurrent:e===s})):[],currentVersion:c,currentVersionLabel:d,availableVersions:t.versions?t.versions.versions.map(e=>({key:e.path,label:e.label,isCurrent:e.path===c})):[],config:t}}function O(e){let t=S(),{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,_.twMerge)((0,g.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}=ee(),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,h.jsx)(m.Link,{...o,ref:t,href:s,onMouseEnter:l,onFocus:u})});A.displayName=`Link`;const ae=l.default.forwardRef((e,t)=>{let{href:n,end:r=!1,className:i,children:a,...o}=e,s=(0,f.useLocation)(),c=O(n??``),l=r?s.pathname===c:s.pathname.startsWith(c),u=typeof i==`function`?i({isActive:l}):k(i,l&&`active`),d=typeof a==`function`?a({isActive:l}):a;return(0,h.jsx)(A,{...o,ref:t,href:n,className:u,children:d})});ae.displayName=`NavLink`;function oe(){return(0,h.jsx)(`div`,{className:`flex items-center justify-center min-h-[60vh] text-center`,children:(0,h.jsxs)(`div`,{className:`space-y-4`,children:[(0,h.jsx)(`span`,{className:`text-8xl font-black tracking-tighter text-primary-500/20`,children:`404`}),(0,h.jsx)(`h1`,{className:`text-2xl font-bold text-text-main`,children:`Page Not Found`}),(0,h.jsx)(`p`,{className:`text-sm text-text-muted max-w-sm mx-auto`,children:`The page you're looking for doesn't exist or has been moved.`}),(0,h.jsxs)(A,{href:`/`,className:`inline-flex items-center gap-2 rounded-lg bg-primary-500 px-5 py-2.5 text-sm font-semibold text-white outline-none transition-all hover:brightness-110 hover:shadow-lg focus-visible:ring-2 focus-visible:ring-primary-500/30`,children:[(0,h.jsx)(p.ArrowLeft,{size:16}),` Go to Home`]})]})})}const se=(0,l.createContext)(void 0);function ce({children:e}){let[t,n]=(0,l.useState)(`system`),[r,i]=(0,l.useState)(`dark`),[a,o]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{o(!0);let e=localStorage.getItem(`boltdocs-theme`),t=e===`light`||e===`dark`||e===`system`?e:`system`;n(t);let r=window.matchMedia(`(prefers-color-scheme: dark)`);((e,t)=>{i(e===`system`?t?`dark`:`light`:e)})(t,r.matches);let a=e=>{i(t=>(localStorage.getItem(`boltdocs-theme`)||`system`)===`system`?e.matches?`dark`:`light`:t)};return r.addEventListener(`change`,a),()=>r.removeEventListener(`change`,a)},[]),(0,l.useEffect)(()=>{if(!a)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`).matches,n=t===`system`?e?`dark`:`light`:t;i(n);let r=document.documentElement;n===`light`?(r.classList.add(`theme-light`),r.dataset.theme=`light`):(r.classList.remove(`theme-light`),r.dataset.theme=`dark`)},[t,a]),(0,h.jsx)(se.Provider,{value:{theme:t,resolvedTheme:r,setTheme:e=>{n(e),localStorage.setItem(`boltdocs-theme`,e)}},children:e})}function le(){let e=(0,l.use)(se);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e}function ue({children:e}){let t=(0,f.useNavigate)();return(0,h.jsx)(m.RouterProvider,{navigate:(e,n)=>{(0,l.startTransition)(()=>{t(e,n)})},useHref:f.useHref,children:e})}function de(){let{pathname:e,hash:t}=(0,f.useLocation)();return(0,l.useLayoutEffect)(()=>{let e=document.querySelector(`.boltdocs-content`)||window,n=()=>e===window?window.scrollY:e.scrollTop,r=(t,n=`auto`)=>{e===window?window.scrollTo({top:t,behavior:n}):e.scrollTo({top:t,behavior:n})};if(t){let i=t.replace(`#`,``),a=document.getElementById(i);if(a){let t=e===window?0:e.getBoundingClientRect().top;r(a.getBoundingClientRect().top-t-80+n(),`smooth`);return}}r(0)},[e,t]),null}function fe(){return(0,h.jsx)(v.default,{children:(0,h.jsx)(f.Outlet,{})})}const pe=(0,l.createContext)({});function me(){return(0,l.use)(pe)}function he({components:e,children:t}){return(0,h.jsx)(pe.Provider,{value:e,children:t})}function ge({Component:e}){return(0,h.jsx)(e,{components:me()})}const j=(0,y.cva)(`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`}}),M=({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?(0,h.jsx)(`span`,{className:`inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]`,children:t}):(0,h.jsxs)(h.Fragment,{children:[t&&n===`left`&&(0,h.jsx)(`span`,{className:`inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]`,children:t}),(0,h.jsx)(`span`,{className:`flex items-center`,children:i}),t&&n===`right`&&(0,h.jsx)(`span`,{className:`inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]`,children:t})]});return e?(0,h.jsx)(m.Link,{href:e,className:k(j({variant:o,size:s,rounded:c,iconSize:f?l:void 0,disabled:u}),a),...d,children:p}):(0,h.jsx)(m.Button,{className:k(j({variant:o,size:s,rounded:c,iconSize:f?l:void 0,disabled:u}),a),...d,children:p})},_e=({className:e,variant:t,size:n,rounded:r,iconSize:i,disabled:a,...o})=>(0,h.jsx)(M,{className:k(`group`,j({variant:t,size:n,rounded:r,iconSize:i,disabled:a,className:e})),...o}),ve=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);return t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t),!0}};function ye(e){let{title:t}=e,[n,r]=(0,l.useState)(!1),[i,a]=(0,l.useState)(!1),[o,s]=(0,l.useState)(!1),c=(0,l.useRef)(null);S();let u=(0,l.useCallback)(async()=>{ve(c.current?.textContent??``),r(!0),setTimeout(()=>r(!1),2e3)},[]);return(0,l.useEffect)(()=>{s((c.current?.textContent?.length??0)>120)},[e.children,e.highlightedHtml]),{copied:n,isExpanded:i,setIsExpanded:a,isExpandable:o,preRef:c,handleCopy:u,shouldTruncate:o&&!i}}function N(e){let{size:t=20,...n}=e;return{...n,width:t,height:t}}const P=e=>(0,h.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...N(e),children:[(0,h.jsx)(`title`,{children:`TypeScript`}),(0,h.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`})]}),F=e=>(0,h.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...N(e),children:[(0,h.jsx)(`title`,{children:`JavaScript`}),(0,h.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`})]}),I=e=>(0,h.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...N(e),children:[(0,h.jsx)(`title`,{children:`JSON`}),(0,h.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`})]}),L=e=>(0,h.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...N(e),children:[(0,h.jsx)(`title`,{children:`CSS`}),(0,h.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`})]}),be=e=>(0,h.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...N(e),children:[(0,h.jsx)(`title`,{children:`HTML`}),(0,h.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`})]}),R=e=>(0,h.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...N(e),children:[(0,h.jsx)(`title`,{children:`React`}),(0,h.jsx)(`path`,{fill:`#0E8ADC`,d:`M12 13.677a1.677 1.677 0 100-3.354 1.677 1.677 0 000 3.354z`}),(0,h.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,h.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,h.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`})]}),z=e=>(0,h.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...N(e),children:[(0,h.jsx)(`title`,{children:`Markdown`}),(0,h.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`})]}),B=e=>(0,h.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...N(e),children:[(0,h.jsx)(`title`,{children:`Shell`}),(0,h.jsx)(`path`,{stroke:`#14B8A6`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M4.336 17l6-6-6-6M12.336 19h8`})]}),V=e=>(0,h.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...N(e),children:[(0,h.jsx)(`title`,{children:`YAML`}),(0,h.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`})]}),H=({className:e,children:t,...n})=>(0,h.jsx)(m.Tooltip,{...n,offset:8,className:t=>k(`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=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.OverlayArrow,{children:(0,h.jsxs)(`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:[(0,h.jsx)(`title`,{children:`Arrow`}),(0,h.jsx)(`path`,{d:`M0 0 L4 4 L8 0`})]})}),typeof t==`function`?t(e):t]})}),U=({content:e,children:t,delay:n=500,closeDelay:r=0,...i})=>(0,h.jsxs)(m.TooltipTrigger,{delay:n,closeDelay:r,children:[t,(0,h.jsx)(H,{...i,children:e})]});U.Root=U,U.Content=H;const xe={ts:P,tsx:R,js:F,jsx:R,json:I,css:L,html:be,md:z,mdx:z,bash:B,sh:B,yaml:V,yml:V};function W(e){let{children:t,hideCopy:n=!1,highlightedHtml:r,"data-highlighted-html":i,title:a,"data-lang":o,plain:s=!1,...c}=e,l=r||i;S();let u=e.lang||o||``,{copied:d,isExpanded:f,setIsExpanded:g,isExpandable:_,preRef:v,handleCopy:y,shouldTruncate:b}=ye(e),x=xe[u];return(0,h.jsxs)(`div`,{className:k(`group relative overflow-hidden bg-(--color-code-bg)`,`contain-layout contain-paint`,{"my-6 rounded-lg border border-border-subtle":!s,"[&>pre]:max-h-62.5 [&>pre]:overflow-hidden":b},e.className),children:[a&&(0,h.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border-subtle bg-bg-surface/50 px-4 py-2 text-[13px] font-medium text-text-muted`,children:[x?(0,h.jsx)(x,{size:14}):(0,h.jsx)(p.File,{size:14,className:`opacity-60`}),(0,h.jsx)(`span`,{children:a})]}),(0,h.jsx)(`div`,{className:`absolute top-3 right-4 z-50 flex items-center gap-2 transition-all duration-300 opacity-0 group-hover:opacity-100`,children:!n&&(0,h.jsx)(U,{content:d?`Copied!`:`Copy code`,children:(0,h.jsx)(m.Button,{onPress:y,className:k(`grid place-items-center size-8 bg-transparent outline-none cursor-pointer transition-all duration-200 hover:scale-110 active:scale-95 [&>svg]:size-4 [&>svg]:stroke-2`,d?`text-emerald-400`:`text-text-muted hover:text-text-main`),"aria-label":`Copy code`,children:d?(0,h.jsx)(p.Check,{size:20}):(0,h.jsx)(p.Copy,{size:20})})})}),l?(0,h.jsx)(`div`,{ref:v,className:`shiki-wrapper [&>pre]:m-0! [&>pre]:rounded-none! [&>pre]:border-none! [&>pre]:bg-inherit! [&>pre>code]:grid! [&>pre>code]:p-5! [&>.shiki.shiki-themes]:bg-transparent!`,dangerouslySetInnerHTML:{__html:l}}):(0,h.jsx)(`pre`,{ref:v,className:`m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]`,...c,children:t}),_&&(0,h.jsx)(`div`,{className:k(b?`absolute bottom-0 inset-x-0 h-24 bg-linear-to-t from-(--color-code-bg) to-transparent flex items-end justify-center pb-4 z-10`:`relative flex justify-center py-4`),children:(0,h.jsx)(m.Button,{onPress:()=>g(!f),className:`rounded-full bg-bg-surface border border-border-subtle px-5 py-2 text-[0.8125rem] font-medium text-text-main outline-none cursor-pointer transition-all hover:bg-border-subtle hover:-translate-y-px backdrop-blur-md`,children:f?`Show less`:`Expand code`})})]})}function Se({initialIndex:e=0,tabs:t}){let n=t[e]?.props.disabled?t.findIndex(e=>!e.props.disabled):e,[r,i]=(0,l.useState)(n===-1?0:n),a=(0,l.useRef)([]),[o,s]=(0,l.useState)({opacity:0,transform:`translateX(0)`,width:0});return(0,l.useEffect)(()=>{let e=a.current[r];e&&s({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[r,t]),{active:r,setActive:i,tabRefs:a,indicatorStyle:o,handleKeyDown:(0,l.useCallback)(e=>{let n=0;if(e.key===`ArrowRight`?n=1:e.key===`ArrowLeft`&&(n=-1),n!==0){let e=(r+n+t.length)%t.length;for(;t[e].props.disabled&&e!==r;)e=(e+n+t.length)%t.length;e!==r&&!t[e].props.disabled&&(i(e),a.current[e]?.focus())}},[r,t])}}const Ce=(0,y.cva)(`relative flex items-center border-b border-border-subtle gap-1 overflow-x-auto no-scrollbar`,{variants:{size:{default:`px-0`,compact:`px-2`}},defaultVariants:{size:`default`}}),we=(0,y.cva)(`flex items-center gap-2 px-4 py-2.5 text-sm font-medium outline-none transition-all duration-200 cursor-pointer bg-transparent border-none select-none whitespace-nowrap`,{variants:{isActive:{true:`text-primary-500`,false:`text-text-muted hover:text-text-main`},isDisabled:{true:`opacity-40 pointer-events-none`,false:``}},defaultVariants:{isActive:!1,isDisabled:!1}});function Te({children:e}){return(0,h.jsx)(`div`,{className:`py-4`,children:typeof e==`string`?(0,h.jsx)(W,{className:`language-bash`,children:(0,h.jsx)(`code`,{children:e.trim()})}):e})}function Ee({defaultIndex:e=0,children:t}){let n=(0,l.useMemo)(()=>l.Children.toArray(t).filter(e=>(0,l.isValidElement)(e)&&e.props?.label),[t]),{active:r,setActive:i,tabRefs:a,indicatorStyle:o}=Se({initialIndex:e,tabs:n});return(0,h.jsx)(`div`,{className:`my-8 w-full group/tabs`,children:(0,h.jsxs)(m.Tabs,{selectedKey:r.toString(),onSelectionChange:e=>i(Number(e)),className:`w-full`,children:[(0,h.jsxs)(m.TabList,{"aria-label":`Content Tabs`,className:k(Ce()),children:[n.map((e,t)=>{let{label:n,icon:r,disabled:i}=e.props,o=t.toString();return(0,h.jsxs)(m.Tab,{id:o,isDisabled:i,ref:e=>{a.current[t]=e},className:({isSelected:e,isDisabled:t})=>k(we({isActive:e,isDisabled:t})),children:[!!r&&(0,h.jsx)(`span`,{className:`shrink-0 [&>svg]:w-4 [&>svg]:h-4`,children:r}),(0,h.jsx)(`span`,{children:n})]},o)}),(0,h.jsx)(`div`,{className:`absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none`,style:o,"aria-hidden":`true`})]}),n.map((e,t)=>(0,h.jsx)(m.TabPanel,{id:t.toString(),children:n[t]},t))]})})}function De({src:e,poster:t,alt:n,children:r,controls:i,preload:a=`metadata`,...o}){let s=(0,l.useRef)(null),[c,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=s.current;if(!e)return;let t=new IntersectionObserver(([e])=>{e.isIntersecting&&(u(!0),t.disconnect())},{rootMargin:`200px`});return t.observe(e),()=>t.disconnect()},[]),(0,h.jsx)(`div`,{ref:s,className:`my-6 overflow-hidden rounded-lg border border-border-subtle`,children:c?(0,h.jsxs)(`video`,{className:`block w-full h-auto`,src:e,poster:t,controls:!0,preload:a,playsInline:!0,...o,children:[r,`Your browser does not support the video tag.`]}):(0,h.jsx)(`div`,{className:`aspect-video bg-bg-surface animate-pulse`,role:`img`,"aria-label":n||`Video`})})}const Oe=(0,y.cva)(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-tight`,{variants:{variant:{default:`bg-bg-surface text-text-muted border-border-subtle`,primary:`bg-primary-500/15 text-primary-400 border-primary-500/20`,success:`bg-emerald-500/15 text-emerald-400 border-emerald-500/20`,warning:`bg-amber-500/15 text-amber-400 border-amber-500/20`,danger:`bg-red-500/15 text-red-400 border-red-500/20`,info:`bg-sky-500/15 text-sky-400 border-sky-500/20`}},defaultVariants:{variant:`default`}});function ke({variant:e=`default`,children:t,className:n=``,...r}){return(0,h.jsx)(`span`,{className:k(Oe({variant:e}),n),...r,children:t})}const Ae=(0,y.cva)(`grid gap-4 my-6`,{variants:{cols:{1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,4:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-4`}},defaultVariants:{cols:3}});function je({cols:e=3,children:t,className:n=``,...r}){return(0,h.jsx)(`div`,{className:k(Ae({cols:e}),n),...r,children:t})}function Me({title:e,icon:t,href:n,children:r,className:i=``,...a}){let o=(0,l.useRef)(null),s=(0,l.useRef)(null),c=(0,l.useCallback)(e=>{let t=o.current||s.current;if(!t)return;let{left:n,top:r}=t.getBoundingClientRect();t.style.setProperty(`--x`,`${e.clientX-n}px`),t.style.setProperty(`--y`,`${e.clientY-r}px`)},[]),u=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 group-hover:opacity-100`,style:{background:`radial-gradient(400px circle at var(--x) var(--y), color-mix(in oklch, var(--color-primary-500), transparent 90%), transparent 80%)`}}),t&&(0,h.jsx)(`div`,{className:`mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-primary-500/10 text-primary-400 text-lg transition-transform duration-300 group-hover:scale-105 group-hover:-rotate-3`,children:t}),(0,h.jsxs)(`div`,{className:`space-y-1.5`,children:[e&&(0,h.jsx)(`h3`,{className:`text-sm font-bold text-text-main`,children:e}),r&&(0,h.jsx)(`div`,{className:`text-sm text-text-muted leading-relaxed`,children:r})]})]}),d=k(`group relative block rounded-xl border border-border-subtle bg-bg-surface p-5 outline-none overflow-hidden`,`transition-all duration-200 hover:border-primary-500/40 hover:shadow-lg hover:shadow-primary-500/5`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,i);return n?(0,h.jsx)(m.Link,{ref:s,href:n,className:k(d,`no-underline cursor-pointer`),onMouseMove:c,...a,children:u}):(0,h.jsx)(`div`,{ref:o,role:`presentation`,className:d,onMouseMove:c,...a,children:u})}const Ne={note:(0,h.jsx)(p.Bookmark,{size:18}),tip:(0,h.jsx)(p.Lightbulb,{size:18}),info:(0,h.jsx)(p.Info,{size:18}),warning:(0,h.jsx)(p.AlertTriangle,{size:18}),danger:(0,h.jsx)(p.ShieldAlert,{size:18}),important:(0,h.jsx)(p.Flame,{size:18}),caution:(0,h.jsx)(p.Zap,{size:18})},Pe={note:`Note`,tip:`Tip`,info:`Info`,warning:`Warning`,danger:`Danger`,important:`Important`,caution:`Caution`},G=(0,y.cva)(`py-4 px-4 rounded-lg`,{variants:{type:{note:`border-primary-400 bg-primary-500/5 text-primary-400`,tip:`border-emerald-500 bg-emerald-500/5 text-emerald-500`,info:`border-sky-500 bg-sky-500/5 text-sky-500`,warning:`border-amber-500 bg-amber-500/5 text-amber-500`,danger:`border-red-500 bg-red-500/5 text-red-500`,important:`border-orange-500 bg-orange-500/5 text-orange-500`,caution:`border-yellow-500 bg-yellow-500/5 text-yellow-500`}},defaultVariants:{type:`note`}});function K({type:e=`note`,title:t,children:n,className:r=``,...i}){return(0,h.jsxs)(`div`,{className:k(G({type:e}),r),role:e===`warning`||e===`danger`?`alert`:`note`,...i,children:[(0,h.jsxs)(`div`,{className:`flex items-center flex-row gap-2 mb-2`,children:[(0,h.jsx)(`span`,{className:k(`shrink-0`,G({type:e})),children:Ne[e]}),(0,h.jsx)(`span`,{className:`text-sm font-bold tracking-tight text-text-main`,children:t||Pe[e]})]}),(0,h.jsx)(`div`,{className:`text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0`,children:n})]})}const Fe=e=>(0,h.jsx)(K,{type:`note`,...e}),Ie=e=>(0,h.jsx)(K,{type:`tip`,...e}),Le=e=>(0,h.jsx)(K,{type:`warning`,...e}),Re=e=>(0,h.jsx)(K,{type:`danger`,...e}),ze=e=>(0,h.jsx)(K,{type:`info`,...e}),Be=e=>(0,h.jsx)(K,{type:`important`,...e}),Ve=e=>(0,h.jsx)(K,{type:`caution`,...e}),He=(0,y.cva)(`my-6 transition-all duration-200`,{variants:{variant:{default:`list-disc pl-5 text-text-muted marker:text-primary-500/50`,number:`list-decimal pl-5 text-text-muted marker:text-primary-500/50 marker:font-bold`,checked:`list-none p-0`,arrow:`list-none p-0`,bubble:`list-none p-0`},cols:{1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,4:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-4`},isGrid:{true:`grid gap-x-8 gap-y-3`,false:`space-y-2`},dense:{true:`space-y-1`,false:`space-y-2`}},compoundVariants:[{variant:`default`,dense:!0,className:`space-y-0.5`}],defaultVariants:{variant:`default`,cols:1,isGrid:!1,dense:!1}}),Ue=(0,y.cva)(`group flex items-start gap-3 text-sm leading-relaxed transition-all duration-200`,{variants:{variant:{default:``,number:``,checked:`hover:translate-x-0.5`,arrow:`hover:translate-x-0.5`,bubble:`hover:translate-x-0.5`},dense:{true:`py-0`,false:`py-0.5`}},defaultVariants:{variant:`default`,dense:!1}}),We=(0,y.cva)(`mt-1 shrink-0 flex items-center justify-center transition-transform group-hover:scale-110`,{variants:{variant:{bubble:`h-5 w-5 rounded-full bg-primary-500/10 text-primary-500 text-[10px] font-bold`,default:``}},defaultVariants:{variant:`default`}});function Ge({icon:e,children:t,variant:n,dense:r}){return(0,h.jsxs)(`li`,{className:k(Ue({variant:n,dense:r})),children:[e&&(0,h.jsx)(`span`,{className:k(We({variant:n===`bubble`?`bubble`:`default`})),children:e}),(0,h.jsx)(`div`,{className:`flex-1 text-text-muted group-hover:text-text-main transition-colors`,children:t})]})}const Ke={checked:e=>(0,h.jsx)(p.Check,{size:14,className:k(`text-emerald-500 shrink-0`,e)}),arrow:e=>(0,h.jsx)(p.ChevronRight,{size:14,className:k(`text-primary-400 shrink-0`,e)}),bubble:e=>(0,h.jsx)(p.Circle,{size:6,fill:`currentColor`,className:k(`text-primary-500 shrink-0`,e)}),default:()=>null,number:()=>null};function qe({variant:e=`default`,cols:t=1,dense:n=!1,children:r,className:i,...a}){let o=t!==void 0&&Number(t)>1,s=Ke[e],c=He({variant:e,cols:t,dense:n,isGrid:o,className:i}),u=e===`number`?`ol`:`ul`;return e===`default`||e===`number`?(0,h.jsx)(u,{className:c,...a,children:r}):(0,h.jsx)(`ul`,{className:c,...a,children:l.Children.map(r,t=>{if(!(0,l.isValidElement)(t))return t;let r=t,i=r.type===`li`?r.props.children:r.props.children||t;return(0,h.jsx)(Ge,{icon:s(),variant:e,dense:n,children:i})})})}const Je={ts:P,tsx:R,js:F,jsx:R,json:I,css:L,html:be,md:z,mdx:z,bash:B,sh:B,yaml:V,yml:V},q={CODE:/\.(ts|tsx|js|jsx|json|mjs|cjs|astro|vue|svelte)$/i,TEXT:/\.(md|mdx|txt)$/i,IMAGE:/\.(png|jpg|jpeg|svg|gif)$/i};function J(e){return typeof e==`string`?e:typeof e==`number`?e.toString():Array.isArray(e)?e.map(J).join(``):(0,l.isValidElement)(e)&&e.props&&typeof e.props==`object`&&`children`in e.props?J(e.props.children):``}function Ye(e,t){let n=e.toLowerCase(),r=`shrink-0 transition-colors duration-200`;if(t)return(0,h.jsx)(p.Folder,{size:16,strokeWidth:2,className:k(r,`text-primary-400`),fill:`currentColor`,fillOpacity:.15});let i=Je[n.split(`.`).pop()||``];if(i)return(0,h.jsx)(i,{size:16});let a=k(r,`text-text-dim group-hover:text-text-main`);return q.CODE.test(n)?(0,h.jsx)(p.FileCode,{size:16,strokeWidth:2,className:a}):q.TEXT.test(n)?(0,h.jsx)(p.FileText,{size:16,strokeWidth:2,className:a}):q.IMAGE.test(n)?(0,h.jsx)(p.FileImage,{size:16,strokeWidth:2,className:a}):(0,h.jsx)(p.File,{size:16,strokeWidth:2,className:a})}function Y(e,t){if(!(0,l.isValidElement)(e))return!1;let n=e.type;if(typeof n==`string`)return n===t;if(typeof n==`function`)return n.name===t||n.name?.toLowerCase()===t;let r=e.props;return r?.originalType===t||r?.mdxType===t}function Xe(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function X(e,t=`root`){if(!(0,l.isValidElement)(e))return[];let n=[];if(Y(e,`ul`))return l.Children.forEach(e.props.children,(e,r)=>{n.push(...X(e,`${t}-${r}`))}),n;if(Y(e,`li`)){let r=l.Children.toArray(e.props.children),i=r.findIndex(e=>Y(e,`ul`)),a=i!==-1,o=a?r.slice(0,i):r,s=a?r.slice(i):[],{name:c,comment:u}=Xe(J(o)),d=c.endsWith(`/`),f=d?c.slice(0,-1):c,p=a||d;return n.push({id:`${t}-${f}`,name:f,comment:u,isFolder:p,children:a?X(s[0],`${t}-${f}`):void 0}),n}return e.props&&typeof e.props==`object`&&`children`in e.props&&l.Children.forEach(e.props.children,(e,r)=>{n.push(...X(e,`${t}-${r}`))}),n}function Ze({item:e}){return(0,h.jsxs)(m.TreeItem,{id:e.id,textValue:e.name,className:`outline-none group focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md`,children:[(0,h.jsx)(m.TreeItemContent,{children:({isExpanded:t,hasChildItems:n})=>(0,h.jsxs)(`div`,{className:`flex items-center gap-2 py-1 px-1.5 rounded-md transition-colors hover:bg-primary-500/5 cursor-pointer`,children:[(0,h.jsx)(`div`,{style:{width:`calc((var(--tree-item-level) - 1) * 1rem)`},className:`shrink-0`}),n?(0,h.jsx)(m.Button,{slot:`chevron`,className:`outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors`,children:(0,h.jsx)(p.ChevronRight,{size:14,strokeWidth:3,className:k(`transition-transform duration-200`,t&&`rotate-90`)})}):(0,h.jsx)(`div`,{className:`w-[18px]`}),Ye(e.name,e.isFolder),(0,h.jsx)(`span`,{className:k(`text-sm transition-colors truncate select-none`,e.isFolder?`font-semibold text-text-main`:`text-text-muted group-hover:text-text-main`),children:e.name}),e.comment&&(0,h.jsxs)(`span`,{className:`ml-2 text-xs italic text-text-dim opacity-70 group-hover:opacity-100 transition-opacity whitespace-nowrap overflow-hidden text-ellipsis font-sans`,children:[`//`,` `,e.comment]})]})}),e.children&&(0,h.jsx)(m.Collection,{items:e.children,children:e=>(0,h.jsx)(Ze,{item:e})})]})}function Qe({children:e}){let t=(0,l.useMemo)(()=>X(e),[e]);return(0,h.jsx)(`div`,{className:`my-8`,children:(0,h.jsx)(m.Tree,{items:t,"aria-label":`File Tree`,className:k(`rounded-xl border border-border-subtle bg-bg-surface/50 p-4 font-mono text-sm shadow-sm backdrop-blur-sm outline-none`,`max-h-[500px] overflow-y-auto scrollbar-thin scrollbar-thumb-border-subtle`,`focus-visible:ring-2 focus-visible:ring-primary-500/20`),children:e=>(0,h.jsx)(Ze,{item:e})})})}function $e({data:e,sortable:t=!1,paginated:n=!1,pageSize:r=10}){let[i,a]=(0,l.useState)(null),[o,s]=(0,l.useState)(1),c=(0,l.useMemo)(()=>{if(!e)return[];let n=[...e];return t&&i!==null&&n.sort((e,t)=>{let n=e[i.key],r=t[i.key],a=typeof n==`string`?n:``,o=typeof r==`string`?r:``;return a<o?i.direction===`asc`?-1:1:a>o?i.direction===`asc`?1:-1:0}),n},[e,i,t]);return{sortConfig:i,currentPage:o,setCurrentPage:s,totalPages:Math.ceil(c.length/r),paginatedData:(0,l.useMemo)(()=>{if(!n)return c;let e=(o-1)*r;return c.slice(e,e+r)},[c,n,o,r]),requestSort:e=>{if(!t)return;let n=`asc`;i&&i.key===e&&i.direction===`asc`&&(n=`desc`),a({key:e,direction:n})}}}function et({headers:e,data:t,children:n,className:r=``,sortable:i=!1,paginated:a=!1,pageSize:o=10}){let{sortConfig:s,currentPage:c,setCurrentPage:l,totalPages:u,paginatedData:d,requestSort:f}=$e({data:t,sortable:i,paginated:a,pageSize:o}),g=e=>i?s?.key===e?s.direction===`asc`?(0,h.jsx)(p.ChevronUp,{size:14,className:`ml-1 text-primary-400`}):(0,h.jsx)(p.ChevronDown,{size:14,className:`ml-1 text-primary-400`}):(0,h.jsx)(p.ChevronDown,{size:14,className:`ml-1 opacity-30`}):null,_=n||(0,h.jsxs)(h.Fragment,{children:[e&&(0,h.jsx)(`thead`,{children:(0,h.jsx)(`tr`,{children:e.map((e,t)=>(0,h.jsx)(`th`,{onClick:()=>f(t),className:k(`text-left px-3 py-2.5 border-b-2 border-border-subtle text-text-main font-semibold text-sm`,i&&`cursor-pointer select-none hover:text-primary-400 transition-colors`),children:(0,h.jsxs)(`div`,{className:`flex items-center`,children:[e,g(t)]})},t))})}),d&&(0,h.jsx)(`tbody`,{children:d.map((e,t)=>(0,h.jsx)(`tr`,{className:`transition-colors hover:bg-bg-surface`,children:e.map((e,t)=>(0,h.jsx)(`td`,{className:`px-3 py-2 border-b border-border-subtle text-sm text-text-muted`,children:e},t))},t))})]});return(0,h.jsxs)(`div`,{className:k(`my-6 rounded-lg border border-border-subtle overflow-hidden`,r),children:[(0,h.jsx)(`div`,{className:`overflow-x-auto`,children:(0,h.jsx)(`table`,{className:`w-full border-collapse text-sm`,children:_})}),a&&u>1&&(0,h.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border-subtle px-4 py-3`,children:[(0,h.jsxs)(`span`,{className:`text-xs text-text-muted`,children:[`Page `,c,` of `,u]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(m.Button,{onPress:()=>l(1),isDisabled:c===1,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:(0,h.jsx)(p.ChevronsLeft,{size:16})}),(0,h.jsx)(m.Button,{onPress:()=>l(e=>Math.max(e-1,1)),isDisabled:c===1,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:(0,h.jsx)(p.ChevronLeft,{size:16})}),(0,h.jsx)(m.Button,{onPress:()=>l(e=>Math.min(e+1,u)),isDisabled:c===u,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:(0,h.jsx)(p.ChevronRight,{size:16})}),(0,h.jsx)(m.Button,{onPress:()=>l(u),isDisabled:c===u,className:`grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer`,children:(0,h.jsx)(p.ChevronsRight,{size:16})})]})]})]})}function tt({name:e,type:t,defaultValue:n,required:r=!1,children:i,id:a,className:o=``}){return(0,h.jsxs)(`article`,{className:k(`group relative my-6 rounded-xl border border-border-subtle bg-bg-surface p-5 transition-all duration-300`,`hover:border-primary-500/30 hover:shadow-lg hover:shadow-primary-500/5`,o),id:a,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,h.jsx)(`code`,{className:`inline-flex items-center rounded-md bg-primary-500/10 px-2.5 py-1 font-mono text-sm font-bold text-primary-400 border border-primary-500/20 shadow-sm transition-colors group-hover:bg-primary-500/15`,children:e}),t&&(0,h.jsx)(`span`,{className:`rounded-md bg-bg-muted/80 border border-border-subtle px-2 py-0.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider shadow-sm`,children:t}),r&&(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-full bg-red-500/10 px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-red-400 border border-red-500/20 shadow-sm`,children:[(0,h.jsx)(`span`,{className:`h-1 w-1 rounded-full bg-red-400 animate-pulse`}),`Required`]})]}),n&&(0,h.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-text-muted bg-bg-muted/30 px-2.5 py-1 rounded-md border border-border-subtle/50`,children:[(0,h.jsx)(`span`,{className:`font-semibold opacity-60 uppercase tracking-tighter`,children:`Default`}),(0,h.jsx)(`code`,{className:`font-mono text-text-main font-medium`,children:n})]})]}),(0,h.jsx)(`div`,{className:`text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30`,children:i})]})}function nt({to:e,children:t,className:n=``,...r}){let i=e&&(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`));return(0,h.jsx)(A,{href:e,className:k(`text-blue-600 hover:text-blue-800 hover:underline cursor-pointer`,n),target:i?`_blank`:void 0,rel:i?`noopener noreferrer`:void 0,...r,children:t})}function rt({src:e,alt:t,theme:n,...r}){let{theme:i}=le();return n&&n!==i?null:(0,h.jsx)(`img`,{src:e,alt:t||``,...r})}function it({title:e,props:t,className:n=``}){return(0,h.jsxs)(`div`,{className:k(`my-6`,n),children:[e&&(0,h.jsx)(`h3`,{className:`text-base font-bold text-text-main mb-3`,children:e}),(0,h.jsx)(`div`,{className:`overflow-x-auto rounded-lg border border-border-subtle`,children:(0,h.jsxs)(`table`,{className:`w-full border-collapse text-sm`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Property`}),(0,h.jsx)(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Type`}),(0,h.jsx)(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Default`}),(0,h.jsx)(`th`,{className:`text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted`,children:`Description`})]})}),(0,h.jsx)(`tbody`,{children:t.map((e,t)=>(0,h.jsxs)(`tr`,{className:`transition-colors hover:bg-bg-surface`,children:[(0,h.jsxs)(`td`,{className:`px-4 py-2.5 border-b border-border-subtle`,children:[(0,h.jsx)(`code`,{className:`rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400`,children:e.name}),e.required&&(0,h.jsx)(`span`,{className:`ml-1 text-red-400 font-bold`,children:`*`})]}),(0,h.jsx)(`td`,{className:`px-4 py-2.5 border-b border-border-subtle`,children:(0,h.jsx)(`code`,{className:`rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted`,children:e.type})}),(0,h.jsx)(`td`,{className:`px-4 py-2.5 border-b border-border-subtle`,children:e.defaultValue?(0,h.jsx)(`code`,{className:`rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400`,children:e.defaultValue}):(0,h.jsx)(`span`,{className:`text-text-dim`,children:`—`})}),(0,h.jsx)(`td`,{className:`px-4 py-2.5 border-b border-border-subtle text-text-muted`,children:e.description})]},`${e.name}-${t}`))})]})})]})}function at(e){let{code:t,children:n,preview:r}=e;return{initialCode:(0,l.useMemo)(()=>(t??(typeof n==`string`?n:``)).trim(),[t,n]),previewElement:(0,l.useMemo)(()=>r??(typeof n==`string`?null:n),[r,n])}}function ot(e){let{highlightedHtml:t,hideCode:n=!1,hideCopy:r=!1}=e,{initialCode:i,previewElement:a}=at(e);return(0,h.jsxs)(`div`,{className:`my-6 overflow-hidden rounded-xl border border-border-subtle`,children:[(0,h.jsx)(`div`,{className:`flex items-center justify-center p-8 bg-bg-surface`,children:a}),!n&&(0,h.jsx)(`div`,{className:`border-t border-border-subtle`,children:(0,h.jsx)(W,{hideCopy:r,lang:`tsx`,highlightedHtml:t,plain:!0,children:i})})]})}const st=({children:e,className:t,vertical:n=!1})=>(0,h.jsx)(`div`,{className:k(`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}),ct=({children:e,className:t,showArrow:n,...r})=>(0,h.jsxs)(m.Popover,{offset:8,...r,className:m.composeRenderProps(t,e=>k(`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&&(0,h.jsx)(m.OverlayArrow,{className:`group`,children:(0,h.jsx)(`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:(0,h.jsx)(`path`,{d:`M0 0 L6 6 L12 0`})})}),e]});function lt(e){let[t,n]=l.default.Children.toArray(e.children).slice(0,2);return(0,h.jsxs)(m.MenuTrigger,{...e,children:[t,(0,h.jsx)(ct,{placement:e.placement,className:`min-w-35`,children:n})]})}function ut(e){let[t,n]=l.default.Children.toArray(e.children).slice(0,2);return(0,h.jsxs)(m.SubmenuTrigger,{...e,children:[t,(0,h.jsx)(ct,{offset:-4,crossOffset:-4,children:n})]})}function Z(e){return(0,h.jsx)(m.Menu,{...e,className:m.composeRenderProps(e.className,e=>k(`p-1.5 outline-none max-h-[inherit] overflow-auto max-w-75`,e))})}function dt(e){let t=e.textValue||(typeof e.children==`string`?e.children:void 0);return(0,h.jsx)(m.MenuItem,{...e,textValue:t,className:m.composeRenderProps(e.className,(e,{isFocused:t,isPressed:n,isDisabled:r})=>k(`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:m.composeRenderProps(e.children,(e,{selectionMode:t,isSelected:n,hasSubmenu:r})=>(0,h.jsxs)(h.Fragment,{children:[t!==`none`&&(0,h.jsxs)(`span`,{className:`flex items-center size-4 shrink-0 justify-center`,children:[n&&t===`multiple`&&(0,h.jsx)(p.Check,{className:`size-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200`}),n&&t===`single`&&(0,h.jsx)(p.Dot,{className:`size-5 text-primary-500 animate-in zoom-in-50 duration-200`})]}),(0,h.jsx)(`div`,{className:`flex flex-row w-full transition-colors items-center gap-2 py-1 px-1`,children:e}),r&&(0,h.jsx)(p.ChevronRight,{className:`size-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors`})]}))})}function ft({title:e,...t}){return(0,h.jsxs)(m.MenuSection,{...t,className:k(`flex flex-col gap-0.5`,t.className),children:[e&&(0,h.jsx)(m.Header,{className:`px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none`,children:e}),(0,h.jsx)(m.Collection,{items:t.items,children:t.children})]})}function pt(e){return(0,h.jsx)(m.Separator,{...e,className:`mx-2 my-1.5 border-t border-border-subtle/50`})}Z.Root=Z,Z.Item=dt,Z.Trigger=lt,Z.SubTrigger=ut,Z.Section=ft,Z.Separator=pt;function Q({className:e,variant:t=`rect`,...n}){return(0,h.jsx)(`div`,{className:k(`animate-pulse bg-bg-muted`,t===`circle`?`rounded-full`:`rounded-md`,e),...n})}const mt=e=>{let[t,n]=(0,l.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function ht({content:e,mdxRaw:t,config:n}){let r=t||e||``,{copied:i,handleCopy:a,handleOpenRaw:o}=mt(r),s=n!==!1,c=typeof n==`object`&&n.text||`Copy Markdown`;return!s||!r?null:(0,h.jsx)(`div`,{className:`relative inline-flex z-100 flex-shrink-0 w-max translate-y-0 active:translate-y-px transition-transform duration-200`,children:(0,h.jsxs)(st,{className:`rounded-xl border border-border-subtle bg-bg-surface/40 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:shadow-lg hover:shadow-primary-500/5 group overflow-hidden`,children:[(0,h.jsx)(M,{variant:`ghost`,onPress:a,icon:i?(0,h.jsx)(p.Check,{size:16}):(0,h.jsx)(p.Copy,{size:16}),iconPosition:`left`,className:k(`px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 border-none shrink-0`,`text-text-main transition-all duration-300 hover:bg-primary-500/5`,i&&`text-emerald-500 hover:bg-emerald-500/5`),children:i?`Copied!`:c}),(0,h.jsxs)(Z.Trigger,{placement:`bottom end`,children:[(0,h.jsx)(M,{variant:`ghost`,isIconOnly:!0,icon:(0,h.jsx)(p.ChevronDown,{size:14}),className:k(`px-3.5 h-9 border-l border-border-subtle/50 text-text-muted rounded-none bg-transparent shrink-0`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`)}),(0,h.jsxs)(Z.Root,{className:`w-52`,children:[(0,h.jsxs)(Z.Item,{onAction:a,children:[(0,h.jsx)(p.Copy,{size:16,className:`size-4 mt-0.5 text-text-muted group-hover:text-primary-500`}),(0,h.jsx)(`span`,{className:`font-medium text-[0.8125rem]`,children:`Copy Markdown`})]}),(0,h.jsxs)(Z.Item,{onAction:o,children:[(0,h.jsx)(p.ExternalLink,{size:16,className:`size-4 mt-0.5 text-text-muted group-hover:text-primary-500`}),(0,h.jsx)(`span`,{className:`font-medium text-[0.8125rem]`,children:`View as Markdown`})]})]})]})]})})}var gt=o({Admonition:()=>K,Badge:()=>ke,Button:()=>_e,Card:()=>Me,Cards:()=>je,Caution:()=>Ve,CodeBlock:()=>W,ComponentPreview:()=>ot,ComponentProps:()=>it,CopyMarkdown:()=>ht,Danger:()=>Re,Field:()=>tt,FileTree:()=>Qe,Image:()=>rt,Important:()=>Be,InfoBox:()=>ze,Link:()=>nt,List:()=>qe,Note:()=>Fe,Tab:()=>Te,Table:()=>et,Tabs:()=>Ee,Tip:()=>Ie,Video:()=>De,Warning:()=>Le});function _t(){return(0,h.jsx)(`div`,{className:k(`w-full h-full relative overflow-y-auto transition-opacity duration-300 animate-fade-in`),children:(0,h.jsxs)(`div`,{className:`mx-auto max-w-(--spacing-content-max) px-4 py-8 space-y-10`,children:[(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(Q,{className:`h-3 w-16`}),(0,h.jsx)(Q,{className:`h-3 w-24`})]}),(0,h.jsx)(Q,{className:`h-10 w-[60%] sm:h-12`}),(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsx)(Q,{className:`h-4 w-full`}),(0,h.jsx)(Q,{className:`h-4 w-[95%]`}),(0,h.jsx)(Q,{className:`h-4 w-[40%]`})]}),(0,h.jsxs)(`div`,{className:`space-y-6 pt-4`,children:[(0,h.jsx)(Q,{className:`h-7 w-32`}),(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsx)(Q,{className:`h-4 w-full`}),(0,h.jsx)(Q,{className:`h-4 w-[98%]`}),(0,h.jsx)(Q,{className:`h-4 w-[92%]`}),(0,h.jsx)(Q,{className:`h-4 w-[60%]`})]})]}),(0,h.jsx)(Q,{className:`h-32 w-full rounded-lg bg-bg-muted/50`}),(0,h.jsxs)(`div`,{className:`space-y-6 pt-4`,children:[(0,h.jsx)(Q,{className:`h-7 w-48`}),(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsx)(Q,{className:`h-4 w-full`}),(0,h.jsx)(Q,{className:`h-4 w-[85%]`})]})]})]})})}const $=({level:e,id:t,children:n,...r})=>(0,h.jsxs)(`h${e}`,{id:t,...r,className:`boltdocs-heading`,children:[n,t&&(0,h.jsx)(`a`,{href:`#${t}`,className:`header-anchor`,"aria-label":`Anchor`,children:(0,h.jsx)(p.Link,{size:16})})]}),vt={...gt,Loading:_t,h1:e=>(0,h.jsx)($,{level:1,...e}),h2:e=>(0,h.jsx)($,{level:2,...e}),h3:e=>(0,h.jsx)($,{level:3,...e}),h4:e=>(0,h.jsx)($,{level:4,...e}),h5:e=>(0,h.jsx)($,{level:5,...e}),h6:e=>(0,h.jsx)($,{level:6,...e}),pre:e=>(0,h.jsx)(W,{...e,children:e.children})};function yt(){let{currentLocale:e,config:t}=D();return(0,l.useEffect)(()=>{if(!t.i18n)return;let n=t.i18n.localeConfigs?.[e];document.documentElement.lang=n?.htmlLang||e||`en`,document.documentElement.dir=n?.direction||`ltr`},[e,t.i18n]),null}function bt(){let e=(0,f.useLocation)(),{config:t}=D(),n=E(e=>e.setLocale),r=E(e=>e.setVersion),i=E(e=>e.currentLocale),a=E(e=>e.currentVersion);return(0,l.useEffect)(()=>{let o=e.pathname.split(`/`).filter(Boolean),s=0,c=t.versions?.defaultVersion,l=t.i18n?.defaultLocale;if(o[s]===`docs`&&s++,t.versions&&o.length>s){let e=t.versions.versions.find(e=>e.path===o[s]);e&&(c=e.path,s++)}t.i18n&&o.length>s&&t.i18n.locales[o[s]]?l=o[s]:t.i18n&&o.length===0&&(l=i||t.i18n.defaultLocale),l!==i&&n(l),c!==a&&r(c)},[e.pathname,t,n,r,i,a]),null}function xt({initialRoutes:e,initialConfig:t,docsDirName:n,modules:r,hot:i,homePage:a,externalPages:o,externalLayout:s,components:c={}}){let[u,d]=(0,l.useState)(e),[p,m]=(0,l.useState)(t),g=o||{},_=s||v.default,y=(0,l.useMemo)(()=>u.filter(e=>!(a&&(e.path===`/`||e.path===``))&&!g[e.path===``?`/`:e.path]).map(e=>{let t=Object.keys(r).find(t=>t===`/${n}/${e.filePath}`||t.endsWith(`/${n}/${e.filePath}`)||t.endsWith(`/${n}\\${e.filePath.replace(/\\/g,`/`)}`)),i=t?r[t]:null;return{...e,Component:l.default.lazy(async()=>i?await i():{default:oe})}}),[u,r,n,a,g]);(0,l.useEffect)(()=>{i&&(i.on(`boltdocs:routes-update`,e=>{d(e)}),i.on(`boltdocs:config-update`,e=>{m(e)}))},[i]);let S=(0,l.useMemo)(()=>({...vt,...b.default,...c}),[c]),C=S.Loading;return(0,h.jsx)(re,{children:(0,h.jsx)(ce,{children:(0,h.jsx)(he,{components:S,children:(0,h.jsx)(x.Provider,{value:p,children:(0,h.jsx)(ue,{children:(0,h.jsxs)(te,{routes:u,modules:r,children:[(0,h.jsx)(de,{}),(0,h.jsx)(bt,{}),(0,h.jsx)(yt,{}),(0,h.jsxs)(f.Routes,{children:[(0,h.jsx)(f.Route,{element:(0,h.jsx)(fe,{}),children:y.map(e=>(0,h.jsx)(f.Route,{path:e.path===``?`/`:e.path,element:(0,h.jsx)(l.default.Suspense,{fallback:(0,h.jsx)(C,{}),children:(0,h.jsx)(ge,{Component:e.Component})})},e.path))},`docs-layout`),a&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(f.Route,{path:`/`,element:(0,h.jsx)(_,{children:(0,h.jsx)(a,{})})}),p.i18n&&Object.keys(p.i18n.locales).map(e=>(0,h.jsx)(f.Route,{path:`/${e}`,element:(0,h.jsx)(_,{children:(0,h.jsx)(a,{})})},`home-${e}`))]}),Object.entries(g).map(([e,t])=>{let n=e===`/`?``:e;return(0,h.jsxs)(l.default.Fragment,{children:[(0,h.jsx)(f.Route,{path:e,element:(0,h.jsx)(_,{children:(0,h.jsx)(t,{})})}),p.i18n&&Object.keys(p.i18n.locales).map(r=>(0,h.jsx)(f.Route,{path:`/${r}${n}`,element:(0,h.jsx)(_,{children:(0,h.jsx)(t,{})})},`${e}-${r}`))]},e)}),(0,h.jsx)(f.Route,{path:`*`,element:(0,h.jsx)(v.default,{children:(0,h.jsx)(oe,{})})})]})]})})})})})})}async function St(e){let{path:t,routes:n,config:r,modules:i,homePage:a,externalPages:o,docsDirName:s}=e,c={};for(let[e,t]of Object.entries(i))c[e]=()=>Promise.resolve(t);return u.default.renderToString((0,h.jsx)(l.default.StrictMode,{children:(0,h.jsx)(d.StaticRouter,{location:t,children:(0,h.jsx)(xt,{initialRoutes:n,initialConfig:r,docsDirName:s,modules:c,homePage:a,externalPages:o})})}))}exports.render=St;
@@ -1,80 +0,0 @@
1
-
2
- import React from "react";
3
- //#region src/client/types.d.ts
4
- /**
5
- * Metadata provided by the server for a specific route.
6
- * Maps closely to the `RouteMeta` type in the Node environment.
7
- */
8
- interface ComponentRoute {
9
- /** The final URL path */
10
- path: string;
11
- /** The absolute filesystem path of the source file */
12
- componentPath: string;
13
- /** The page title */
14
- title: string;
15
- /** Explicit order in the sidebar */
16
- sidebarPosition?: number;
17
- /** The relative path from the docs directory */
18
- filePath: string;
19
- /** The group directory name */
20
- group?: string;
21
- /** The display title of the group */
22
- groupTitle?: string;
23
- /** Explicit order of the group in the sidebar */
24
- groupPosition?: number;
25
- /** Extracted markdown headings for search indexing */
26
- headings?: {
27
- level: number;
28
- text: string;
29
- id: string;
30
- }[];
31
- /** The page summary or description */
32
- description?: string;
33
- /** The locale this route belongs to, if i18n is configured */
34
- locale?: string;
35
- /** The version this route belongs to, if versioning is configured */
36
- version?: string;
37
- /** Optional icon to display (Lucide icon name or raw SVG) */
38
- icon?: string;
39
- /** The tab this route belongs to, if tabs are configured */
40
- tab?: string;
41
- /** Optional badge to display next to the sidebar item */
42
- badge?: string | {
43
- text: 'updated' | 'new' | 'deprecated';
44
- expires?: string;
45
- };
46
- /** Optional icon for the route's group */
47
- groupIcon?: string;
48
- /** The extracted plain-text content of the page for search indexing */
49
- _content?: string;
50
- /** The raw markdown content of the page */
51
- _rawContent?: string;
52
- }
53
- //#endregion
54
- //#region src/client/ssr.d.ts
55
- /**
56
- * Options for rendering the Boltdocs application on the server (SSG).
57
- */
58
- interface RenderOptions {
59
- /** The URL path currently being rendered */
60
- path: string;
61
- /** Initial routes generated by the Vite plugin (`virtual:boltdocs-routes`) */
62
- routes: ComponentRoute[];
63
- /** Site configuration (`virtual:boltdocs-config`) */
64
- config: any;
65
- /** The name of the documentation directory (e.g. 'docs') */
66
- docsDirName: string;
67
- /** Optional custom React component to render when visiting the root path ('/') */
68
- homePage?: React.ComponentType;
69
- /** Custom external pages mapped by their route path */
70
- externalPages?: Record<string, React.ComponentType<any>>;
71
- /** Preloaded modules (since SSR cannot use dynamic imports easily) */
72
- modules: Record<string, any>;
73
- }
74
- /**
75
- * Renders the full React application into an HTML string for a specific route.
76
- * This is called by the Node SSG script during the Vite build process.
77
- */
78
- declare function render(options: RenderOptions): Promise<string>;
79
- //#endregion
80
- export { RenderOptions, render };
@@ -1,80 +0,0 @@
1
-
2
- import React from "react";
3
- //#region src/client/types.d.ts
4
- /**
5
- * Metadata provided by the server for a specific route.
6
- * Maps closely to the `RouteMeta` type in the Node environment.
7
- */
8
- interface ComponentRoute {
9
- /** The final URL path */
10
- path: string;
11
- /** The absolute filesystem path of the source file */
12
- componentPath: string;
13
- /** The page title */
14
- title: string;
15
- /** Explicit order in the sidebar */
16
- sidebarPosition?: number;
17
- /** The relative path from the docs directory */
18
- filePath: string;
19
- /** The group directory name */
20
- group?: string;
21
- /** The display title of the group */
22
- groupTitle?: string;
23
- /** Explicit order of the group in the sidebar */
24
- groupPosition?: number;
25
- /** Extracted markdown headings for search indexing */
26
- headings?: {
27
- level: number;
28
- text: string;
29
- id: string;
30
- }[];
31
- /** The page summary or description */
32
- description?: string;
33
- /** The locale this route belongs to, if i18n is configured */
34
- locale?: string;
35
- /** The version this route belongs to, if versioning is configured */
36
- version?: string;
37
- /** Optional icon to display (Lucide icon name or raw SVG) */
38
- icon?: string;
39
- /** The tab this route belongs to, if tabs are configured */
40
- tab?: string;
41
- /** Optional badge to display next to the sidebar item */
42
- badge?: string | {
43
- text: 'updated' | 'new' | 'deprecated';
44
- expires?: string;
45
- };
46
- /** Optional icon for the route's group */
47
- groupIcon?: string;
48
- /** The extracted plain-text content of the page for search indexing */
49
- _content?: string;
50
- /** The raw markdown content of the page */
51
- _rawContent?: string;
52
- }
53
- //#endregion
54
- //#region src/client/ssr.d.ts
55
- /**
56
- * Options for rendering the Boltdocs application on the server (SSG).
57
- */
58
- interface RenderOptions {
59
- /** The URL path currently being rendered */
60
- path: string;
61
- /** Initial routes generated by the Vite plugin (`virtual:boltdocs-routes`) */
62
- routes: ComponentRoute[];
63
- /** Site configuration (`virtual:boltdocs-config`) */
64
- config: any;
65
- /** The name of the documentation directory (e.g. 'docs') */
66
- docsDirName: string;
67
- /** Optional custom React component to render when visiting the root path ('/') */
68
- homePage?: React.ComponentType;
69
- /** Custom external pages mapped by their route path */
70
- externalPages?: Record<string, React.ComponentType<any>>;
71
- /** Preloaded modules (since SSR cannot use dynamic imports easily) */
72
- modules: Record<string, any>;
73
- }
74
- /**
75
- * Renders the full React application into an HTML string for a specific route.
76
- * This is called by the Node SSG script during the Vite build process.
77
- */
78
- declare function render(options: RenderOptions): Promise<string>;
79
- //#endregion
80
- export { RenderOptions, render };