boltdocs 2.3.0 → 2.4.2

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 (93) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/base-ui/index.d.mts +3 -3
  3. package/dist/base-ui/index.d.ts +3 -3
  4. package/dist/base-ui/index.js +1 -1
  5. package/dist/base-ui/index.mjs +1 -1
  6. package/dist/chunk-2DI3OGHV.mjs +1 -0
  7. package/dist/chunk-64AJ5QLT.mjs +1 -0
  8. package/dist/chunk-DDX52BX4.mjs +1 -0
  9. package/dist/chunk-HRZDSFR5.mjs +1 -0
  10. package/dist/chunk-PPVDMDEL.mjs +1 -0
  11. package/dist/{chunk-HA6543SL.mjs → chunk-UBE4CKOA.mjs} +1 -1
  12. package/dist/chunk-UWT4AJTH.mjs +73 -0
  13. package/dist/chunk-WWJ7WKDI.mjs +1 -0
  14. package/dist/client/index.d.mts +15 -21
  15. package/dist/client/index.d.ts +15 -21
  16. package/dist/client/index.js +1 -1
  17. package/dist/client/index.mjs +1 -1
  18. package/dist/client/ssr.js +1 -1
  19. package/dist/client/ssr.mjs +1 -1
  20. package/dist/client/types.d.mts +1 -1
  21. package/dist/client/types.d.ts +1 -1
  22. package/dist/client/types.js +1 -1
  23. package/dist/{copy-markdown-CbS8X-qe.d.mts → copy-markdown--9yjpbyy.d.mts} +1 -1
  24. package/dist/{copy-markdown-C-90ixSe.d.ts → copy-markdown-l2MYkcG7.d.ts} +1 -1
  25. package/dist/hooks/index.d.mts +3 -3
  26. package/dist/hooks/index.d.ts +3 -3
  27. package/dist/hooks/index.js +1 -1
  28. package/dist/hooks/index.mjs +1 -1
  29. package/dist/integrations/index.d.mts +1 -1
  30. package/dist/integrations/index.d.ts +1 -1
  31. package/dist/{loading-B7X5Wchs.d.ts → loading-BwUos0wZ.d.mts} +2 -11
  32. package/dist/{loading-WuaQbsKb.d.mts → loading-nlnUD01v.d.ts} +2 -11
  33. package/dist/mdx/index.d.mts +4 -2
  34. package/dist/mdx/index.d.ts +4 -2
  35. package/dist/mdx/index.js +1 -1
  36. package/dist/mdx/index.mjs +1 -1
  37. package/dist/node/cli-entry.js +16 -17
  38. package/dist/node/cli-entry.mjs +1 -1
  39. package/dist/node/index.d.mts +0 -9
  40. package/dist/node/index.d.ts +0 -9
  41. package/dist/node/index.js +13 -14
  42. package/dist/node/index.mjs +1 -1
  43. package/dist/primitives/index.d.mts +11 -20
  44. package/dist/primitives/index.d.ts +11 -20
  45. package/dist/primitives/index.js +1 -1
  46. package/dist/primitives/index.mjs +1 -1
  47. package/dist/search-dialog-OONKKC5H.mjs +1 -0
  48. package/dist/{types-j7jvWsJj.d.ts → types-opDA2E9-.d.mts} +4 -11
  49. package/dist/{types-j7jvWsJj.d.mts → types-opDA2E9-.d.ts} +4 -11
  50. package/dist/{use-routes-Cd806kGw.d.ts → use-routes-DNwgTRpU.d.ts} +1 -1
  51. package/dist/{use-routes-DDL0_jkQ.d.mts → use-routes-DrT80Eom.d.mts} +1 -1
  52. package/package.json +1 -1
  53. package/src/client/app/index.tsx +20 -9
  54. package/src/client/app/mdx-components-context.tsx +2 -2
  55. package/src/client/app/mdx-page.tsx +0 -1
  56. package/src/client/app/scroll-handler.tsx +21 -10
  57. package/src/client/components/default-layout.tsx +0 -2
  58. package/src/client/components/docs-layout.tsx +34 -4
  59. package/src/client/components/icons-dev.tsx +154 -0
  60. package/src/client/components/mdx/code-block.tsx +57 -5
  61. package/src/client/components/mdx/component-preview.tsx +1 -0
  62. package/src/client/components/mdx/file-tree.tsx +35 -0
  63. package/src/client/components/primitives/helpers/observer.ts +30 -39
  64. package/src/client/components/primitives/index.ts +1 -0
  65. package/src/client/components/primitives/menu.tsx +18 -12
  66. package/src/client/components/primitives/navbar.tsx +31 -90
  67. package/src/client/components/primitives/on-this-page.tsx +7 -161
  68. package/src/client/components/primitives/popover.tsx +1 -2
  69. package/src/client/components/ui-base/copy-markdown.tsx +4 -10
  70. package/src/client/components/ui-base/index.ts +0 -1
  71. package/src/client/components/ui-base/navbar.tsx +10 -9
  72. package/src/client/hooks/use-navbar.ts +37 -6
  73. package/src/client/index.ts +0 -1
  74. package/src/client/theme/neutral.css +2 -3
  75. package/src/client/types.ts +2 -2
  76. package/src/node/config.ts +0 -14
  77. package/src/node/mdx/cache.ts +1 -1
  78. package/src/node/mdx/index.ts +2 -0
  79. package/src/node/mdx/rehype-shiki.ts +9 -0
  80. package/src/node/mdx/remark-code-meta.ts +35 -0
  81. package/src/node/mdx/remark-shiki.ts +1 -1
  82. package/src/node/plugin/entry.ts +21 -14
  83. package/src/node/plugin/index.ts +22 -4
  84. package/src/node/routes/parser.ts +3 -0
  85. package/src/node/ssg/index.ts +76 -16
  86. package/dist/chunk-22NXDNP4.mjs +0 -74
  87. package/dist/chunk-2HUVMMJU.mjs +0 -1
  88. package/dist/chunk-CRZGOE32.mjs +0 -1
  89. package/dist/chunk-RPUERTVC.mjs +0 -1
  90. package/dist/chunk-URTD6E6S.mjs +0 -1
  91. package/dist/chunk-W2NB4T6V.mjs +0 -1
  92. package/dist/search-dialog-ZRXBAQJ5.mjs +0 -1
  93. package/src/client/components/ui-base/progress-bar.tsx +0 -67
package/dist/mdx/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var ir=Object.create;var Ce=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var cr=Object.getOwnPropertyNames;var dr=Object.getPrototypeOf,mr=Object.prototype.hasOwnProperty;var pr=(e,t)=>{for(var r in t)Ce(e,r,{get:t[r],enumerable:!0})},Je=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of cr(t))!mr.call(e,n)&&n!==r&&Ce(e,n,{get:()=>t[n],enumerable:!(o=lr(t,n))||o.enumerable});return e};var w=(e,t,r)=>(r=e!=null?ir(dr(e)):{},Je(t||!e||!e.__esModule?Ce(r,"default",{value:e,enumerable:!0}):r,e)),ur=e=>Je(Ce({},"__esModule",{value:!0}),e);var io={};pr(io,{Admonition:()=>U,Badge:()=>ut,Button:()=>tt,Card:()=>ht,Cards:()=>gt,Caution:()=>Tt,CodeBlock:()=>ee,ComponentPreview:()=>Ut,ComponentProps:()=>_t,CopyMarkdown:()=>nr,Danger:()=>Pt,Field:()=>Mt,FileTree:()=>It,Image:()=>$t,Important:()=>kt,InfoBox:()=>wt,Link:()=>Ht,List:()=>At,Note:()=>Ct,Tab:()=>ct,Table:()=>St,Tabs:()=>dt,Tip:()=>Nt,Video:()=>mt,Warning:()=>Rt});module.exports=ur(io);var Re=w(require("react-aria-components"));var Qe=require("clsx"),Ye=require("tailwind-merge");function s(...e){return(0,Ye.twMerge)((0,Qe.clsx)(e))}var et=require("class-variance-authority"),F=require("react/jsx-runtime"),Ne=(0,et.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"}}),Q=({href:e,icon:t,iconPosition:r="left",isIconOnly:o,children:n,className:a,variant:c,size:l,rounded:i,iconSize:d,disabled:m,...p})=>{let b=o||!n&&!!t,x=b?(0,F.jsx)("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):(0,F.jsxs)(F.Fragment,{children:[t&&r==="left"&&(0,F.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),(0,F.jsx)("span",{className:"flex items-center",children:n}),t&&r==="right"&&(0,F.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?(0,F.jsx)(Re.Link,{href:e,className:s(Ne({variant:c,size:l,rounded:i,iconSize:b?d:void 0,disabled:m}),a),...p,children:x}):(0,F.jsx)(Re.Button,{className:s(Ne({variant:c,size:l,rounded:i,iconSize:b?d:void 0,disabled:m}),a),...p,children:x})};var rt=require("react/jsx-runtime"),tt=({className:e,variant:t,size:r,rounded:o,iconSize:n,disabled:a,...c})=>(0,rt.jsx)(Q,{className:s("group",Ne({variant:t,size:r,rounded:o,iconSize:n,disabled:a,className:e})),...c});var we=w(require("react-aria-components")),ke=require("lucide-react");var Pe=require("react"),fr=(0,Pe.createContext)(null);function K(){let e=(0,Pe.use)(fr);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}var De=require("codesandbox/lib/api/define.js");function ot(e){let t=e.files||{},r=e.dependencies||{},o=e.devDependencies||{},n=e.title||"codesandbox-project",a=e.description||"Generic Sandbox",c={};for(let[l,i]of Object.entries(t)){let d=typeof i.content=="object"?JSON.stringify(i.content,null,2):i.content;c[l]={content:d,isBinary:i.isBinary??!1}}if(!c["package.json"]){let i=e.template==="vite"||!!o.vite||!!o["@vitejs/plugin-react"]?{dev:"vite",build:"vite build",preview:"vite preview"}:{start:"node index.js"};c["package.json"]={content:JSON.stringify({private:!0,name:n,description:a,type:"module",version:"1.0.0",scripts:e.scripts||i,dependencies:r,devDependencies:o},null,2),isBinary:!1}}return c}function br(e){let t=ot(e),r=(0,De.getParameters)({files:t}),o=new URLSearchParams({parameters:r,installDependencies:"true"});return e.entry&&o.set("file",`/${e.entry}`),{parameters:r,url:`https://codesandbox.io/api/v1/sandboxes/define?${o.toString()}`,options:e}}function nt(e){if(typeof window>"u")return br(e);let t=ot(e),r=(0,De.getParameters)({files:t}),o=e.entry||"src/App.tsx",n=document.createElement("form");n.method="POST",n.target="_blank",n.action="https://codesandbox.io/api/v1/sandboxes/define",n.style.display="none";let a=(l,i)=>{let d=document.createElement("input");d.type="hidden",d.name=l,d.value=i,n.appendChild(d)},c=new URLSearchParams({file:`/${o}`,eslint:"0",codemirror:"1",installDependencies:"true"});return a("query",c.toString()),a("parameters",r),document.body.appendChild(n),n.submit(),document.body.removeChild(n),{parameters:r,url:`https://codesandbox.io/api/v1/sandboxes/define?parameters=${r}`,options:e}}var st=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}};var W=require("react");function at(e){let{title:t,sandbox:r}=e,[o,n]=(0,W.useState)(!1),[a,c]=(0,W.useState)(!1),[l,i]=(0,W.useState)(!1),d=(0,W.useRef)(null),m=K(),p=(0,W.useCallback)(async()=>{let x=d.current?.textContent??"";st(x),n(!0),setTimeout(()=>n(!1),2e3)},[]),b=(0,W.useCallback)(()=>{let x=d.current?.textContent??"",P=m?.integrations?.sandbox?.config||{},N=typeof r=="object"?r:P,f=N.entry||"src/App.tsx";nt({title:t??"Code Snippet",...N,files:{...N.files,[f]:{content:x}}})},[t,m,r]);return(0,W.useEffect)(()=>{let x=d.current?.textContent?.length??0;i(x>120)},[e.children,e.highlightedHtml]),{copied:o,isExpanded:a,setIsExpanded:c,isExpandable:l,preRef:d,handleCopy:p,handleSandbox:b,shouldTruncate:l&&!a}}var pe=require("react/jsx-runtime");function xr(e){let{size:t=20,...r}=e;return{...r,width:t,height:t}}var it=e=>(0,pe.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...xr(e),children:[(0,pe.jsx)("title",{children:"CodeSandbox"}),(0,pe.jsx)("path",{d:"M0 24h24V0H0v2.455h21.546v19.09H2.454V0H0Z"})]});var Y=w(require("react-aria-components"));var V=require("react/jsx-runtime"),hr=({className:e,children:t,...r})=>(0,V.jsx)(Y.Tooltip,{...r,offset:8,className:o=>s("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(o):e),children:o=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Y.OverlayArrow,{children:(0,V.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,V.jsx)("title",{children:"Arrow"}),(0,V.jsx)("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(o):t]})}),ze=({content:e,children:t,delay:r=500,closeDelay:o=0,...n})=>(0,V.jsxs)(Y.TooltipTrigger,{delay:r,closeDelay:o,children:[t,(0,V.jsx)(hr,{...n,children:e})]});var T=require("react/jsx-runtime");function ee(e){let{children:t,sandbox:r,hideSandbox:o=!0,hideCopy:n=!1,highlightedHtml:a,...c}=e,d=!!K()?.integrations?.sandbox?.enable&&!o,{copied:m,isExpanded:p,setIsExpanded:b,isExpandable:x,preRef:P,handleCopy:N,handleSandbox:f,shouldTruncate:H}=at(e);return(0,T.jsxs)("div",{className:s("group relative my-6 overflow-hidden rounded-lg border border-border-subtle bg-(--color-code-bg)",H&&"[&>pre]:max-h-[250px] [&>pre]:overflow-hidden"),children:[(0,T.jsxs)("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:[d&&(0,T.jsx)(ze,{content:"Open in CodeSandbox",children:(0,T.jsx)(we.Button,{onPress:f,className:"grid place-items-center w-8 h-8 bg-transparent text-text-muted outline-none cursor-pointer transition-all duration-200 hover:scale-115 hover:text-sky-400 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2","aria-label":"Open in CodeSandbox",children:(0,T.jsx)(it,{size:20})})}),!n&&(0,T.jsx)(ze,{content:m?"Copied!":"Copy code",children:(0,T.jsx)(we.Button,{onPress:N,className:s("grid place-items-center w-8 h-8 bg-transparent outline-none cursor-pointer transition-all duration-200 hover:scale-115 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2",m?"text-emerald-400":"text-text-muted hover:text-text-main"),"aria-label":"Copy code",children:m?(0,T.jsx)(ke.Check,{size:20}):(0,T.jsx)(ke.Copy,{size:20})})})]}),a?(0,T.jsx)("div",{ref:P,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:a}}):(0,T.jsx)("pre",{ref:P,className:"m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]",...c,children:t}),x&&(0,T.jsx)("div",{className:s(H?"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,T.jsx)(we.Button,{onPress:()=>b(!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"})})]})}var te=require("react"),Z=w(require("react-aria-components"));var j=require("react");function lt({initialIndex:e=0,tabs:t}){let r=t[e]?.props.disabled?t.findIndex(d=>!d.props.disabled):e,[o,n]=(0,j.useState)(r===-1?0:r),a=(0,j.useRef)([]),[c,l]=(0,j.useState)({opacity:0,transform:"translateX(0)",width:0});(0,j.useEffect)(()=>{let d=a.current[o];d&&l({opacity:1,width:d.offsetWidth,transform:`translateX(${d.offsetLeft}px)`})},[o,t]);let i=(0,j.useCallback)(d=>{let m=0;if(d.key==="ArrowRight"?m=1:d.key==="ArrowLeft"&&(m=-1),m!==0){let p=(o+m+t.length)%t.length;for(;t[p].props.disabled&&p!==o;)p=(p+m+t.length)%t.length;p!==o&&!t[p].props.disabled&&(n(p),a.current[p]?.focus())}},[o,t]);return{active:o,setActive:n,tabRefs:a,indicatorStyle:c,handleKeyDown:i}}var He=require("class-variance-authority"),B=require("react/jsx-runtime"),vr=(0,He.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"}}),yr=(0,He.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 ct({children:e}){let t=typeof e=="string"?(0,B.jsx)(ee,{className:"language-bash",children:(0,B.jsx)("code",{children:e.trim()})}):e;return(0,B.jsx)("div",{className:"py-4",children:t})}function dt({defaultIndex:e=0,children:t}){let r=(0,te.useMemo)(()=>te.Children.toArray(t).filter(l=>(0,te.isValidElement)(l)&&l.props?.label),[t]),{active:o,setActive:n,tabRefs:a,indicatorStyle:c}=lt({initialIndex:e,tabs:r});return(0,B.jsx)("div",{className:"my-8 w-full group/tabs",children:(0,B.jsxs)(Z.Tabs,{selectedKey:o.toString(),onSelectionChange:l=>n(Number(l)),className:"w-full",children:[(0,B.jsxs)(Z.TabList,{"aria-label":"Content Tabs",className:s(vr()),children:[r.map((l,i)=>{let{label:d,icon:m,disabled:p}=l.props,b=i.toString();return(0,B.jsxs)(Z.Tab,{id:b,isDisabled:p,ref:x=>{a.current[i]=x},className:({isSelected:x,isDisabled:P})=>s(yr({isActive:x,isDisabled:P})),children:[!!m&&(0,B.jsx)("span",{className:"shrink-0 [&>svg]:w-4 [&>svg]:h-4",children:m}),(0,B.jsx)("span",{children:d})]},b)}),(0,B.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none",style:c,"aria-hidden":"true"})]}),r.map((l,i)=>(0,B.jsx)(Z.TabPanel,{id:i.toString(),children:r[i]},i))]})})}var re=require("react"),ue=require("react/jsx-runtime");function mt({src:e,poster:t,alt:r,children:o,controls:n,preload:a="metadata",...c}){let l=(0,re.useRef)(null),[i,d]=(0,re.useState)(!1);return(0,re.useEffect)(()=>{let m=l.current;if(!m)return;let p=new IntersectionObserver(([b])=>{b.isIntersecting&&(d(!0),p.disconnect())},{rootMargin:"200px"});return p.observe(m),()=>p.disconnect()},[]),(0,ue.jsx)("div",{ref:l,className:"my-6 overflow-hidden rounded-lg border border-border-subtle",children:i?(0,ue.jsxs)("video",{className:"block w-full h-auto",src:e,poster:t,controls:!0,preload:a,playsInline:!0,...c,children:[o,"Your browser does not support the video tag."]}):(0,ue.jsx)("div",{className:"aspect-video bg-bg-surface animate-pulse",role:"img","aria-label":r||"Video"})})}var pt=require("class-variance-authority"),ft=require("react/jsx-runtime"),Cr=(0,pt.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 ut({variant:e="default",children:t,className:r="",...o}){return(0,ft.jsx)("span",{className:s(Cr({variant:e}),r),...o,children:t})}var fe=require("react"),bt=w(require("react-aria-components"));var xt=require("class-variance-authority"),S=require("react/jsx-runtime"),Nr=(0,xt.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 gt({cols:e=3,children:t,className:r="",...o}){return(0,S.jsx)("div",{className:s(Nr({cols:e}),r),...o,children:t})}function ht({title:e,icon:t,href:r,children:o,className:n="",...a}){let c=(0,fe.useRef)(null),l=(0,fe.useRef)(null),i=(0,fe.useCallback)(p=>{let b=c.current||l.current;if(!b)return;let{left:x,top:P}=b.getBoundingClientRect();b.style.setProperty("--x",`${p.clientX-x}px`),b.style.setProperty("--y",`${p.clientY-P}px`)},[]),d=(0,S.jsxs)(S.Fragment,{children:[(0,S.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,S.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,S.jsxs)("div",{className:"space-y-1.5",children:[e&&(0,S.jsx)("h3",{className:"text-sm font-bold text-text-main",children:e}),o&&(0,S.jsx)("div",{className:"text-sm text-text-muted leading-relaxed",children:o})]})]}),m=s("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",n);return r?(0,S.jsx)(bt.Link,{ref:l,href:r,className:s(m,"no-underline cursor-pointer"),onMouseMove:i,...a,children:d}):(0,S.jsx)("div",{ref:c,role:"presentation",className:m,onMouseMove:i,...a,children:d})}var L=require("lucide-react");var yt=require("class-variance-authority"),y=require("react/jsx-runtime"),Rr={note:(0,y.jsx)(L.Bookmark,{size:18}),tip:(0,y.jsx)(L.Lightbulb,{size:18}),info:(0,y.jsx)(L.Info,{size:18}),warning:(0,y.jsx)(L.AlertTriangle,{size:18}),danger:(0,y.jsx)(L.ShieldAlert,{size:18}),important:(0,y.jsx)(L.Flame,{size:18}),caution:(0,y.jsx)(L.Zap,{size:18})},Pr={note:"Note",tip:"Tip",info:"Info",warning:"Warning",danger:"Danger",important:"Important",caution:"Caution"},vt=(0,yt.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 U({type:e="note",title:t,children:r,className:o="",...n}){return(0,y.jsxs)("div",{className:s(vt({type:e}),o),role:e==="warning"||e==="danger"?"alert":"note",...n,children:[(0,y.jsxs)("div",{className:"flex items-center flex-row gap-2 mb-2",children:[(0,y.jsx)("span",{className:s("shrink-0",vt({type:e})),children:Rr[e]}),(0,y.jsx)("span",{className:"text-sm font-bold tracking-tight text-text-main",children:t||Pr[e]})]}),(0,y.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0",children:r})]})}var Ct=e=>(0,y.jsx)(U,{type:"note",...e}),Nt=e=>(0,y.jsx)(U,{type:"tip",...e}),Rt=e=>(0,y.jsx)(U,{type:"warning",...e}),Pt=e=>(0,y.jsx)(U,{type:"danger",...e}),wt=e=>(0,y.jsx)(U,{type:"info",...e}),kt=e=>(0,y.jsx)(U,{type:"important",...e}),Tt=e=>(0,y.jsx)(U,{type:"caution",...e});var Te=require("react"),oe=require("lucide-react");var Ae=require("class-variance-authority"),$=require("react/jsx-runtime"),wr=(0,Ae.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}}),kr=(0,Ae.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}}),Tr=(0,Ae.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 Ar({icon:e,children:t,variant:r,dense:o}){return(0,$.jsxs)("li",{className:s(kr({variant:r,dense:o})),children:[e&&(0,$.jsx)("span",{className:s(Tr({variant:r==="bubble"?"bubble":"default"})),children:e}),(0,$.jsx)("div",{className:"flex-1 text-text-muted group-hover:text-text-main transition-colors",children:t})]})}var Lr={checked:e=>(0,$.jsx)(oe.Check,{size:14,className:s("text-emerald-500 shrink-0",e)}),arrow:e=>(0,$.jsx)(oe.ChevronRight,{size:14,className:s("text-primary-400 shrink-0",e)}),bubble:e=>(0,$.jsx)(oe.Circle,{size:6,fill:"currentColor",className:s("text-primary-500 shrink-0",e)}),default:()=>null,number:()=>null};function At({variant:e="default",cols:t=1,dense:r=!1,children:o,className:n,...a}){let c=t!==void 0&&Number(t)>1,l=Lr[e],i=wr({variant:e,cols:t,dense:r,isGrid:c,className:n}),d=e==="number"?"ol":"ul";return e==="default"||e==="number"?(0,$.jsx)(d,{className:i,...a,children:o}):(0,$.jsx)("ul",{className:i,...a,children:Te.Children.map(o,m=>{if(!(0,Te.isValidElement)(m))return m;let p=m,b=p.type==="li"?p.props.children:p.props.children||m;return(0,$.jsx)(Ar,{icon:l(),variant:e,dense:r,children:b})})})}var G=require("react"),_=w(require("react-aria-components")),D=require("lucide-react");var C=require("react/jsx-runtime"),be=16,xe=2,Fe={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 $e(e){return typeof e=="string"?e:typeof e=="number"?e.toString():Array.isArray(e)?e.map($e).join(""):(0,G.isValidElement)(e)&&e.props&&typeof e.props=="object"&&"children"in e.props?$e(e.props.children):""}function Ir(e,t){let r=e.toLowerCase(),o="shrink-0 transition-colors duration-200";if(t)return(0,C.jsx)(D.Folder,{size:be,strokeWidth:xe,className:s(o,"text-primary-400"),fill:"currentColor",fillOpacity:.15});let n=s(o,"text-text-dim group-hover:text-text-main");return Fe.CODE.test(r)?(0,C.jsx)(D.FileCode,{size:be,strokeWidth:xe,className:n}):Fe.TEXT.test(r)?(0,C.jsx)(D.FileText,{size:be,strokeWidth:xe,className:n}):Fe.IMAGE.test(r)?(0,C.jsx)(D.FileImage,{size:be,strokeWidth:xe,className:n}):(0,C.jsx)(D.File,{size:be,strokeWidth:xe,className:n})}function We(e,t){if(!(0,G.isValidElement)(e))return!1;let r=e.type;if(typeof r=="string")return r===t;if(typeof r=="function")return r.name===t||r.name?.toLowerCase()===t;let o=e.props;return o?.originalType===t||o?.mdxType===t}function Br(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function Le(e,t="root"){if(!(0,G.isValidElement)(e))return[];let r=[];if(We(e,"ul"))return G.Children.forEach(e.props.children,(o,n)=>{r.push(...Le(o,`${t}-${n}`))}),r;if(We(e,"li")){let o=G.Children.toArray(e.props.children),n=o.findIndex(P=>We(P,"ul")),a=n!==-1,c=a?o.slice(0,n):o,l=a?o.slice(n):[],i=$e(c),{name:d,comment:m}=Br(i),p=d.endsWith("/"),b=p?d.slice(0,-1):d,x=a||p;return r.push({id:`${t}-${b}`,name:b,comment:m,isFolder:x,children:a?Le(l[0],`${t}-${b}`):void 0}),r}return e.props&&typeof e.props=="object"&&"children"in e.props&&G.Children.forEach(e.props.children,(o,n)=>{r.push(...Le(o,`${t}-${n}`))}),r}function Lt({item:e}){return(0,C.jsxs)(_.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,C.jsx)(_.TreeItemContent,{children:({isExpanded:t,hasChildItems:r})=>(0,C.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,C.jsx)("div",{style:{width:"calc((var(--tree-item-level) - 1) * 1rem)"},className:"shrink-0"}),r?(0,C.jsx)(_.Button,{slot:"chevron",className:"outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors",children:(0,C.jsx)(D.ChevronRight,{size:14,strokeWidth:3,className:s("transition-transform duration-200",t&&"rotate-90")})}):(0,C.jsx)("div",{className:"w-[18px]"}),Ir(e.name,e.isFolder),(0,C.jsx)("span",{className:s("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,C.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,C.jsx)(_.Collection,{items:e.children,children:t=>(0,C.jsx)(Lt,{item:t})})]})}function It({children:e}){let t=(0,G.useMemo)(()=>Le(e),[e]);return(0,C.jsx)("div",{className:"my-8",children:(0,C.jsx)(_.Tree,{items:t,"aria-label":"File Tree",className:s("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:r=>(0,C.jsx)(Lt,{item:r})})})}var ge=w(require("react-aria-components"));var ne=require("react");function Bt({data:e,sortable:t=!1,paginated:r=!1,pageSize:o=10}){let[n,a]=(0,ne.useState)(null),[c,l]=(0,ne.useState)(1),i=(0,ne.useMemo)(()=>{if(!e)return[];let b=[...e];return t&&n!==null&&b.sort((x,P)=>{let N=x[n.key],f=P[n.key],H=typeof N=="string"?N:"",X=typeof f=="string"?f:"";return H<X?n.direction==="asc"?-1:1:H>X?n.direction==="asc"?1:-1:0}),b},[e,n,t]),d=Math.ceil(i.length/o),m=(0,ne.useMemo)(()=>{if(!r)return i;let b=(c-1)*o;return i.slice(b,b+o)},[i,r,c,o]);return{sortConfig:n,currentPage:c,setCurrentPage:l,totalPages:d,paginatedData:m,requestSort:b=>{if(!t)return;let x="asc";n&&n.key===b&&n.direction==="asc"&&(x="desc"),a({key:b,direction:x})}}}var M=require("lucide-react");var g=require("react/jsx-runtime");function St({headers:e,data:t,children:r,className:o="",sortable:n=!1,paginated:a=!1,pageSize:c=10}){let{sortConfig:l,currentPage:i,setCurrentPage:d,totalPages:m,paginatedData:p,requestSort:b}=Bt({data:t,sortable:n,paginated:a,pageSize:c}),x=N=>n?l?.key!==N?(0,g.jsx)(M.ChevronDown,{size:14,className:"ml-1 opacity-30"}):l.direction==="asc"?(0,g.jsx)(M.ChevronUp,{size:14,className:"ml-1 text-primary-400"}):(0,g.jsx)(M.ChevronDown,{size:14,className:"ml-1 text-primary-400"}):null,P=r||(0,g.jsxs)(g.Fragment,{children:[e&&(0,g.jsx)("thead",{children:(0,g.jsx)("tr",{children:e.map((N,f)=>(0,g.jsx)("th",{onClick:()=>b(f),className:s("text-left px-3 py-2.5 border-b-2 border-border-subtle text-text-main font-semibold text-sm",n&&"cursor-pointer select-none hover:text-primary-400 transition-colors"),children:(0,g.jsxs)("div",{className:"flex items-center",children:[N,x(f)]})},f))})}),p&&(0,g.jsx)("tbody",{children:p.map((N,f)=>(0,g.jsx)("tr",{className:"transition-colors hover:bg-bg-surface",children:N.map((H,X)=>(0,g.jsx)("td",{className:"px-3 py-2 border-b border-border-subtle text-sm text-text-muted",children:H},X))},f))})]});return(0,g.jsxs)("div",{className:s("my-6 rounded-lg border border-border-subtle overflow-hidden",o),children:[(0,g.jsx)("div",{className:"overflow-x-auto",children:(0,g.jsx)("table",{className:"w-full border-collapse text-sm",children:P})}),a&&m>1&&(0,g.jsxs)("div",{className:"flex items-center justify-between border-t border-border-subtle px-4 py-3",children:[(0,g.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",i," of ",m]}),(0,g.jsxs)("div",{className:"flex items-center gap-1",children:[(0,g.jsx)(ge.Button,{onPress:()=>d(1),isDisabled:i===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,g.jsx)(M.ChevronsLeft,{size:16})}),(0,g.jsx)(ge.Button,{onPress:()=>d(N=>Math.max(N-1,1)),isDisabled:i===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,g.jsx)(M.ChevronLeft,{size:16})}),(0,g.jsx)(ge.Button,{onPress:()=>d(N=>Math.min(N+1,m)),isDisabled:i===m,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,g.jsx)(M.ChevronRight,{size:16})}),(0,g.jsx)(ge.Button,{onPress:()=>d(m),isDisabled:i===m,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,g.jsx)(M.ChevronsRight,{size:16})})]})]})]})}var E=require("react/jsx-runtime");function Mt({name:e,type:t,defaultValue:r,required:o=!1,children:n,id:a,className:c=""}){return(0,E.jsxs)("article",{className:s("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",c),id:a,children:[(0,E.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,E.jsxs)("div",{className:"flex flex-wrap items-center gap-2.5",children:[(0,E.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,E.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}),o&&(0,E.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,E.jsx)("span",{className:"h-1 w-1 rounded-full bg-red-400 animate-pulse"}),"Required"]})]}),r&&(0,E.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,E.jsx)("span",{className:"font-semibold opacity-60 uppercase tracking-tighter",children:"Default"}),(0,E.jsx)("code",{className:"font-mono text-text-main font-medium",children:r})]})]}),(0,E.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30",children:n})]})}var _e=w(require("react")),Dt=require("react-aria-components"),zt=require("react-router-dom");var Ot=require("react-router-dom");var se=require("react"),Mr=require("react/jsx-runtime"),Sr=(0,se.createContext)({preload:()=>{},routes:[]});function Ie(){return(0,se.use)(Sr)}var Et=require("zustand"),Be=require("zustand/middleware"),Se=(0,Et.create)()((0,Be.persist)(e=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:t=>e({currentLocale:t}),setVersion:t=>e({currentVersion:t}),setHasHydrated:t=>e({hasHydrated:t})}),{name:"boltdocs-storage",storage:(0,Be.createJSONStorage)(()=>localStorage),partialize:e=>({currentLocale:e.currentLocale,currentVersion:e.currentVersion}),onRehydrateStorage:()=>e=>{e?.setHasHydrated(!0)}}));function Vt(){let{routes:e}=Ie(),t=K(),r=(0,Ot.useLocation)(),o=Se(f=>f.currentLocale),n=Se(f=>f.currentVersion),a=Se(f=>f.hasHydrated),c=e.find(f=>f.path===r.pathname),l=t.i18n?c?.locale||(a?o:void 0)||t.i18n.defaultLocale:void 0,i=t.versions?c?.version||(a?n:void 0)||t.versions.defaultVersion:void 0,d=e.filter(f=>{let H=t.i18n?(f.locale||t.i18n.defaultLocale)===l:!0,X=t.versions?(f.version||t.versions.defaultVersion)===i:!0;if(!(H&&X))return!1;let Ve=t.i18n;if(Ve){let sr=!!c?.locale,ar=!!f.locale;if(e.some(ye=>ye!==f&&ye.filePath===f.filePath&&ye.version===f.version&&(ye.locale||Ve.defaultLocale)===(f.locale||Ve.defaultLocale))&&sr!==ar)return!1}return!0}),p=t.i18n?.localeConfigs?.[l]?.label||t.i18n?.locales[l]||l,x=t.versions?.versions.find(f=>f.path===i)?.label||i,P=t.i18n?Object.entries(t.i18n.locales).map(([f,H])=>{let X=t.i18n?.localeConfigs?.[f];return{key:f,label:X?.label||H,isCurrent:f===l}}):[],N=t.versions?t.versions.versions.map(f=>({key:f.path,label:f.label,isCurrent:f.path===i})):[];return{routes:d,allRoutes:e,currentRoute:c,currentLocale:l,currentLocaleLabel:p,availableLocales:P,currentVersion:i,currentVersionLabel:x,availableVersions:N,config:t}}function Ge(e){let t=K(),{currentLocale:r,currentVersion:o}=Vt();if(!t||typeof e!="string"||e.startsWith("http")||e.startsWith("//"))return e;let n=t.i18n,a=t.versions;if(!n&&!a)return e;let c=e.startsWith("/docs"),l=e.split("/").filter(Boolean),i=0;l[i]==="docs"&&i++,a&&l.length>i&&a.versions.find(x=>x.path===l[i])&&i++,n&&l.length>i&&n.locales[l[i]]&&i++;let d=l.slice(i),m=[];c&&(m.push("docs"),a&&o&&m.push(o)),n&&r&&r!==n.defaultLocale&&m.push(r),m.push(...d);let p=`/${m.join("/")}`;return p.length>1&&p.endsWith("/")?p.slice(0,-1):p||"/"}var je=require("react/jsx-runtime"),ae=_e.default.forwardRef((e,t)=>{let{href:r,prefetch:o="hover",onMouseEnter:n,onFocus:a,...c}=e,l=Ge(r??""),{preload:i}=Ie();return(0,je.jsx)(Dt.Link,{...c,ref:t,href:l,onMouseEnter:p=>{n?.(p),o==="hover"&&typeof l=="string"&&l.startsWith("/")&&i(l)},onFocus:p=>{a?.(p),o==="hover"&&typeof l=="string"&&l.startsWith("/")&&i(l)}})});ae.displayName="Link";var Er=_e.default.forwardRef((e,t)=>{let{href:r,end:o=!1,className:n,children:a,...c}=e,l=(0,zt.useLocation)(),i=Ge(r??""),d=o?l.pathname===i:l.pathname.startsWith(i),m=typeof n=="function"?n({isActive:d}):s(n,d&&"active"),p=typeof a=="function"?a({isActive:d}):a;return(0,je.jsx)(ae,{...c,ref:t,href:r,className:m,children:p})});Er.displayName="NavLink";var Ft=require("react/jsx-runtime");function Ht({to:e,children:t,className:r="",...o}){let n=e&&(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")),a=s("text-blue-600 hover:text-blue-800 hover:underline cursor-pointer",r);return(0,Ft.jsx)(ae,{href:e,className:a,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,...o,children:t})}var ie=require("react"),Vr=require("react/jsx-runtime"),Or=(0,ie.createContext)(void 0);function Wt(){let e=(0,ie.use)(Or);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}var Gt=require("react/jsx-runtime");function $t({src:e,alt:t,theme:r,...o}){let{theme:n}=Wt();return r&&r!==n?null:(0,Gt.jsx)("img",{src:e,alt:t||"",...o})}var v=require("react/jsx-runtime");function _t({title:e,props:t,className:r=""}){return(0,v.jsxs)("div",{className:s("my-6",r),children:[e&&(0,v.jsx)("h3",{className:"text-base font-bold text-text-main mb-3",children:e}),(0,v.jsx)("div",{className:"overflow-x-auto rounded-lg border border-border-subtle",children:(0,v.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,v.jsx)("thead",{children:(0,v.jsxs)("tr",{children:[(0,v.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,v.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,v.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,v.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,v.jsx)("tbody",{children:t.map((o,n)=>(0,v.jsxs)("tr",{className:"transition-colors hover:bg-bg-surface",children:[(0,v.jsxs)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:[(0,v.jsx)("code",{className:"rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400",children:o.name}),o.required&&(0,v.jsx)("span",{className:"ml-1 text-red-400 font-bold",children:"*"})]}),(0,v.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:(0,v.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted",children:o.type})}),(0,v.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:o.defaultValue?(0,v.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400",children:o.defaultValue}):(0,v.jsx)("span",{className:"text-text-dim",children:"\u2014"})}),(0,v.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle text-text-muted",children:o.description})]},`${o.name}-${n}`))})]})})]})}var Ue=require("react");function jt(e){let{code:t,children:r,preview:o}=e,n=(0,Ue.useMemo)(()=>(t??(typeof r=="string"?r:"")).trim(),[t,r]),a=(0,Ue.useMemo)(()=>o??(typeof r!="string"?r:null),[o,r]);return{initialCode:n,previewElement:a}}var le=require("react/jsx-runtime");function Ut(e){let{highlightedHtml:t,hideCode:r=!1,hideSandbox:o=!1,hideCopy:n=!1,sandboxOptions:a={}}=e,{initialCode:c,previewElement:l}=jt(e);return(0,le.jsxs)("div",{className:"my-6 overflow-hidden rounded-xl border border-border-subtle",children:[(0,le.jsx)("div",{className:"flex items-center justify-center p-8 bg-bg-surface",children:l}),!r&&(0,le.jsx)("div",{className:"border-t border-border-subtle",children:(0,le.jsx)(ee,{hideSandbox:o,hideCopy:n,title:a.title,lang:"tsx",highlightedHtml:t,children:c})})]})}var or=require("react"),q=require("lucide-react");var qt=require("react");var Dr=require("react-aria-components"),he=require("lucide-react");var Xt=require("react/jsx-runtime");var ve=w(require("react-aria-components")),zr=require("lucide-react");var Ke=require("react/jsx-runtime");var k=w(require("react-aria-components")),J=require("lucide-react");var h=require("react/jsx-runtime"),Hr=({children:e,isOpen:t,onOpenChange:r,className:o})=>(0,h.jsx)(k.ModalOverlay,{isOpen:t,onOpenChange:r,isDismissable:!0,className:s("fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20","entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out"),children:(0,h.jsx)(k.Modal,{className:s("mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",o),children:(0,h.jsx)(k.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Fr=({children:e,className:t,onSelectionChange:r,...o})=>(0,h.jsx)("div",{className:t,children:(0,h.jsx)(k.Autocomplete,{...o,onSelectionChange:r,className:"flex flex-col min-h-0",children:e})}),Wr=({className:e,...t})=>(0,h.jsxs)(k.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[(0,h.jsx)(J.Search,{className:"h-5 w-5 text-text-muted"}),(0,h.jsx)(k.Input,{...t,className:s("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),(0,h.jsx)("div",{className:"flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted",children:(0,h.jsx)("kbd",{className:"font-sans",children:"ESC"})})]}),$r=({children:e,className:t,...r})=>(0,h.jsx)(k.ListBox,{...r,className:s("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),Gr=({children:e,className:t,...r})=>(0,h.jsx)(k.ListBoxItem,{...r,className:s("group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors","text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white",t),children:o=>(0,h.jsxs)(h.Fragment,{children:[e,(o.isFocused||o.isSelected)&&(0,h.jsxs)("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[(0,h.jsx)("span",{className:"text-[10px]",children:"Select"}),(0,h.jsx)(J.CornerDownLeft,{size:10})]})]})}),_r=({isHeading:e,className:t})=>(0,h.jsx)("div",{className:s("shrink-0",t),children:e?(0,h.jsx)(J.Hash,{size:18}):(0,h.jsx)(J.FileText,{size:18})}),jr=({children:e,className:t})=>(0,h.jsx)("span",{className:s("block font-medium truncate flex-1 text-sm",t),children:e}),Ur=({children:e,className:t})=>(0,h.jsx)("span",{className:s("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),bs={Root:Hr,Autocomplete:Fr,Input:Wr,List:$r,Item:Object.assign(Gr,{Icon:_r,Title:jr,Bio:Ur})};var O=require("react"),qr=w(require("scroll-into-view-if-needed"));var Kt=require("react");var Zt=require("react/jsx-runtime"),As=(0,O.createContext)(null),Ls=(0,O.createContext)(null);function Xr(e){let[t,r]=(0,O.useState)({isOverflowing:!1,isAtBottom:!1});return(0,O.useEffect)(()=>{let o=e.current;if(!o)return;let n=()=>{let c=o.scrollHeight>o.clientHeight,l=o.scrollHeight-o.scrollTop<=o.clientHeight+2;r({isOverflowing:c,isAtBottom:l})};n(),o.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n);let a=new MutationObserver(n);return a.observe(o,{childList:!0,subtree:!0}),()=>{o.removeEventListener("scroll",n),window.removeEventListener("resize",n),a.disconnect()}},[e]),t}var Kr=({children:e,className:t,ref:r,...o})=>{let n=(0,O.useRef)(null);(0,O.useImperativeHandle)(r,()=>n.current);let{isOverflowing:a,isAtBottom:c}=Xr(n);return(0,Zt.jsx)("div",{ref:n,className:s("relative overflow-y-auto boltdocs-otp-content",a&&!c&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...o,children:e})};Kr.displayName="OnThisPageContent";var Jt=w(require("react-aria-components")),Oe=require("lucide-react");var z=require("react/jsx-runtime"),Zr=({children:e,className:t})=>(0,z.jsx)("nav",{className:s("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),Jr=({children:e,to:t,direction:r,className:o})=>{let n=r==="next";return(0,z.jsxs)(Jt.Link,{href:t,className:s("flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none","transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg","focus-visible:ring-2 focus-visible:ring-primary-500/30",n?"text-right justify-end":"text-left justify-start",o),children:[!n&&(0,z.jsx)(Oe.ChevronLeft,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),(0,z.jsx)("div",{className:"flex flex-col gap-1 flex-1",children:e}),n&&(0,z.jsx)(Oe.ChevronRight,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},Qr=({children:e,className:t})=>(0,z.jsx)("span",{className:s("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),Yr=({children:e,className:t})=>(0,z.jsx)("span",{className:s("text-base font-bold text-text-main truncate",t),children:e}),eo=({children:e})=>(0,z.jsx)(z.Fragment,{children:e}),Ms={PageNavRoot:Zr,PageNavLink:Object.assign(Jr,{Title:Qr,Description:Yr,Icon:eo})};var to=require("react/jsx-runtime");var ro=w(require("react-aria-components")),oo=require("lucide-react");var Qt=require("react/jsx-runtime");var Ze=require("react-aria-components"),no=require("lucide-react");var so=require("react/jsx-runtime");var er=require("react/jsx-runtime"),Yt=({children:e,className:t,vertical:r=!1})=>(0,er.jsx)("div",{className:s("inline-flex",r?"flex-col":"flex-row",!r&&["[&>*: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"]],r&&["[&>*: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});var me=require("lucide-react"),rr=w(require("react")),A=w(require("react-aria-components"));var de=w(require("react-aria-components"));var ce=require("react/jsx-runtime"),tr=({children:e,className:t,showArrow:r,...o})=>(0,ce.jsxs)(de.Popover,{offset:8,...o,className:de.composeRenderProps(t,n=>s("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards",n)),children:[r&&(0,ce.jsx)(de.OverlayArrow,{className:"group",children:(0,ce.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,ce.jsx)("path",{d:"M0 0 L6 6 L12 0"})})}),e]});var I=require("react/jsx-runtime");function qe(e){let[t,r]=rr.default.Children.toArray(e.children).slice(0,2);return(0,I.jsxs)(A.MenuTrigger,{...e,children:[t,(0,I.jsx)(tr,{placement:e.placement,className:"min-w-[200px]",children:r})]})}function Xe(e){return(0,I.jsx)(A.Menu,{...e,className:A.composeRenderProps(e.className,t=>s("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function Me(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return(0,I.jsx)(A.MenuItem,{...e,textValue:t,className:A.composeRenderProps(e.className,(r,{isFocused:o,isPressed:n,isDisabled:a})=>s("group relative flex flex-row items-center gap-2.5 px-3 py-1.5 rounded-lg outline-none cursor-default transition-all duration-200","text-text-main text-[0.8125rem]",o&&"bg-primary-500/10 text-primary-600 shadow-sm",n&&"scale-[0.98] bg-primary-500/15",a&&"opacity-40 grayscale pointer-events-none",r)),children:A.composeRenderProps(e.children,(r,{selectionMode:o,isSelected:n,hasSubmenu:a})=>(0,I.jsxs)(I.Fragment,{children:[o!=="none"&&(0,I.jsxs)("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[n&&o==="multiple"&&(0,I.jsx)(me.Check,{className:"w-3.5 h-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),n&&o==="single"&&(0,I.jsx)(me.Dot,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),(0,I.jsx)("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:r}),a&&(0,I.jsx)(me.ChevronRight,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}var Ee=require("react-aria-components");var R=require("react/jsx-runtime"),ao=e=>{let[t,r]=(0,or.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},handleOpenRaw:()=>{let a=new Blob([e],{type:"text/plain;charset=utf-8"}),c=URL.createObjectURL(a);window.open(c,"_blank")}}};function nr({content:e,mdxRaw:t,config:r}){let o=t||e||"",{copied:n,handleCopy:a,handleOpenRaw:c}=ao(o),l=r!==!1,i=typeof r=="object"&&r.text||"Copy Markdown";return!l||!o?null:(0,R.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,R.jsxs)(Yt,{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,R.jsx)(Q,{variant:"ghost",onPress:a,icon:n?(0,R.jsx)(q.Check,{size:16}):(0,R.jsx)(q.Copy,{size:16}),iconPosition:"left",className:s("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",n&&"text-emerald-500 hover:bg-emerald-500/5"),children:n?"Copied!":i}),(0,R.jsxs)(qe,{placement:"bottom end",children:[(0,R.jsx)(Q,{variant:"ghost",isIconOnly:!0,icon:(0,R.jsx)(q.ChevronDown,{size:14}),className:s("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,R.jsxs)(Xe,{className:"w-52",children:[(0,R.jsxs)(Me,{onAction:a,className:"flex flex-row items-start gap-2.5 group",children:[(0,R.jsx)(q.Copy,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),(0,R.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"Copy Markdown"})]}),(0,R.jsxs)(Me,{onAction:c,className:"flex flex-row items-start gap-2.5 group",children:[(0,R.jsx)(q.ExternalLink,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),(0,R.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"View as Markdown"})]})]})]})]})})}
1
+ "use strict";var hr=Object.create;var Ae=Object.defineProperty;var vr=Object.getOwnPropertyDescriptor;var yr=Object.getOwnPropertyNames;var Cr=Object.getPrototypeOf,Rr=Object.prototype.hasOwnProperty;var Nr=(e,t)=>{for(var r in t)Ae(e,r,{get:t[r],enumerable:!0})},lt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of yr(t))!Rr.call(e,n)&&n!==r&&Ae(e,n,{get:()=>t[n],enumerable:!(o=vr(t,n))||o.enumerable});return e};var T=(e,t,r)=>(r=e!=null?hr(Cr(e)):{},lt(t||!e||!e.__esModule?Ae(r,"default",{value:e,enumerable:!0}):r,e)),Pr=e=>lt(Ae({},"__esModule",{value:!0}),e);var yo={};Nr(yo,{Admonition:()=>U,Badge:()=>Pt,Button:()=>mt,Card:()=>Lt,Cards:()=>At,Caution:()=>Dt,CodeBlock:()=>ae,ComponentPreview:()=>or,ComponentProps:()=>tr,CopyMarkdown:()=>gr,Danger:()=>Ot,Field:()=>Gt,FileTree:()=>Wt,Image:()=>Qt,Important:()=>zt,InfoBox:()=>Vt,Link:()=>Xt,List:()=>Ht,Note:()=>It,Tab:()=>yt,Table:()=>$t,Tabs:()=>Ct,Tip:()=>Mt,Video:()=>Rt,Warning:()=>Et});module.exports=Pr(yo);var Se=T(require("react-aria-components"));var ct=require("clsx"),dt=require("tailwind-merge");function s(...e){return(0,dt.twMerge)((0,ct.clsx)(e))}var pt=require("class-variance-authority"),F=require("react/jsx-runtime"),Le=(0,pt.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"}}),ye=({href:e,icon:t,iconPosition:r="left",isIconOnly:o,children:n,className:a,variant:c,size:l,rounded:i,iconSize:d,disabled:m,...u})=>{let x=o||!n&&!!t,g=x?(0,F.jsx)("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):(0,F.jsxs)(F.Fragment,{children:[t&&r==="left"&&(0,F.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),(0,F.jsx)("span",{className:"flex items-center",children:n}),t&&r==="right"&&(0,F.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?(0,F.jsx)(Se.Link,{href:e,className:s(Le({variant:c,size:l,rounded:i,iconSize:x?d:void 0,disabled:m}),a),...u,children:g}):(0,F.jsx)(Se.Button,{className:s(Le({variant:c,size:l,rounded:i,iconSize:x?d:void 0,disabled:m}),a),...u,children:g})};var ut=require("react/jsx-runtime"),mt=({className:e,variant:t,size:r,rounded:o,iconSize:n,disabled:a,...c})=>(0,ut.jsx)(ye,{className:s("group",Le({variant:t,size:r,rounded:o,iconSize:n,disabled:a,className:e})),...c});var ze=T(require("react-aria-components")),se=require("lucide-react");var Be=require("react"),wr=(0,Be.createContext)(null);function Y(){let e=(0,Be.use)(wr);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}var Ue=require("codesandbox/lib/api/define.js");function ft(e){let t=e.files||{},r=e.dependencies||{},o=e.devDependencies||{},n=e.title||"codesandbox-project",a=e.description||"Generic Sandbox",c={};for(let[l,i]of Object.entries(t)){let d=typeof i.content=="object"?JSON.stringify(i.content,null,2):i.content;c[l]={content:d,isBinary:i.isBinary??!1}}if(!c["package.json"]){let i=e.template==="vite"||!!o.vite||!!o["@vitejs/plugin-react"]?{dev:"vite",build:"vite build",preview:"vite preview"}:{start:"node index.js"};c["package.json"]={content:JSON.stringify({private:!0,name:n,description:a,type:"module",version:"1.0.0",scripts:e.scripts||i,dependencies:r,devDependencies:o},null,2),isBinary:!1}}return c}function kr(e){let t=ft(e),r=(0,Ue.getParameters)({files:t}),o=new URLSearchParams({parameters:r,installDependencies:"true"});return e.entry&&o.set("file",`/${e.entry}`),{parameters:r,url:`https://codesandbox.io/api/v1/sandboxes/define?${o.toString()}`,options:e}}function xt(e){if(typeof window>"u")return kr(e);let t=ft(e),r=(0,Ue.getParameters)({files:t}),o=e.entry||"src/App.tsx",n=document.createElement("form");n.method="POST",n.target="_blank",n.action="https://codesandbox.io/api/v1/sandboxes/define",n.style.display="none";let a=(l,i)=>{let d=document.createElement("input");d.type="hidden",d.name=l,d.value=i,n.appendChild(d)},c=new URLSearchParams({file:`/${o}`,eslint:"0",codemirror:"1",installDependencies:"true"});return a("query",c.toString()),a("parameters",r),document.body.appendChild(n),n.submit(),document.body.removeChild(n),{parameters:r,url:`https://codesandbox.io/api/v1/sandboxes/define?parameters=${r}`,options:e}}var bt=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}};var W=require("react");function gt(e){let{title:t,sandbox:r}=e,[o,n]=(0,W.useState)(!1),[a,c]=(0,W.useState)(!1),[l,i]=(0,W.useState)(!1),d=(0,W.useRef)(null),m=Y(),u=(0,W.useCallback)(async()=>{let g=d.current?.textContent??"";bt(g),n(!0),setTimeout(()=>n(!1),2e3)},[]),x=(0,W.useCallback)(()=>{let g=d.current?.textContent??"",w=m?.integrations?.sandbox?.config||{},R=typeof r=="object"?r:w,f=R.entry||"src/App.tsx";xt({title:t??"Code Snippet",...R,files:{...R.files,[f]:{content:g}}})},[t,m,r]);return(0,W.useEffect)(()=>{let g=d.current?.textContent?.length??0;i(g>120)},[e.children,e.highlightedHtml]),{copied:o,isExpanded:a,setIsExpanded:c,isExpandable:l,preRef:d,handleCopy:u,handleSandbox:x,shouldTruncate:l&&!a}}var b=require("react/jsx-runtime");function _(e){let{size:t=20,...r}=e;return{...r,width:t,height:t}}var ht=e=>(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",..._(e),children:[(0,b.jsx)("title",{children:"CodeSandbox"}),(0,b.jsx)("path",{d:"M0 24h24V0H0v2.455h21.546v19.09H2.454V0H0Z"})]});var Ie=e=>(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",..._(e),children:[(0,b.jsx)("title",{children:"TypeScript"}),(0,b.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"})]}),Me=e=>(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",..._(e),children:[(0,b.jsx)("title",{children:"JavaScript"}),(0,b.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"})]}),Ee=e=>(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",..._(e),children:[(0,b.jsx)("title",{children:"JSON"}),(0,b.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"})]}),Oe=e=>(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",..._(e),children:[(0,b.jsx)("title",{children:"CSS"}),(0,b.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"})]}),Ve=e=>(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",..._(e),children:[(0,b.jsx)("title",{children:"HTML"}),(0,b.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"})]});var ee=e=>(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",..._(e),children:[(0,b.jsx)("title",{children:"React"}),(0,b.jsx)("path",{fill:"#0E8ADC",d:"M12 13.677a1.677 1.677 0 100-3.354 1.677 1.677 0 000 3.354z"}),(0,b.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,b.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,b.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"})]}),te=e=>(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",..._(e),children:[(0,b.jsx)("title",{children:"Markdown"}),(0,b.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"})]}),re=e=>(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 25 24",..._(e),children:[(0,b.jsx)("title",{children:"Shell"}),(0,b.jsx)("path",{stroke:"#14B8A6",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4.336 17l6-6-6-6M12.336 19h8"})]}),oe=e=>(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",..._(e),children:[(0,b.jsx)("title",{children:"YAML"}),(0,b.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"})]});var ne=T(require("react-aria-components"));var V=require("react/jsx-runtime"),Ar=({className:e,children:t,...r})=>(0,V.jsx)(ne.Tooltip,{...r,offset:8,className:o=>s("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(o):e),children:o=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ne.OverlayArrow,{children:(0,V.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,V.jsx)("title",{children:"Arrow"}),(0,V.jsx)("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(o):t]})}),Xe=({content:e,children:t,delay:r=500,closeDelay:o=0,...n})=>(0,V.jsxs)(ne.TooltipTrigger,{delay:r,closeDelay:o,children:[t,(0,V.jsx)(Ar,{...n,children:e})]});var P=require("react/jsx-runtime"),Lr={ts:Ie,tsx:ee,js:Me,jsx:ee,json:Ee,css:Oe,html:Ve,md:te,mdx:te,bash:re,sh:re,yaml:oe,yml:oe};function ae(e){let{children:t,sandbox:r,hideSandbox:o=!0,hideCopy:n=!1,highlightedHtml:a,title:c,"data-lang":l,plain:i=!1,...d}=e,x=!!Y()?.integrations?.sandbox?.enable&&!o,g=e.lang||l||"",{copied:w,isExpanded:R,setIsExpanded:f,isExpandable:G,preRef:H,handleCopy:ve,handleSandbox:Je,shouldTruncate:ke}=gt(e),Ke=Lr[g];return(0,P.jsxs)("div",{className:s("group relative overflow-hidden bg-(--color-code-bg)","contain-layout contain-paint",{"my-6 rounded-lg border border-border-subtle":!i,"[&>pre]:max-h-62.5 [&>pre]:overflow-hidden":ke},e.className),children:[c&&(0,P.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:[Ke?(0,P.jsx)(Ke,{size:14}):(0,P.jsx)(se.File,{size:14,className:"opacity-60"}),(0,P.jsx)("span",{children:c})]}),(0,P.jsxs)("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:[x&&(0,P.jsx)(Xe,{content:"Open in CodeSandbox",children:(0,P.jsx)(ze.Button,{onPress:Je,className:"grid place-items-center w-8 h-8 bg-transparent text-text-muted outline-none cursor-pointer transition-all duration-200 hover:scale-115 hover:text-sky-400 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2","aria-label":"Open in CodeSandbox",children:(0,P.jsx)(ht,{size:20})})}),!n&&(0,P.jsx)(Xe,{content:w?"Copied!":"Copy code",children:(0,P.jsx)(ze.Button,{onPress:ve,className:s("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",w?"text-emerald-400":"text-text-muted hover:text-text-main"),"aria-label":"Copy code",children:w?(0,P.jsx)(se.Check,{size:20}):(0,P.jsx)(se.Copy,{size:20})})})]}),a?(0,P.jsx)("div",{ref:H,className:"shiki-wrapper [&>pre]:m-0! [&>pre]:rounded-none! [&>pre]:border-none! [&>pre]:bg-inherit! [&>pre>code]:grid! [&>pre>code]:p-5! [&>.shiki.shiki-themes]:bg-transparent!",dangerouslySetInnerHTML:{__html:a}}):(0,P.jsx)("pre",{ref:H,className:"m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]",...d,children:t}),G&&(0,P.jsx)("div",{className:s(ke?"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,P.jsx)(ze.Button,{onPress:()=>f(!R),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:R?"Show less":"Expand code"})})]})}var ie=require("react"),Z=T(require("react-aria-components"));var K=require("react");function vt({initialIndex:e=0,tabs:t}){let r=t[e]?.props.disabled?t.findIndex(d=>!d.props.disabled):e,[o,n]=(0,K.useState)(r===-1?0:r),a=(0,K.useRef)([]),[c,l]=(0,K.useState)({opacity:0,transform:"translateX(0)",width:0});(0,K.useEffect)(()=>{let d=a.current[o];d&&l({opacity:1,width:d.offsetWidth,transform:`translateX(${d.offsetLeft}px)`})},[o,t]);let i=(0,K.useCallback)(d=>{let m=0;if(d.key==="ArrowRight"?m=1:d.key==="ArrowLeft"&&(m=-1),m!==0){let u=(o+m+t.length)%t.length;for(;t[u].props.disabled&&u!==o;)u=(u+m+t.length)%t.length;u!==o&&!t[u].props.disabled&&(n(u),a.current[u]?.focus())}},[o,t]);return{active:o,setActive:n,tabRefs:a,indicatorStyle:c,handleKeyDown:i}}var Ye=require("class-variance-authority"),I=require("react/jsx-runtime"),Sr=(0,Ye.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"}}),Br=(0,Ye.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 yt({children:e}){let t=typeof e=="string"?(0,I.jsx)(ae,{className:"language-bash",children:(0,I.jsx)("code",{children:e.trim()})}):e;return(0,I.jsx)("div",{className:"py-4",children:t})}function Ct({defaultIndex:e=0,children:t}){let r=(0,ie.useMemo)(()=>ie.Children.toArray(t).filter(l=>(0,ie.isValidElement)(l)&&l.props?.label),[t]),{active:o,setActive:n,tabRefs:a,indicatorStyle:c}=vt({initialIndex:e,tabs:r});return(0,I.jsx)("div",{className:"my-8 w-full group/tabs",children:(0,I.jsxs)(Z.Tabs,{selectedKey:o.toString(),onSelectionChange:l=>n(Number(l)),className:"w-full",children:[(0,I.jsxs)(Z.TabList,{"aria-label":"Content Tabs",className:s(Sr()),children:[r.map((l,i)=>{let{label:d,icon:m,disabled:u}=l.props,x=i.toString();return(0,I.jsxs)(Z.Tab,{id:x,isDisabled:u,ref:g=>{a.current[i]=g},className:({isSelected:g,isDisabled:w})=>s(Br({isActive:g,isDisabled:w})),children:[!!m&&(0,I.jsx)("span",{className:"shrink-0 [&>svg]:w-4 [&>svg]:h-4",children:m}),(0,I.jsx)("span",{children:d})]},x)}),(0,I.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none",style:c,"aria-hidden":"true"})]}),r.map((l,i)=>(0,I.jsx)(Z.TabPanel,{id:i.toString(),children:r[i]},i))]})})}var le=require("react"),Ce=require("react/jsx-runtime");function Rt({src:e,poster:t,alt:r,children:o,controls:n,preload:a="metadata",...c}){let l=(0,le.useRef)(null),[i,d]=(0,le.useState)(!1);return(0,le.useEffect)(()=>{let m=l.current;if(!m)return;let u=new IntersectionObserver(([x])=>{x.isIntersecting&&(d(!0),u.disconnect())},{rootMargin:"200px"});return u.observe(m),()=>u.disconnect()},[]),(0,Ce.jsx)("div",{ref:l,className:"my-6 overflow-hidden rounded-lg border border-border-subtle",children:i?(0,Ce.jsxs)("video",{className:"block w-full h-auto",src:e,poster:t,controls:!0,preload:a,playsInline:!0,...c,children:[o,"Your browser does not support the video tag."]}):(0,Ce.jsx)("div",{className:"aspect-video bg-bg-surface animate-pulse",role:"img","aria-label":r||"Video"})})}var Nt=require("class-variance-authority"),wt=require("react/jsx-runtime"),Ir=(0,Nt.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 Pt({variant:e="default",children:t,className:r="",...o}){return(0,wt.jsx)("span",{className:s(Ir({variant:e}),r),...o,children:t})}var Re=require("react"),kt=T(require("react-aria-components"));var Tt=require("class-variance-authority"),M=require("react/jsx-runtime"),Mr=(0,Tt.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 At({cols:e=3,children:t,className:r="",...o}){return(0,M.jsx)("div",{className:s(Mr({cols:e}),r),...o,children:t})}function Lt({title:e,icon:t,href:r,children:o,className:n="",...a}){let c=(0,Re.useRef)(null),l=(0,Re.useRef)(null),i=(0,Re.useCallback)(u=>{let x=c.current||l.current;if(!x)return;let{left:g,top:w}=x.getBoundingClientRect();x.style.setProperty("--x",`${u.clientX-g}px`),x.style.setProperty("--y",`${u.clientY-w}px`)},[]),d=(0,M.jsxs)(M.Fragment,{children:[(0,M.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,M.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,M.jsxs)("div",{className:"space-y-1.5",children:[e&&(0,M.jsx)("h3",{className:"text-sm font-bold text-text-main",children:e}),o&&(0,M.jsx)("div",{className:"text-sm text-text-muted leading-relaxed",children:o})]})]}),m=s("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",n);return r?(0,M.jsx)(kt.Link,{ref:l,href:r,className:s(m,"no-underline cursor-pointer"),onMouseMove:i,...a,children:d}):(0,M.jsx)("div",{ref:c,role:"presentation",className:m,onMouseMove:i,...a,children:d})}var S=require("lucide-react");var Bt=require("class-variance-authority"),N=require("react/jsx-runtime"),Er={note:(0,N.jsx)(S.Bookmark,{size:18}),tip:(0,N.jsx)(S.Lightbulb,{size:18}),info:(0,N.jsx)(S.Info,{size:18}),warning:(0,N.jsx)(S.AlertTriangle,{size:18}),danger:(0,N.jsx)(S.ShieldAlert,{size:18}),important:(0,N.jsx)(S.Flame,{size:18}),caution:(0,N.jsx)(S.Zap,{size:18})},Or={note:"Note",tip:"Tip",info:"Info",warning:"Warning",danger:"Danger",important:"Important",caution:"Caution"},St=(0,Bt.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 U({type:e="note",title:t,children:r,className:o="",...n}){return(0,N.jsxs)("div",{className:s(St({type:e}),o),role:e==="warning"||e==="danger"?"alert":"note",...n,children:[(0,N.jsxs)("div",{className:"flex items-center flex-row gap-2 mb-2",children:[(0,N.jsx)("span",{className:s("shrink-0",St({type:e})),children:Er[e]}),(0,N.jsx)("span",{className:"text-sm font-bold tracking-tight text-text-main",children:t||Or[e]})]}),(0,N.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0",children:r})]})}var It=e=>(0,N.jsx)(U,{type:"note",...e}),Mt=e=>(0,N.jsx)(U,{type:"tip",...e}),Et=e=>(0,N.jsx)(U,{type:"warning",...e}),Ot=e=>(0,N.jsx)(U,{type:"danger",...e}),Vt=e=>(0,N.jsx)(U,{type:"info",...e}),zt=e=>(0,N.jsx)(U,{type:"important",...e}),Dt=e=>(0,N.jsx)(U,{type:"caution",...e});var De=require("react"),ce=require("lucide-react");var He=require("class-variance-authority"),j=require("react/jsx-runtime"),Vr=(0,He.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}}),zr=(0,He.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}}),Dr=(0,He.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 Hr({icon:e,children:t,variant:r,dense:o}){return(0,j.jsxs)("li",{className:s(zr({variant:r,dense:o})),children:[e&&(0,j.jsx)("span",{className:s(Dr({variant:r==="bubble"?"bubble":"default"})),children:e}),(0,j.jsx)("div",{className:"flex-1 text-text-muted group-hover:text-text-main transition-colors",children:t})]})}var Fr={checked:e=>(0,j.jsx)(ce.Check,{size:14,className:s("text-emerald-500 shrink-0",e)}),arrow:e=>(0,j.jsx)(ce.ChevronRight,{size:14,className:s("text-primary-400 shrink-0",e)}),bubble:e=>(0,j.jsx)(ce.Circle,{size:6,fill:"currentColor",className:s("text-primary-500 shrink-0",e)}),default:()=>null,number:()=>null};function Ht({variant:e="default",cols:t=1,dense:r=!1,children:o,className:n,...a}){let c=t!==void 0&&Number(t)>1,l=Fr[e],i=Vr({variant:e,cols:t,dense:r,isGrid:c,className:n}),d=e==="number"?"ol":"ul";return e==="default"||e==="number"?(0,j.jsx)(d,{className:i,...a,children:o}):(0,j.jsx)("ul",{className:i,...a,children:De.Children.map(o,m=>{if(!(0,De.isValidElement)(m))return m;let u=m,x=u.type==="li"?u.props.children:u.props.children||m;return(0,j.jsx)(Hr,{icon:l(),variant:e,dense:r,children:x})})})}var q=require("react"),J=T(require("react-aria-components")),z=require("lucide-react");var C=require("react/jsx-runtime"),de=16,Ne=2,Wr={ts:Ie,tsx:ee,js:Me,jsx:ee,json:Ee,css:Oe,html:Ve,md:te,mdx:te,bash:re,sh:re,yaml:oe,yml:oe},Ze={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 et(e){return typeof e=="string"?e:typeof e=="number"?e.toString():Array.isArray(e)?e.map(et).join(""):(0,q.isValidElement)(e)&&e.props&&typeof e.props=="object"&&"children"in e.props?et(e.props.children):""}function jr(e,t){let r=e.toLowerCase(),o="shrink-0 transition-colors duration-200";if(t)return(0,C.jsx)(z.Folder,{size:de,strokeWidth:Ne,className:s(o,"text-primary-400"),fill:"currentColor",fillOpacity:.15});let n=r.split(".").pop()||"",a=Wr[n];if(a)return(0,C.jsx)(a,{size:de});let c=s(o,"text-text-dim group-hover:text-text-main");return Ze.CODE.test(r)?(0,C.jsx)(z.FileCode,{size:de,strokeWidth:Ne,className:c}):Ze.TEXT.test(r)?(0,C.jsx)(z.FileText,{size:de,strokeWidth:Ne,className:c}):Ze.IMAGE.test(r)?(0,C.jsx)(z.FileImage,{size:de,strokeWidth:Ne,className:c}):(0,C.jsx)(z.File,{size:de,strokeWidth:Ne,className:c})}function Qe(e,t){if(!(0,q.isValidElement)(e))return!1;let r=e.type;if(typeof r=="string")return r===t;if(typeof r=="function")return r.name===t||r.name?.toLowerCase()===t;let o=e.props;return o?.originalType===t||o?.mdxType===t}function $r(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function Fe(e,t="root"){if(!(0,q.isValidElement)(e))return[];let r=[];if(Qe(e,"ul"))return q.Children.forEach(e.props.children,(o,n)=>{r.push(...Fe(o,`${t}-${n}`))}),r;if(Qe(e,"li")){let o=q.Children.toArray(e.props.children),n=o.findIndex(w=>Qe(w,"ul")),a=n!==-1,c=a?o.slice(0,n):o,l=a?o.slice(n):[],i=et(c),{name:d,comment:m}=$r(i),u=d.endsWith("/"),x=u?d.slice(0,-1):d,g=a||u;return r.push({id:`${t}-${x}`,name:x,comment:m,isFolder:g,children:a?Fe(l[0],`${t}-${x}`):void 0}),r}return e.props&&typeof e.props=="object"&&"children"in e.props&&q.Children.forEach(e.props.children,(o,n)=>{r.push(...Fe(o,`${t}-${n}`))}),r}function Ft({item:e}){return(0,C.jsxs)(J.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,C.jsx)(J.TreeItemContent,{children:({isExpanded:t,hasChildItems:r})=>(0,C.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,C.jsx)("div",{style:{width:"calc((var(--tree-item-level) - 1) * 1rem)"},className:"shrink-0"}),r?(0,C.jsx)(J.Button,{slot:"chevron",className:"outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors",children:(0,C.jsx)(z.ChevronRight,{size:14,strokeWidth:3,className:s("transition-transform duration-200",t&&"rotate-90")})}):(0,C.jsx)("div",{className:"w-[18px]"}),jr(e.name,e.isFolder),(0,C.jsx)("span",{className:s("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,C.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,C.jsx)(J.Collection,{items:e.children,children:t=>(0,C.jsx)(Ft,{item:t})})]})}function Wt({children:e}){let t=(0,q.useMemo)(()=>Fe(e),[e]);return(0,C.jsx)("div",{className:"my-8",children:(0,C.jsx)(J.Tree,{items:t,"aria-label":"File Tree",className:s("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:r=>(0,C.jsx)(Ft,{item:r})})})}var Pe=T(require("react-aria-components"));var pe=require("react");function jt({data:e,sortable:t=!1,paginated:r=!1,pageSize:o=10}){let[n,a]=(0,pe.useState)(null),[c,l]=(0,pe.useState)(1),i=(0,pe.useMemo)(()=>{if(!e)return[];let x=[...e];return t&&n!==null&&x.sort((g,w)=>{let R=g[n.key],f=w[n.key],G=typeof R=="string"?R:"",H=typeof f=="string"?f:"";return G<H?n.direction==="asc"?-1:1:G>H?n.direction==="asc"?1:-1:0}),x},[e,n,t]),d=Math.ceil(i.length/o),m=(0,pe.useMemo)(()=>{if(!r)return i;let x=(c-1)*o;return i.slice(x,x+o)},[i,r,c,o]);return{sortConfig:n,currentPage:c,setCurrentPage:l,totalPages:d,paginatedData:m,requestSort:x=>{if(!t)return;let g="asc";n&&n.key===x&&n.direction==="asc"&&(g="desc"),a({key:x,direction:g})}}}var E=require("lucide-react");var h=require("react/jsx-runtime");function $t({headers:e,data:t,children:r,className:o="",sortable:n=!1,paginated:a=!1,pageSize:c=10}){let{sortConfig:l,currentPage:i,setCurrentPage:d,totalPages:m,paginatedData:u,requestSort:x}=jt({data:t,sortable:n,paginated:a,pageSize:c}),g=R=>n?l?.key!==R?(0,h.jsx)(E.ChevronDown,{size:14,className:"ml-1 opacity-30"}):l.direction==="asc"?(0,h.jsx)(E.ChevronUp,{size:14,className:"ml-1 text-primary-400"}):(0,h.jsx)(E.ChevronDown,{size:14,className:"ml-1 text-primary-400"}):null,w=r||(0,h.jsxs)(h.Fragment,{children:[e&&(0,h.jsx)("thead",{children:(0,h.jsx)("tr",{children:e.map((R,f)=>(0,h.jsx)("th",{onClick:()=>x(f),className:s("text-left px-3 py-2.5 border-b-2 border-border-subtle text-text-main font-semibold text-sm",n&&"cursor-pointer select-none hover:text-primary-400 transition-colors"),children:(0,h.jsxs)("div",{className:"flex items-center",children:[R,g(f)]})},f))})}),u&&(0,h.jsx)("tbody",{children:u.map((R,f)=>(0,h.jsx)("tr",{className:"transition-colors hover:bg-bg-surface",children:R.map((G,H)=>(0,h.jsx)("td",{className:"px-3 py-2 border-b border-border-subtle text-sm text-text-muted",children:G},H))},f))})]});return(0,h.jsxs)("div",{className:s("my-6 rounded-lg border border-border-subtle overflow-hidden",o),children:[(0,h.jsx)("div",{className:"overflow-x-auto",children:(0,h.jsx)("table",{className:"w-full border-collapse text-sm",children:w})}),a&&m>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 ",i," of ",m]}),(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[(0,h.jsx)(Pe.Button,{onPress:()=>d(1),isDisabled:i===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)(E.ChevronsLeft,{size:16})}),(0,h.jsx)(Pe.Button,{onPress:()=>d(R=>Math.max(R-1,1)),isDisabled:i===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)(E.ChevronLeft,{size:16})}),(0,h.jsx)(Pe.Button,{onPress:()=>d(R=>Math.min(R+1,m)),isDisabled:i===m,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)(E.ChevronRight,{size:16})}),(0,h.jsx)(Pe.Button,{onPress:()=>d(m),isDisabled:i===m,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)(E.ChevronsRight,{size:16})})]})]})]})}var O=require("react/jsx-runtime");function Gt({name:e,type:t,defaultValue:r,required:o=!1,children:n,id:a,className:c=""}){return(0,O.jsxs)("article",{className:s("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",c),id:a,children:[(0,O.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,O.jsxs)("div",{className:"flex flex-wrap items-center gap-2.5",children:[(0,O.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,O.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}),o&&(0,O.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,O.jsx)("span",{className:"h-1 w-1 rounded-full bg-red-400 animate-pulse"}),"Required"]})]}),r&&(0,O.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,O.jsx)("span",{className:"font-semibold opacity-60 uppercase tracking-tighter",children:"Default"}),(0,O.jsx)("code",{className:"font-mono text-text-main font-medium",children:r})]})]}),(0,O.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30",children:n})]})}var rt=T(require("react")),Kt=require("react-aria-components"),Ut=require("react-router-dom");var qt=require("react-router-dom");var me=require("react"),_r=require("react/jsx-runtime"),Gr=(0,me.createContext)({preload:()=>{},routes:[]});function We(){return(0,me.use)(Gr)}var _t=require("zustand"),je=require("zustand/middleware"),$e=(0,_t.create)()((0,je.persist)(e=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:t=>e({currentLocale:t}),setVersion:t=>e({currentVersion:t}),setHasHydrated:t=>e({hasHydrated:t})}),{name:"boltdocs-storage",storage:(0,je.createJSONStorage)(()=>localStorage),partialize:e=>({currentLocale:e.currentLocale,currentVersion:e.currentVersion}),onRehydrateStorage:()=>e=>{e?.setHasHydrated(!0)}}));function Jt(){let{routes:e}=We(),t=Y(),r=(0,qt.useLocation)(),o=$e(f=>f.currentLocale),n=$e(f=>f.currentVersion),a=$e(f=>f.hasHydrated),c=e.find(f=>f.path===r.pathname),l=t.i18n?c?.locale||(a?o:void 0)||t.i18n.defaultLocale:void 0,i=t.versions?c?.version||(a?n:void 0)||t.versions.defaultVersion:void 0,d=e.filter(f=>{let G=t.i18n?(f.locale||t.i18n.defaultLocale)===l:!0,H=t.versions?(f.version||t.versions.defaultVersion)===i:!0;if(!(G&&H))return!1;let ve=t.i18n;if(ve){let Je=!!c?.locale,ke=!!f.locale;if(e.some(Te=>Te!==f&&Te.filePath===f.filePath&&Te.version===f.version&&(Te.locale||ve.defaultLocale)===(f.locale||ve.defaultLocale))&&Je!==ke)return!1}return!0}),u=t.i18n?.localeConfigs?.[l]?.label||t.i18n?.locales[l]||l,g=t.versions?.versions.find(f=>f.path===i)?.label||i,w=t.i18n?Object.entries(t.i18n.locales).map(([f,G])=>{let H=t.i18n?.localeConfigs?.[f];return{key:f,label:H?.label||G,isCurrent:f===l}}):[],R=t.versions?t.versions.versions.map(f=>({key:f.path,label:f.label,isCurrent:f.path===i})):[];return{routes:d,allRoutes:e,currentRoute:c,currentLocale:l,currentLocaleLabel:u,availableLocales:w,currentVersion:i,currentVersionLabel:g,availableVersions:R,config:t}}function tt(e){let t=Y(),{currentLocale:r,currentVersion:o}=Jt();if(!t||typeof e!="string"||e.startsWith("http")||e.startsWith("//"))return e;let n=t.i18n,a=t.versions;if(!n&&!a)return e;let c=e.startsWith("/docs"),l=e.split("/").filter(Boolean),i=0;l[i]==="docs"&&i++,a&&l.length>i&&a.versions.find(g=>g.path===l[i])&&i++,n&&l.length>i&&n.locales[l[i]]&&i++;let d=l.slice(i),m=[];c&&(m.push("docs"),a&&o&&m.push(o)),n&&r&&r!==n.defaultLocale&&m.push(r),m.push(...d);let u=`/${m.join("/")}`;return u.length>1&&u.endsWith("/")?u.slice(0,-1):u||"/"}var ot=require("react/jsx-runtime"),ue=rt.default.forwardRef((e,t)=>{let{href:r,prefetch:o="hover",onMouseEnter:n,onFocus:a,...c}=e,l=tt(r??""),{preload:i}=We();return(0,ot.jsx)(Kt.Link,{...c,ref:t,href:l,onMouseEnter:u=>{n?.(u),o==="hover"&&typeof l=="string"&&l.startsWith("/")&&i(l)},onFocus:u=>{a?.(u),o==="hover"&&typeof l=="string"&&l.startsWith("/")&&i(l)}})});ue.displayName="Link";var qr=rt.default.forwardRef((e,t)=>{let{href:r,end:o=!1,className:n,children:a,...c}=e,l=(0,Ut.useLocation)(),i=tt(r??""),d=o?l.pathname===i:l.pathname.startsWith(i),m=typeof n=="function"?n({isActive:d}):s(n,d&&"active"),u=typeof a=="function"?a({isActive:d}):a;return(0,ot.jsx)(ue,{...c,ref:t,href:r,className:m,children:u})});qr.displayName="NavLink";var Yt=require("react/jsx-runtime");function Xt({to:e,children:t,className:r="",...o}){let n=e&&(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")),a=s("text-blue-600 hover:text-blue-800 hover:underline cursor-pointer",r);return(0,Yt.jsx)(ue,{href:e,className:a,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,...o,children:t})}var fe=require("react"),Kr=require("react/jsx-runtime"),Jr=(0,fe.createContext)(void 0);function Zt(){let e=(0,fe.use)(Jr);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}var er=require("react/jsx-runtime");function Qt({src:e,alt:t,theme:r,...o}){let{theme:n}=Zt();return r&&r!==n?null:(0,er.jsx)("img",{src:e,alt:t||"",...o})}var y=require("react/jsx-runtime");function tr({title:e,props:t,className:r=""}){return(0,y.jsxs)("div",{className:s("my-6",r),children:[e&&(0,y.jsx)("h3",{className:"text-base font-bold text-text-main mb-3",children:e}),(0,y.jsx)("div",{className:"overflow-x-auto rounded-lg border border-border-subtle",children:(0,y.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,y.jsx)("thead",{children:(0,y.jsxs)("tr",{children:[(0,y.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,y.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,y.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,y.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,y.jsx)("tbody",{children:t.map((o,n)=>(0,y.jsxs)("tr",{className:"transition-colors hover:bg-bg-surface",children:[(0,y.jsxs)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:[(0,y.jsx)("code",{className:"rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400",children:o.name}),o.required&&(0,y.jsx)("span",{className:"ml-1 text-red-400 font-bold",children:"*"})]}),(0,y.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:(0,y.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted",children:o.type})}),(0,y.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:o.defaultValue?(0,y.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400",children:o.defaultValue}):(0,y.jsx)("span",{className:"text-text-dim",children:"\u2014"})}),(0,y.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle text-text-muted",children:o.description})]},`${o.name}-${n}`))})]})})]})}var nt=require("react");function rr(e){let{code:t,children:r,preview:o}=e,n=(0,nt.useMemo)(()=>(t??(typeof r=="string"?r:"")).trim(),[t,r]),a=(0,nt.useMemo)(()=>o??(typeof r!="string"?r:null),[o,r]);return{initialCode:n,previewElement:a}}var xe=require("react/jsx-runtime");function or(e){let{highlightedHtml:t,hideCode:r=!1,hideSandbox:o=!1,hideCopy:n=!1,sandboxOptions:a={}}=e,{initialCode:c,previewElement:l}=rr(e);return(0,xe.jsxs)("div",{className:"my-6 overflow-hidden rounded-xl border border-border-subtle",children:[(0,xe.jsx)("div",{className:"flex items-center justify-center p-8 bg-bg-surface",children:l}),!r&&(0,xe.jsx)("div",{className:"border-t border-border-subtle",children:(0,xe.jsx)(ae,{hideSandbox:o,hideCopy:n,title:a.title,lang:"tsx",highlightedHtml:t,plain:!0,children:c})})]})}var br=require("react"),X=require("lucide-react");var nr=require("react");var Ur=require("react-aria-components"),Ge=require("lucide-react");var sr=require("react/jsx-runtime");var we=T(require("react-aria-components")),Xr=require("lucide-react");var st=require("react/jsx-runtime");var A=T(require("react-aria-components")),Q=require("lucide-react");var v=require("react/jsx-runtime"),Yr=({children:e,isOpen:t,onOpenChange:r,className:o})=>(0,v.jsx)(A.ModalOverlay,{isOpen:t,onOpenChange:r,isDismissable:!0,className:s("fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20","entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out"),children:(0,v.jsx)(A.Modal,{className:s("mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",o),children:(0,v.jsx)(A.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Zr=({children:e,className:t,onSelectionChange:r,...o})=>(0,v.jsx)("div",{className:t,children:(0,v.jsx)(A.Autocomplete,{...o,onSelectionChange:r,className:"flex flex-col min-h-0",children:e})}),Qr=({className:e,...t})=>(0,v.jsxs)(A.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[(0,v.jsx)(Q.Search,{className:"h-5 w-5 text-text-muted"}),(0,v.jsx)(A.Input,{...t,className:s("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),(0,v.jsx)("div",{className:"flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted",children:(0,v.jsx)("kbd",{className:"font-sans",children:"ESC"})})]}),eo=({children:e,className:t,...r})=>(0,v.jsx)(A.ListBox,{...r,className:s("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),to=({children:e,className:t,...r})=>(0,v.jsx)(A.ListBoxItem,{...r,className:s("group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors","text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white",t),children:o=>(0,v.jsxs)(v.Fragment,{children:[e,(o.isFocused||o.isSelected)&&(0,v.jsxs)("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[(0,v.jsx)("span",{className:"text-[10px]",children:"Select"}),(0,v.jsx)(Q.CornerDownLeft,{size:10})]})]})}),ro=({isHeading:e,className:t})=>(0,v.jsx)("div",{className:s("shrink-0",t),children:e?(0,v.jsx)(Q.Hash,{size:18}):(0,v.jsx)(Q.FileText,{size:18})}),oo=({children:e,className:t})=>(0,v.jsx)("span",{className:s("block font-medium truncate flex-1 text-sm",t),children:e}),no=({children:e,className:t})=>(0,v.jsx)("span",{className:s("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),Ts={Root:Yr,Autocomplete:Zr,Input:Qr,List:eo,Item:Object.assign(to,{Icon:ro,Title:oo,Bio:no})};var $=require("react"),so=T(require("scroll-into-view-if-needed"));var ar=require("react");var ir=require("react/jsx-runtime"),Ws=(0,$.createContext)(null),js=(0,$.createContext)(null);var ao=({children:e,className:t,ref:r,...o})=>{let n=(0,$.useRef)(null);return(0,$.useImperativeHandle)(r,()=>n.current),(0,ir.jsx)("div",{ref:n,className:s("relative overflow-y-auto boltdocs-otp-content",t),...o,children:e})};ao.displayName="OnThisPageContent";var lr=T(require("react-aria-components")),qe=require("lucide-react");var D=require("react/jsx-runtime"),io=({children:e,className:t})=>(0,D.jsx)("nav",{className:s("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),lo=({children:e,to:t,direction:r,className:o})=>{let n=r==="next";return(0,D.jsxs)(lr.Link,{href:t,className:s("flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none","transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg","focus-visible:ring-2 focus-visible:ring-primary-500/30",n?"text-right justify-end":"text-left justify-start",o),children:[!n&&(0,D.jsx)(qe.ChevronLeft,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),(0,D.jsx)("div",{className:"flex flex-col gap-1 flex-1",children:e}),n&&(0,D.jsx)(qe.ChevronRight,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},co=({children:e,className:t})=>(0,D.jsx)("span",{className:s("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),po=({children:e,className:t})=>(0,D.jsx)("span",{className:s("text-base font-bold text-text-main truncate",t),children:e}),mo=({children:e})=>(0,D.jsx)(D.Fragment,{children:e}),qs={PageNavRoot:io,PageNavLink:Object.assign(lo,{Title:co,Description:po,Icon:mo})};var uo=require("react/jsx-runtime");var fo=T(require("react-aria-components")),xo=require("lucide-react");var cr=require("react/jsx-runtime");var at=require("react-aria-components"),bo=require("lucide-react");var go=require("react/jsx-runtime");var pr=require("react/jsx-runtime"),dr=({children:e,className:t,vertical:r=!1})=>(0,pr.jsx)("div",{className:s("inline-flex",r?"flex-col":"flex-row",!r&&["[&>*: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"]],r&&["[&>*: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});var he=require("lucide-react"),ur=T(require("react")),L=T(require("react-aria-components"));var ge=T(require("react-aria-components"));var be=require("react/jsx-runtime"),mr=({children:e,className:t,showArrow:r,...o})=>(0,be.jsxs)(ge.Popover,{offset:8,...o,className:ge.composeRenderProps(t,n=>s("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none transition-none",n)),children:[r&&(0,be.jsx)(ge.OverlayArrow,{className:"group",children:(0,be.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,be.jsx)("path",{d:"M0 0 L6 6 L12 0"})})}),e]});var B=require("react/jsx-runtime");function fr(e){let[t,r]=ur.default.Children.toArray(e.children).slice(0,2);return(0,B.jsxs)(L.MenuTrigger,{...e,children:[t,(0,B.jsx)(mr,{placement:e.placement,className:"min-w-35",children:r})]})}function xr(e){return(0,B.jsx)(L.Menu,{...e,className:L.composeRenderProps(e.className,t=>s("p-1.5 outline-none max-h-[inherit] overflow-auto max-w-75",t))})}function it(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return(0,B.jsx)(L.MenuItem,{...e,textValue:t,className:L.composeRenderProps(e.className,(r,{isFocused:o,isPressed:n,isDisabled:a})=>s("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":o,"bg-bg-surface-elevanted":n,"opacity-40 grayscale pointer-events-none":a},r)),children:L.composeRenderProps(e.children,(r,{selectionMode:o,isSelected:n,hasSubmenu:a})=>(0,B.jsxs)(B.Fragment,{children:[o!=="none"&&(0,B.jsxs)("span",{className:"flex items-center size-4 shrink-0 justify-center",children:[n&&o==="multiple"&&(0,B.jsx)(he.Check,{className:"size-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),n&&o==="single"&&(0,B.jsx)(he.Dot,{className:"size-5 text-primary-500 animate-in zoom-in-50 duration-200"})]}),(0,B.jsx)("div",{className:"flex flex-row w-full transition-colors items-center gap-2 py-1 px-1",children:r}),a&&(0,B.jsx)(he.ChevronRight,{className:"size-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}var ho=require("react/jsx-runtime");var _e=require("react-aria-components");var k=require("react/jsx-runtime"),vo=e=>{let[t,r]=(0,br.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},handleOpenRaw:()=>{let a=new Blob([e],{type:"text/plain;charset=utf-8"}),c=URL.createObjectURL(a);window.open(c,"_blank")}}};function gr({content:e,mdxRaw:t,config:r}){let o=t||e||"",{copied:n,handleCopy:a,handleOpenRaw:c}=vo(o),l=r!==!1,i=typeof r=="object"&&r.text||"Copy Markdown";return!l||!o?null:(0,k.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,k.jsxs)(dr,{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,k.jsx)(ye,{variant:"ghost",onPress:a,icon:n?(0,k.jsx)(X.Check,{size:16}):(0,k.jsx)(X.Copy,{size:16}),iconPosition:"left",className:s("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",n&&"text-emerald-500 hover:bg-emerald-500/5"),children:n?"Copied!":i}),(0,k.jsxs)(fr,{placement:"bottom end",children:[(0,k.jsx)(ye,{variant:"ghost",isIconOnly:!0,icon:(0,k.jsx)(X.ChevronDown,{size:14}),className:s("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,k.jsxs)(xr,{className:"w-52",children:[(0,k.jsxs)(it,{onAction:a,children:[(0,k.jsx)(X.Copy,{size:16,className:"size-4 mt-0.5 text-text-muted group-hover:text-primary-500"}),(0,k.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"Copy Markdown"})]}),(0,k.jsxs)(it,{onAction:c,children:[(0,k.jsx)(X.ExternalLink,{size:16,className:"size-4 mt-0.5 text-text-muted group-hover:text-primary-500"}),(0,k.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"View as Markdown"})]})]})]})]})})}
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x}from"../chunk-URTD6E6S.mjs";import{a as y}from"../chunk-RPUERTVC.mjs";import"../chunk-JD3RSDE4.mjs";import"../chunk-T3W44KWY.mjs";import"../chunk-W2NB4T6V.mjs";import"../chunk-NBCYHLAA.mjs";import"../chunk-JZXLCA2E.mjs";export{i as Admonition,f as Badge,a as Button,h as Card,g as Cards,p as Caution,b as CodeBlock,x as ComponentPreview,w as ComponentProps,y as CopyMarkdown,m as Danger,t as Field,r as FileTree,v as Image,o as Important,n as InfoBox,u as Link,q as List,j as Note,c as Tab,s as Table,d as Tabs,k as Tip,e as Video,l as Warning};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x}from"../chunk-2DI3OGHV.mjs";import{a as y}from"../chunk-64AJ5QLT.mjs";import"../chunk-JD3RSDE4.mjs";import"../chunk-T3W44KWY.mjs";import"../chunk-WWJ7WKDI.mjs";import"../chunk-NBCYHLAA.mjs";import"../chunk-JZXLCA2E.mjs";export{i as Admonition,f as Badge,a as Button,h as Card,g as Cards,p as Caution,b as CodeBlock,x as ComponentPreview,w as ComponentProps,y as CopyMarkdown,m as Danger,t as Field,r as FileTree,v as Image,o as Important,n as InfoBox,u as Link,q as List,j as Note,c as Tab,s as Table,d as Tabs,k as Tip,e as Video,l as Warning};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var Je=Object.create;var Mt=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var Ye=Object.getPrototypeOf,Ze=Object.prototype.hasOwnProperty;var Tt=(o,t)=>()=>(o&&(t=o(o=0)),t);var Yt=(o,t)=>{for(var e in t)Mt(o,e,{get:t[e],enumerable:!0})},Qe=(o,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Xe(t))!Ze.call(o,i)&&i!==e&&Mt(o,i,{get:()=>t[i],enumerable:!(r=Ke(t,i))||r.enumerable});return o};var v=(o,t,e)=>(e=o!=null?Je(Ye(o)):{},Qe(t||!o||!o.__esModule?Mt(e,"default",{value:o,enumerable:!0}):e,o));var to,b,p=Tt(()=>{"use strict";to=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,b=to()});function R(o){return o.replace(/\\/g,"/")}function Z(o){return o.replace(/^\d+\./,"")}function ut(o){let t=o.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function Qt(o){return/\.mdx?$/.test(o)}function gt(o){try{return _t.default.statSync(o).mtimeMs}catch{return 0}}function ft(o){let t=_t.default.readFileSync(o,"utf-8");try{let{data:e,content:r}=(0,Zt.default)(t);return{data:e,content:r}}catch{return{data:{},content:t}}}function E(o){return o.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ot(o){return E(o)}function te(o){let e=o.split("/").map(Z).join("/").replace(/\/$/,"");return e=e.replace(/\.mdx?$/,""),(e==="index"||e.endsWith("/index"))&&(e=e.replace(/index$/,"")),e.startsWith("/")||(e="/"+e),e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function Q(o){return Ft.default.sanitize(o)}function It(o){return Ft.default.sanitize(o,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function tt(o){return o.charAt(0).toUpperCase()+o.slice(1)}function jt(o,t){return o?typeof o=="string"?o:t&&o[t]?o[t]:Object.values(o)[0]||"":""}var _t,Zt,Ft,T=Tt(()=>{"use strict";p();_t=v(require("fs")),Zt=v(require("gray-matter")),Ft=v(require("isomorphic-dompurify"))});var Nt={};Yt(Nt,{AssetCache:()=>At,FileCache:()=>et,TransformCache:()=>ot,flushCache:()=>so});async function so(){await L.flush()}var S,D,G,U,W,ht,eo,yt,Et,xo,zt,oo,io,no,ro,Lt,Ht,L,et,ot,At,it=Tt(()=>{"use strict";p();S=v(require("fs")),D=v(require("path")),G=v(require("crypto")),U=v(require("zlib")),W=require("util");T();ht=(0,W.promisify)(S.default.writeFile),eo=(0,W.promisify)(S.default.readFile),yt=(0,W.promisify)(S.default.mkdir),Et=(0,W.promisify)(S.default.rename),xo=(0,W.promisify)(S.default.unlink),zt=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",oo="assets",io="shards",no=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),ro=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",Lt=class{constructor(t){this.limit=t}cache=new Map;get(t){let e=this.cache.get(t);return e!==void 0&&(this.cache.delete(t),this.cache.set(t,e)),e}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.limit){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(t,e)}get size(){return this.cache.size}clear(){this.cache.clear()}},Ht=class{queue=Promise.resolve();pendingCount=0;add(t){this.pendingCount++,this.queue=this.queue.then(t).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}},L=new Ht,et=class{entries=new Map;cachePath=null;compress;constructor(t={}){if(this.compress=t.compress!==void 0?t.compress:ro,t.name){let e=t.root||process.cwd(),r=this.compress?"json.gz":"json";this.cachePath=D.default.resolve(e,zt,`${t.name}.${r}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!S.default.existsSync(this.cachePath)))try{let t=S.default.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(t=U.default.gunzipSync(t));let e=JSON.parse(t.toString("utf-8"));this.entries=new Map(Object.entries(e))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1"||!this.cachePath)return;let t=Object.fromEntries(this.entries),e=JSON.stringify(t),r=this.cachePath,i=this.compress;L.add(async()=>{try{await yt(D.default.dirname(r),{recursive:!0});let s=Buffer.from(e);i&&(s=U.default.gzipSync(s));let c=`${r}.${G.default.randomBytes(4).toString("hex")}.tmp`;await ht(c,s),await Et(c,r)}catch{}})}get(t){let e=this.entries.get(t);return!e||gt(t)!==e.mtime?null:e.data}set(t,e){this.entries.set(t,{data:e,mtime:gt(t)})}isValid(t){let e=this.entries.get(t);return e?gt(t)===e.mtime:!1}invalidate(t){this.entries.delete(t)}invalidateAll(){this.entries.clear()}pruneStale(t){for(let e of this.entries.keys())t.has(e)||this.entries.delete(e)}get size(){return this.entries.size}async flush(){await L.flush()}},ot=class{index=new Map;memoryCache=new Lt(no);baseDir;shardsDir;indexPath;constructor(t,e=process.cwd()){this.baseDir=D.default.resolve(e,zt,`transform-${t}`),this.shardsDir=D.default.resolve(this.baseDir,io),this.indexPath=D.default.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&S.default.existsSync(this.indexPath))try{let t=S.default.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 t=JSON.stringify(Object.fromEntries(this.index)),e=this.indexPath;L.add(async()=>{await yt(D.default.dirname(e),{recursive:!0}),await ht(e,t)})}async getMany(t){let e=new Map,r=[];for(let i of t){let s=this.memoryCache.get(i);s?e.set(i,s):this.index.has(i)&&r.push(i)}if(r.length>0){let i=await Promise.all(r.map(async s=>{let c=this.index.get(s),u=D.default.resolve(this.shardsDir,`${c}.gz`);try{let n=await eo(u),l=U.default.gunzipSync(n).toString("utf-8");return this.memoryCache.set(s,l),{key:s,val:l}}catch{return null}}));for(let s of i)s&&e.set(s.key,s.val)}return e}get(t){let e=this.memoryCache.get(t);if(e)return e;let r=this.index.get(t);if(!r)return null;let i=D.default.resolve(this.shardsDir,`${r}.gz`);if(!S.default.existsSync(i))return null;try{let s=S.default.readFileSync(i),c=U.default.gunzipSync(s).toString("utf-8");return this.memoryCache.set(t,c),c}catch{return null}}set(t,e){let r=G.default.createHash("md5").update(e).digest("hex");this.index.set(t,r),this.memoryCache.set(t,e);let i=D.default.resolve(this.shardsDir,`${r}.gz`);L.add(async()=>{if(S.default.existsSync(i))return;await yt(this.shardsDir,{recursive:!0});let s=U.default.gzipSync(Buffer.from(e)),c=`${i}.${G.default.randomBytes(4).toString("hex")}.tmp`;await ht(c,s),await Et(c,i)})}get size(){return this.index.size}async flush(){await L.flush()}},At=class{assetsDir;constructor(t=process.cwd()){this.assetsDir=D.default.resolve(t,zt,oo)}getFileHash(t){return G.default.createHash("md5").update(S.default.readFileSync(t)).digest("hex")}get(t,e){if(!S.default.existsSync(t))return null;let r=this.getFileHash(t),i=this.getCachedPath(t,`${e}-${r}`);return S.default.existsSync(i)?i:null}set(t,e,r){let i=this.getFileHash(t),s=this.getCachedPath(t,`${e}-${i}`);L.add(async()=>{await yt(this.assetsDir,{recursive:!0});let c=`${s}.${G.default.randomBytes(4).toString("hex")}.tmp`;await ht(c,r),await Et(c,s)})}getCachedPath(t,e){let r=D.default.extname(t),i=D.default.basename(t,r),s=e.replace(/[^a-z0-9]/gi,"-").toLowerCase();return D.default.join(this.assetsDir,`${i}.${s}${r}`)}clear(){S.default.existsSync(this.assetsDir)&&S.default.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await L.flush()}}});p();var Ue=v(require("cac"));p();p();var je=require("vite");p();var Fe=v(require("@vitejs/plugin-react")),Oe=v(require("@tailwindcss/vite"));p();var ye=require("vite");p();var re=v(require("fast-glob"));T();p();it();var O=new et({name:"routes"});function Ut(){O.invalidateAll()}function Gt(o){O.invalidate(o)}p();var V=v(require("path")),ee=v(require("github-slugger"));T();function oe(o,t,e,r){let i=decodeURIComponent(o),s=V.default.resolve(i),c=V.default.resolve(t),u=R(V.default.relative(c,s));if(u.startsWith("../")||u===".."||s.includes("\0"))throw new Error(`Security breach: File is outside of docs directory or contains null bytes: ${o}`);let{data:n,content:l}=ft(o),d=u.split("/"),f,w;if(r?.versions&&d.length>0){let k=d[0],Rt=r.versions.prefix||"",pt=r.versions.versions.find(Y=>{let kt=Rt+Y.path;return k===kt||k===Y.path});pt&&(w=pt.path,d=d.slice(1))}if(r?.i18n&&d.length>0){let k=d[0];r.i18n.locales[k]&&(f=k,d=d.slice(1))}let y;if(d.length>0){let k=d[0].match(/^\((.+)\)$/);k&&(y=k[1].toLowerCase(),d=d.slice(1))}let $=d.join("/"),a;n.permalink?a=n.permalink.startsWith("/")?n.permalink:`/${n.permalink}`:a=te($||"index.md");let m=e;w&&(m+="/"+w),f&&(m+="/"+f),m+=a==="/"?"":a,(!m||m==="")&&(m="/");let x=d[d.length-1],h=Z(x),B=Z(V.default.basename(o,V.default.extname(o))),g=n.sidebarPosition??ut(x),P=d.length>=2?d[0]:void 0,C=P?Z(P):void 0,j=d.length>=2&&/^index\.mdx?$/.test(h),N=new ee.default,X=[],Ge=/^(#{2,4})\s+(.+)$/gm;for(let k of l.matchAll(Ge)){let Rt=k[1].length,pt=k[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").trim(),Y=Q(pt).trim(),kt=N.slug(Y);X.push({level:Rt,text:Y,id:kt})}let We=n.title?Q(String(n.title)):B,Dt=n.description?Q(String(n.description)):"";!Dt&&l&&(Dt=It(l.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").replace(/\s+/g," ")).trim().slice(0,160));let Ve=n.badge?Q(String(n.badge)):void 0,Xt=n.icon?String(n.icon):void 0,qe=ao(l);return{route:{path:m,componentPath:o,filePath:u,title:We,description:Dt,sidebarPosition:g,headings:X,locale:f,version:w,badge:Ve,icon:Xt,tab:y,_content:qe,_rawContent:l},relativeDir:C,isGroupIndex:j,inferredTab:y,groupMeta:j?{title:n.groupTitle||n.title||(C?tt(C):""),position:n.groupPosition??n.sidebarPosition??(P?ut(P):void 0),icon:Xt}:void 0,inferredGroupPosition:P?ut(P):void 0}}function ao(o){let t=o.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/\{[^\}]+\}/g,"").replace(/[_*`]/g,"").replace(/\s+/g," ");return It(t).trim()}p();function ne(o){return o.sort((t,e)=>!t.group&&!e.group?ie(t,e):t.group?e.group?t.group!==e.group?co(t,e):ie(t,e):1:-1)}function ie(o,t){return o.sidebarPosition!==void 0&&t.sidebarPosition!==void 0?o.sidebarPosition-t.sidebarPosition:o.sidebarPosition!==void 0?-1:t.sidebarPosition!==void 0?1:o.title.localeCompare(t.title)}function co(o,t){return o.groupPosition!==void 0&&t.groupPosition!==void 0?o.groupPosition-t.groupPosition:o.groupPosition!==void 0?-1:t.groupPosition!==void 0?1:(o.groupTitle||o.group).localeCompare(t.groupTitle||t.group)}var Wt=null,nt=new Map;async function q(o,t,e="/docs",r=!0){let i=performance.now();O.load(),nt.clear(),(process.env.BOLTDOCS_FORCE_REPARSE==="true"||t?.i18n)&&O.invalidateAll();let s;!r&&Wt?s=Wt:(s=await(0,re.default)(["**/*.md","**/*.mdx"],{cwd:o,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),Wt=s),O.pruneStale(new Set(s));let c=50,u=[],n=0;for(let a=0;a<s.length;a+=c){let m=s.slice(a,a+c),x=await Promise.all(m.map(async h=>{let B=O.get(h);if(B)return n++,B;let g=oe(h,o,e,t);return O.set(h,g),g}));u.push(...x),a+c<s.length&&await new Promise(h=>setImmediate(h))}O.save();let l=new Map,d=[];for(let a of u)if(a.isGroupIndex&&a.relativeDir&&d.push(a),a.relativeDir){let m=l.get(a.relativeDir);m?(m.position===void 0&&a.inferredGroupPosition!==void 0&&(m.position=a.inferredGroupPosition),!m.icon&&a.route.icon&&(m.icon=a.route.icon)):(m={title:tt(a.relativeDir),position:a.inferredGroupPosition,icon:a.route.icon},l.set(a.relativeDir,m))}for(let a of d){let m=l.get(a.relativeDir);a.groupMeta&&(m.title=a.groupMeta.title,a.groupMeta.position!==void 0&&(m.position=a.groupMeta.position),a.groupMeta.icon&&(m.icon=a.groupMeta.icon))}let f=new Array(u.length);for(let a=0;a<u.length;a++){let m=u[a],x=m.relativeDir,h=x?l.get(x):void 0;f[a]={...m.route,group:x,groupTitle:h?.title||(x?tt(x):void 0),groupPosition:h?.position,groupIcon:h?.icon}}let w=f;if(t?.i18n){let a=lo(f,t,e);w=[...f,...a]}let y=ne(w),$=performance.now()-i;return console.log(`[boltdocs] Route generation: ${$.toFixed(2)}ms (${s.length} files, ${n} cache hits)`),y}function lo(o,t,e){let r=t.i18n.defaultLocale,i=Object.keys(t.i18n.locales),s=[],c=new Map,u=[];for(let n of o){let l=n.locale||r;c.has(l)||c.set(l,new Set),c.get(l).add(n.path),l===r&&u.push(n)}for(let n of i){let l=c.get(n)||new Set;for(let d of u){let f=mo(d.path,r,n,e,t);f!==d.path&&(l.has(f)||s.push({...d,path:f,locale:n}))}}return s}function mo(o,t,e,r,i){let s=`${o}:${e}`,c=nt.get(s);if(c)return c;let u=r;if(i?.versions){let f=i.versions.prefix||"";for(let w of i.versions.versions){let y=f+w.path;if(o.startsWith(`${r}/${y}`)){u+="/"+y;break}if(o.startsWith(`${r}/${w.path}`)){u+="/"+w.path;break}}}let n=o.substring(u.length),l=`/${t}`;if(n.startsWith(l+"/"))n="/"+e+"/"+n.substring(l.length+1);else if(n===l)n="/"+e;else if(n==="/"||n==="")n="/"+e;else{let f=n.startsWith("/")?"":"/";n="/"+e+f+n}let d=u+n;return nt.size>2e3&&nt.clear(),nt.set(s,d),d}var xe=require("vite-plugin-image-optimizer");p();var xt=v(require("path")),se=v(require("fs")),ae=require("vite");var vt=["boltdocs.config.js","boltdocs.config.mjs","boltdocs.config.ts"];async function M(o,t=process.cwd()){let e=t,r={docsDir:xt.default.resolve(o),theme:{title:"Boltdocs",description:"A Vite documentation framework",navbar:[{label:"Home",href:"/"},{label:"Documentation",href:"/docs"}],codeTheme:{light:"github-light",dark:"github-dark"},poweredBy:!0,breadcrumbs:!0}},i={};for(let n of vt){let l=xt.default.resolve(e,n);if(se.default.existsSync(l))try{let d=await(0,ae.loadConfigFromFile)({command:"serve",mode:"development"},l,e);if(d){i=d.config;break}}catch(d){console.warn(`[boltdocs] Failed to load config from ${n}:`,d)}}let c={...{title:i.title,description:i.description,logo:i.logo,favicon:i.favicon,ogImage:i.ogImage,navbar:i.navbar,sidebar:i.sidebar,socialLinks:i.socialLinks,footer:i.footer,githubRepo:i.githubRepo,tabs:i.tabs,codeTheme:i.codeTheme,copyMarkdown:i.copyMarkdown,breadcrumbs:i.breadcrumbs,poweredBy:i.poweredBy,communityHelp:i.communityHelp,version:i.version,editLink:i.editLink},...i.theme||{}},u=Object.fromEntries(Object.entries(c).filter(([n,l])=>l!==void 0));return u.navbar&&(u.navbar=u.navbar.map(n=>({label:n.label||n.text||"",href:n.href||n.link||n.to||"",items:n.items?.map(l=>({label:l.label||l.text||"",href:l.href||l.link||l.to||""}))}))),{docsDir:xt.default.resolve(o),homePage:i.homePage,theme:{...r.theme,...u},i18n:i.i18n,versions:i.versions,siteUrl:i.siteUrl,plugins:i.plugins||[],external:i.external,integrations:i.integrations,robots:i.robots,vite:i.vite}}p();var H=v(require("fs")),I=v(require("path"));T();var pe=require("url"),ue=require("module");p();T();function ce(o,t){let e=E(t.title),r=E(t.description);return o.replace(/<title>.*?<\/title>/,`<title>${e}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${r}$2`)}p();T();function le(o,t){let e=t?.siteUrl?.replace(/\/$/,"")||"https://example.com",r=new Date().toISOString().split("T")[0],i=[{url:"/",priority:"1.0",changefreq:"daily"}];if(t?.i18n){let c=t.i18n.defaultLocale;for(let u of Object.keys(t.i18n.locales))u!==c&&i.push({url:`/${u}/`,priority:"1.0",changefreq:"daily"})}return`<?xml version="1.0" encoding="UTF-8"?>
2
+ "use strict";var Xe=Object.create;var _t=Object.defineProperty;var Ye=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Qe=Object.getPrototypeOf,to=Object.prototype.hasOwnProperty;var Tt=(o,t)=>()=>(o&&(t=o(o=0)),t);var Zt=(o,t)=>{for(var e in t)_t(o,e,{get:t[e],enumerable:!0})},eo=(o,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ze(t))!to.call(o,i)&&i!==e&&_t(o,i,{get:()=>t[i],enumerable:!(r=Ye(t,i))||r.enumerable});return o};var P=(o,t,e)=>(e=o!=null?Xe(Qe(o)):{},eo(t||!o||!o.__esModule?_t(e,"default",{value:o,enumerable:!0}):e,o));var oo,$,m=Tt(()=>{"use strict";oo=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,$=oo()});function R(o){return o.replace(/\\/g,"/")}function Z(o){return o.replace(/^\d+\./,"")}function gt(o){let t=o.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function te(o){return/\.mdx?$/.test(o)}function ft(o){try{return Ft.default.statSync(o).mtimeMs}catch{return 0}}function ht(o){let t=Ft.default.readFileSync(o,"utf-8");try{let{data:e,content:r}=(0,Qt.default)(t);return{data:e,content:r}}catch{return{data:{},content:t}}}function z(o){return o.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ot(o){return z(o)}function ee(o){let e=o.split("/").map(Z).join("/").replace(/\/$/,"");return e=e.replace(/\.mdx?$/,""),(e==="index"||e.endsWith("/index"))&&(e=e.replace(/index$/,"")),e.startsWith("/")||(e="/"+e),e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function Q(o){return It.default.sanitize(o)}function jt(o){return It.default.sanitize(o,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function tt(o){return o.charAt(0).toUpperCase()+o.slice(1)}function Ht(o,t){return o?typeof o=="string"?o:t&&o[t]?o[t]:Object.values(o)[0]||"":""}var Ft,Qt,It,F=Tt(()=>{"use strict";m();Ft=P(require("fs")),Qt=P(require("gray-matter")),It=P(require("isomorphic-dompurify"))});var Ut={};Zt(Ut,{AssetCache:()=>Et,FileCache:()=>et,TransformCache:()=>ot,flushCache:()=>co});async function co(){await A.flush()}var B,M,G,U,W,yt,io,xt,zt,bo,Nt,no,ro,so,ao,Lt,At,A,et,ot,Et,it=Tt(()=>{"use strict";m();B=P(require("fs")),M=P(require("path")),G=P(require("crypto")),U=P(require("zlib")),W=require("util");F();yt=(0,W.promisify)(B.default.writeFile),io=(0,W.promisify)(B.default.readFile),xt=(0,W.promisify)(B.default.mkdir),zt=(0,W.promisify)(B.default.rename),bo=(0,W.promisify)(B.default.unlink),Nt=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",no="assets",ro="shards",so=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),ao=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",Lt=class{constructor(t){this.limit=t}cache=new Map;get(t){let e=this.cache.get(t);return e!==void 0&&(this.cache.delete(t),this.cache.set(t,e)),e}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.limit){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(t,e)}get size(){return this.cache.size}clear(){this.cache.clear()}},At=class{queue=Promise.resolve();pendingCount=0;add(t){this.pendingCount++,this.queue=this.queue.then(t).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}},A=new At,et=class{entries=new Map;cachePath=null;compress;constructor(t={}){if(this.compress=t.compress!==void 0?t.compress:ao,t.name){let e=t.root||process.cwd(),r=this.compress?"json.gz":"json";this.cachePath=M.default.resolve(e,Nt,`${t.name}.${r}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!B.default.existsSync(this.cachePath)))try{let t=B.default.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(t=U.default.gunzipSync(t));let e=JSON.parse(t.toString("utf-8"));this.entries=new Map(Object.entries(e))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1"||!this.cachePath)return;let t=Object.fromEntries(this.entries),e=JSON.stringify(t),r=this.cachePath,i=this.compress;A.add(async()=>{try{await xt(M.default.dirname(r),{recursive:!0});let s=Buffer.from(e);i&&(s=U.default.gzipSync(s));let c=`${r}.${G.default.randomBytes(4).toString("hex")}.tmp`;await yt(c,s),await zt(c,r)}catch{}})}get(t){let e=this.entries.get(t);return!e||ft(t)!==e.mtime?null:e.data}set(t,e){this.entries.set(t,{data:e,mtime:ft(t)})}isValid(t){let e=this.entries.get(t);return e?ft(t)===e.mtime:!1}invalidate(t){this.entries.delete(t)}invalidateAll(){this.entries.clear()}pruneStale(t){for(let e of this.entries.keys())t.has(e)||this.entries.delete(e)}get size(){return this.entries.size}async flush(){await A.flush()}},ot=class{index=new Map;memoryCache=new Lt(so);baseDir;shardsDir;indexPath;constructor(t,e=process.cwd()){this.baseDir=M.default.resolve(e,Nt,`transform-${t}`),this.shardsDir=M.default.resolve(this.baseDir,ro),this.indexPath=M.default.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&B.default.existsSync(this.indexPath))try{let t=B.default.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 t=JSON.stringify(Object.fromEntries(this.index)),e=this.indexPath;A.add(async()=>{await xt(M.default.dirname(e),{recursive:!0}),await yt(e,t)})}async getMany(t){let e=new Map,r=[];for(let i of t){let s=this.memoryCache.get(i);s?e.set(i,s):this.index.has(i)&&r.push(i)}if(r.length>0){let i=await Promise.all(r.map(async s=>{let c=this.index.get(s),u=M.default.resolve(this.shardsDir,`${c}.gz`);try{let n=await io(u),l=U.default.gunzipSync(n).toString("utf-8");return this.memoryCache.set(s,l),{key:s,val:l}}catch{return null}}));for(let s of i)s&&e.set(s.key,s.val)}return e}get(t){let e=this.memoryCache.get(t);if(e)return e;let r=this.index.get(t);if(!r)return null;let i=M.default.resolve(this.shardsDir,`${r}.gz`);if(!B.default.existsSync(i))return null;try{let s=B.default.readFileSync(i),c=U.default.gunzipSync(s).toString("utf-8");return this.memoryCache.set(t,c),c}catch{return null}}set(t,e){let r=G.default.createHash("md5").update(e).digest("hex");this.index.set(t,r),this.memoryCache.set(t,e);let i=M.default.resolve(this.shardsDir,`${r}.gz`);A.add(async()=>{if(B.default.existsSync(i))return;await xt(this.shardsDir,{recursive:!0});let s=U.default.gzipSync(Buffer.from(e)),c=`${i}.${G.default.randomBytes(4).toString("hex")}.tmp`;await yt(c,s),await zt(c,i)})}get size(){return this.index.size}async flush(){await A.flush()}},Et=class{assetsDir;constructor(t=process.cwd()){this.assetsDir=M.default.resolve(t,Nt,no)}getFileHash(t){return G.default.createHash("md5").update(B.default.readFileSync(t)).digest("hex")}get(t,e){if(!B.default.existsSync(t))return null;let r=this.getFileHash(t),i=this.getCachedPath(t,`${e}-${r}`);return B.default.existsSync(i)?i:null}set(t,e,r){let i=this.getFileHash(t),s=this.getCachedPath(t,`${e}-${i}`);A.add(async()=>{await xt(this.assetsDir,{recursive:!0});let c=`${s}.${G.default.randomBytes(4).toString("hex")}.tmp`;await yt(c,r),await zt(c,s)})}getCachedPath(t,e){let r=M.default.extname(t),i=M.default.basename(t,r),s=e.replace(/[^a-z0-9]/gi,"-").toLowerCase();return M.default.join(this.assetsDir,`${i}.${s}${r}`)}clear(){B.default.existsSync(this.assetsDir)&&B.default.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await A.flush()}}});m();var We=P(require("cac"));m();m();var Le=require("vite");m();var Oe=P(require("@vitejs/plugin-react")),je=P(require("@tailwindcss/vite"));m();var ye=require("vite");m();var se=P(require("fast-glob"));F();m();it();var L=new et({name:"routes"});function Gt(){L.invalidateAll()}function Wt(o){L.invalidate(o)}m();var V=P(require("path")),oe=P(require("github-slugger"));F();function ie(o,t,e,r){let i=decodeURIComponent(o),s=V.default.resolve(i),c=V.default.resolve(t),u=R(V.default.relative(c,s));if(u.startsWith("../")||u===".."||s.includes("\0"))throw new Error(`Security breach: File is outside of docs directory or contains null bytes: ${o}`);let{data:n,content:l}=ht(o),d=u.split("/"),g,C;if(r?.versions&&d.length>0){let k=d[0],Rt=r.versions.prefix||"",ut=r.versions.versions.find(Y=>{let kt=Rt+Y.path;return k===kt||k===Y.path});ut&&(C=ut.path,d=d.slice(1))}if(r?.i18n&&d.length>0){let k=d[0];r.i18n.locales[k]&&(g=k,d=d.slice(1))}let w;if(d.length>0){let k=d[0].match(/^\((.+)\)$/);k&&(w=k[1].toLowerCase(),d=d.slice(1))}let x=d.join("/"),p;n.permalink?p=n.permalink.startsWith("/")?n.permalink:`/${n.permalink}`:p=ee(x||"index.md");let a=e;C&&(a+="/"+C),g&&(a+="/"+g),w&&(a+="/"+w),a+=p==="/"?"":p,(!a||a==="")&&(a="/");let h=d[d.length-1],f=Z(h),b=Z(V.default.basename(o,V.default.extname(o))),v=n.sidebarPosition??gt(h),y=d.length>=2?d[0]:void 0,S=y?Z(y):void 0,D=d.length>=2&&/^index\.mdx?$/.test(f),H=new oe.default,X=[],Ve=/^(#{2,4})\s+(.+)$/gm;for(let k of l.matchAll(Ve)){let Rt=k[1].length,ut=k[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").trim(),Y=Q(ut).trim(),kt=H.slug(Y);X.push({level:Rt,text:Y,id:kt})}let qe=n.title?Q(String(n.title)):b,Mt=n.description?Q(String(n.description)):"";!Mt&&l&&(Mt=jt(l.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").replace(/\s+/g," ")).trim().slice(0,160));let Je=n.badge?Q(String(n.badge)):void 0,Yt=n.icon?String(n.icon):void 0,Ke=lo(l);return{route:{path:a,componentPath:o,filePath:u,title:qe,description:Mt,sidebarPosition:v,headings:X,locale:g,version:C,badge:Je,icon:Yt,tab:w,_content:Ke,_rawContent:l},relativeDir:S,isGroupIndex:D,inferredTab:w,groupMeta:D?{title:n.groupTitle||n.title||(S?tt(S):""),position:n.groupPosition??n.sidebarPosition??(y?gt(y):void 0),icon:Yt}:void 0,inferredGroupPosition:y?gt(y):void 0}}function lo(o){let t=o.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/\{[^\}]+\}/g,"").replace(/[_*`]/g,"").replace(/\s+/g," ");return jt(t).trim()}m();function re(o){return o.sort((t,e)=>!t.group&&!e.group?ne(t,e):t.group?e.group?t.group!==e.group?po(t,e):ne(t,e):1:-1)}function ne(o,t){return o.sidebarPosition!==void 0&&t.sidebarPosition!==void 0?o.sidebarPosition-t.sidebarPosition:o.sidebarPosition!==void 0?-1:t.sidebarPosition!==void 0?1:o.title.localeCompare(t.title)}function po(o,t){return o.groupPosition!==void 0&&t.groupPosition!==void 0?o.groupPosition-t.groupPosition:o.groupPosition!==void 0?-1:t.groupPosition!==void 0?1:(o.groupTitle||o.group).localeCompare(t.groupTitle||t.group)}var Vt=null,nt=new Map;async function q(o,t,e="/docs",r=!0){let i=performance.now();L.load(),nt.clear(),(process.env.BOLTDOCS_FORCE_REPARSE==="true"||t?.i18n)&&L.invalidateAll();let s;!r&&Vt?s=Vt:(s=await(0,se.default)(["**/*.md","**/*.mdx"],{cwd:o,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),Vt=s),L.pruneStale(new Set(s));let c=50,u=[],n=0;for(let p=0;p<s.length;p+=c){let a=s.slice(p,p+c),h=await Promise.all(a.map(async f=>{let b=L.get(f);if(b)return n++,b;let v=ie(f,o,e,t);return L.set(f,v),v}));u.push(...h),p+c<s.length&&await new Promise(f=>setImmediate(f))}L.save();let l=new Map,d=[];for(let p of u)if(p.isGroupIndex&&p.relativeDir&&d.push(p),p.relativeDir){let a=l.get(p.relativeDir);a?(a.position===void 0&&p.inferredGroupPosition!==void 0&&(a.position=p.inferredGroupPosition),!a.icon&&p.route.icon&&(a.icon=p.route.icon)):(a={title:tt(p.relativeDir),position:p.inferredGroupPosition,icon:p.route.icon},l.set(p.relativeDir,a))}for(let p of d){let a=l.get(p.relativeDir);p.groupMeta&&(a.title=p.groupMeta.title,p.groupMeta.position!==void 0&&(a.position=p.groupMeta.position),p.groupMeta.icon&&(a.icon=p.groupMeta.icon))}let g=new Array(u.length);for(let p=0;p<u.length;p++){let a=u[p],h=a.relativeDir,f=h?l.get(h):void 0;g[p]={...a.route,group:h,groupTitle:f?.title||(h?tt(h):void 0),groupPosition:f?.position,groupIcon:f?.icon}}let C=g;if(t?.i18n){let p=mo(g,t,e);C=[...g,...p]}let w=re(C),x=performance.now()-i;return console.log(`[boltdocs] Route generation: ${x.toFixed(2)}ms (${s.length} files, ${n} cache hits)`),w}function mo(o,t,e){let r=t.i18n.defaultLocale,i=Object.keys(t.i18n.locales),s=[],c=new Map,u=[];for(let n of o){let l=n.locale||r;c.has(l)||c.set(l,new Set),c.get(l).add(n.path),l===r&&u.push(n)}for(let n of i){let l=c.get(n)||new Set;for(let d of u){let g=uo(d.path,r,n,e,t);g!==d.path&&(l.has(g)||s.push({...d,path:g,locale:n}))}}return s}function uo(o,t,e,r,i){let s=`${o}:${e}`,c=nt.get(s);if(c)return c;let u=r;if(i?.versions){let g=i.versions.prefix||"";for(let C of i.versions.versions){let w=g+C.path;if(o.startsWith(`${r}/${w}`)){u+="/"+w;break}if(o.startsWith(`${r}/${C.path}`)){u+="/"+C.path;break}}}let n=o.substring(u.length),l=`/${t}`;if(n.startsWith(l+"/"))n="/"+e+"/"+n.substring(l.length+1);else if(n===l)n="/"+e;else if(n==="/"||n==="")n="/"+e;else{let g=n.startsWith("/")?"":"/";n="/"+e+g+n}let d=u+n;return nt.size>2e3&&nt.clear(),nt.set(s,d),d}var xe=require("vite-plugin-image-optimizer");m();var vt=P(require("path")),ae=P(require("fs")),ce=require("vite");var bt=["boltdocs.config.js","boltdocs.config.mjs","boltdocs.config.ts"];async function _(o,t=process.cwd()){let e=t,r={docsDir:vt.default.resolve(o),theme:{title:"Boltdocs",description:"A Vite documentation framework",navbar:[{label:"Home",href:"/"},{label:"Documentation",href:"/docs"}],codeTheme:{light:"github-light",dark:"github-dark"},poweredBy:!0,breadcrumbs:!0}},i={};for(let n of bt){let l=vt.default.resolve(e,n);if(ae.default.existsSync(l))try{let d=await(0,ce.loadConfigFromFile)({command:"serve",mode:"development"},l,e);if(d){i=d.config;break}}catch(d){console.warn(`[boltdocs] Failed to load config from ${n}:`,d)}}let c={...{title:i.title,description:i.description,logo:i.logo,favicon:i.favicon,ogImage:i.ogImage,navbar:i.navbar,sidebar:i.sidebar,socialLinks:i.socialLinks,footer:i.footer,githubRepo:i.githubRepo,tabs:i.tabs,codeTheme:i.codeTheme,copyMarkdown:i.copyMarkdown,breadcrumbs:i.breadcrumbs,poweredBy:i.poweredBy,communityHelp:i.communityHelp,version:i.version,editLink:i.editLink},...i.theme||{}},u=Object.fromEntries(Object.entries(c).filter(([n,l])=>l!==void 0));return u.navbar&&(u.navbar=u.navbar.map(n=>({label:n.label||n.text||"",href:n.href||n.link||n.to||""}))),{docsDir:vt.default.resolve(o),homePage:i.homePage,theme:{...r.theme,...u},i18n:i.i18n,versions:i.versions,siteUrl:i.siteUrl,plugins:i.plugins||[],integrations:i.integrations,robots:i.robots,vite:i.vite}}m();var I=P(require("fs")),O=P(require("path"));F();var ue=require("url"),ge=require("module");m();F();function le(o,t){let e=z(t.title),r=z(t.description);return o.replace(/<title>.*?<\/title>/,`<title>${e}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${r}$2`)}m();F();function de(o,t){let e=t?.siteUrl?.replace(/\/$/,"")||"https://example.com",r=new Date().toISOString().split("T")[0],i=[{url:"/",priority:"1.0",changefreq:"daily"}];if(t?.i18n){let c=t.i18n.defaultLocale;for(let u of Object.keys(t.i18n.locales))u!==c&&i.push({url:`/${u}/`,priority:"1.0",changefreq:"daily"})}return`<?xml version="1.0" encoding="UTF-8"?>
3
3
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
4
4
  ${[...i,...o.map(c=>({url:c,priority:"0.8",changefreq:"weekly"}))].map(c=>` <url>
5
5
  <loc>${Ot(e)}${Ot(c.url)}</loc>
@@ -8,15 +8,14 @@ ${[...i,...o.map(c=>({url:c,priority:"0.8",changefreq:"weekly"}))].map(c=>` <ur
8
8
  <priority>${c.priority}</priority>
9
9
  </url>`).join(`
10
10
  `)}
11
- </urlset>`}p();function bt(o){if(typeof o.robots=="string")return o.robots;let t=o.siteUrl?.replace(/\/$/,"")||"",e=o.robots||{},r=e.rules||[{userAgent:"*",allow:"/"}],i=e.sitemaps||(t?[`${t}/sitemap.xml`]:[]),s="";for(let c of r){if(s+=`User-agent: ${c.userAgent}
11
+ </urlset>`}m();function wt(o){if(typeof o.robots=="string")return o.robots;let t=o.siteUrl?.replace(/\/$/,"")||"",e=o.robots||{},r=e.rules||[{userAgent:"*",allow:"/"}],i=e.sitemaps||(t?[`${t}/sitemap.xml`]:[]),s="";for(let c of r){if(s+=`User-agent: ${c.userAgent}
12
12
  `,c.disallow){let u=Array.isArray(c.disallow)?c.disallow:[c.disallow];for(let n of u)s+=`Disallow: ${n}
13
13
  `}if(c.allow){let u=Array.isArray(c.allow)?c.allow:[c.allow];for(let n of u)s+=`Allow: ${n}
14
14
  `}s+=`
15
15
  `}for(let c of i)s+=`Sitemap: ${c}
16
- `;return s.trim()}var po=(0,pe.fileURLToPath)(b),de=I.default.dirname(po),me=(0,ue.createRequire)(b);async function Vt(o){let{docsDir:t,docsDirName:e,outDir:r,config:i}=o,s=await q(t,i),c=I.default.resolve(de,"../client/ssr.js");if(!H.default.existsSync(c)){console.error("[boltdocs] SSR module not found at",c,"- Did you build the core package?");return}let u=me("module"),n=u.prototype.require;u.prototype.require=function(a,...m){return a==="virtual:boltdocs-layout"?{__esModule:!0,default:function(h){try{let g=n.apply(this,[I.default.resolve(de,"../client/index.js")]).DefaultLayout||(({children:C})=>C);return n.apply(this,["react"]).createElement(g,h)}catch{return h.children}}}:n.apply(this,[a,...m])};let{render:l}=me(c);u.prototype.require=n;let d=I.default.join(r,"index.html");if(!H.default.existsSync(d)){console.warn("[boltdocs] No index.html found in outDir, skipping SSG.");return}let f=H.default.readFileSync(d,"utf-8");await Promise.all(s.map(async a=>{let m=jt(i?.theme?.title,a.locale)||"Boltdocs",x=jt(i?.theme?.description,a.locale)||"",h=`${a.title} | ${m}`,B=a.description||x,g={};g[`/${e}/${a.filePath}`]={default:()=>null};try{let P=await l({path:a.path,routes:s,config:i||{},docsDirName:e,modules:g,homePage:void 0}),C=ce(f,{title:E(h),description:E(B)}).replace("<!--app-html-->",P).replace('<div id="root"></div>',`<div id="root">${P}</div>`),j=I.default.join(r,a.path);await H.default.promises.mkdir(j,{recursive:!0}),await H.default.promises.writeFile(I.default.join(j,"index.html"),C,"utf-8")}catch(P){console.error(`[boltdocs] Error SSR rendering route ${a.path}:`,P&&(P.stack||P))}}));let w=le(s.map(a=>a.path),i);H.default.writeFileSync(I.default.join(r,"sitemap.xml"),w,"utf-8");let y=bt(i);H.default.writeFileSync(I.default.join(r,"robots.txt"),y,"utf-8"),console.log(`[boltdocs] Generated ${s.length} static pages + sitemap.xml + robots.txt`);let{flushCache:$}=await Promise.resolve().then(()=>(it(),Nt));await $()}T();var _=v(require("path"));p();T();var qt=v(require("path")),ge=v(require("fs"));function fe(o,t){let e=o.homePage?`import HomePage from '${R(o.homePage)}';`:"",r=qt.default.resolve(process.cwd(),"index.css"),i=ge.default.existsSync(r)?"import './index.css';":"",s=o.homePage?"homePage: HomePage,":"",c=t?.plugins?.flatMap(y=>Object.entries(y.components||{}))||[],u=c.map(([y,$])=>`import * as _comp_${y} from '${R($)}';
17
- const ${y} = _comp_${y}.default || _comp_${y}['${y}'] || _comp_${y};`).join(`
18
- `),n=c.map(([y])=>y).join(", "),l=qt.default.basename(o.docsDir||"docs"),d=Object.entries(t?.external||{}),f=d.map(([y,$],a)=>`import _ext_${a} from '${R($)}';`).join(`
19
- `),w=d.length>0?`externalPages: { ${d.map(([y],$)=>`"${y}": _ext_${$}`).join(", ")} },`:"";return`
16
+ `;return s.trim()}var go=(0,ue.fileURLToPath)($),pe=O.default.dirname(go),me=(0,ge.createRequire)($);async function qt(o){let{docsDir:t,docsDirName:e,outDir:r,config:i}=o,s=await q(t,i),c=["tsx","ts","jsx","js"].map(a=>O.default.resolve(t,`pages-external/index.${a}`)).find(a=>I.default.existsSync(a));if(c)try{let a=I.default.readFileSync(c,"utf-8"),h=a.match(/pages\s*:\s*{([^}]+)}/s);if(h){let f=h[1].split(",").map(b=>b.split(":")[0].trim().replace(/['"]/g,"")).filter(b=>b&&b.startsWith("/"));for(let b of f)s.some(v=>v.path===b)||s.push({path:b,title:b.slice(1).charAt(0).toUpperCase()+b.slice(2),filePath:"",componentPath:"",_content:""})}a.includes("homePage")&&!s.some(f=>f.path==="/")&&s.push({path:"/",title:"Home",filePath:"",componentPath:"",_content:""})}catch(a){console.warn("[boltdocs] Failed to parse external routes for SSG:",a)}let u=O.default.resolve(pe,"../client/ssr.js");if(!I.default.existsSync(u)){console.error("[boltdocs] SSR module not found at",u,"- Did you build the core package?");return}let n=me("module"),l=n.prototype.require;n.prototype.require=function(a,...h){return a.startsWith("virtual:boltdocs-")?a==="virtual:boltdocs-layout"?{__esModule:!0,default:function(b){try{let y=l.apply(this,[O.default.resolve(pe,"../client/index.js")]).DefaultLayout||(({children:D})=>D);return l.apply(this,["react"]).createElement(y,b)}catch{return b.children}}}:a==="virtual:boltdocs-mdx-components"?{__esModule:!0,default:{}}:a==="virtual:boltdocs-config"?{__esModule:!0,default:i}:{__esModule:!0,default:a.includes("routes")?[]:{}}:l.apply(this,[a,...h])};let{render:d}=me(u);n.prototype.require=l;let g=O.default.join(r,"index.html");if(!I.default.existsSync(g)){console.warn("[boltdocs] No index.html found in outDir, skipping SSG.");return}let C=I.default.readFileSync(g,"utf-8");await Promise.all(s.map(async a=>{let h=Ht(i?.theme?.title,a.locale)||"Boltdocs",f=Ht(i?.theme?.description,a.locale)||"",b=`${a.title} | ${h}`,v=a.description||f,y={};y[`/${e}/${a.filePath}`]={default:()=>null};try{let S=await d({path:a.path,routes:s,config:i||{},docsDirName:e,modules:y,homePage:void 0}),D=le(C,{title:z(b),description:z(v)}).replace("<!--app-html-->",S).replace('<div id="root"></div>',`<div id="root">${S}</div>`),H=O.default.join(r,a.path);await I.default.promises.mkdir(H,{recursive:!0}),await I.default.promises.writeFile(O.default.join(H,"index.html"),D,"utf-8")}catch(S){console.error(`[boltdocs] Error SSR rendering route ${a.path}:`,S&&(S.stack||S))}}));let w=de(s.map(a=>a.path),i);I.default.writeFileSync(O.default.join(r,"sitemap.xml"),w,"utf-8");let x=wt(i);I.default.writeFileSync(O.default.join(r,"robots.txt"),x,"utf-8"),console.log(`[boltdocs] Generated ${s.length} static pages + sitemap.xml + robots.txt`);let{flushCache:p}=await Promise.resolve().then(()=>(it(),Ut));await p()}F();var T=P(require("path"));m();F();var rt=P(require("path")),Jt=P(require("fs"));function fe(o,t){let e=o.homePage?`import HomePage from '${R(o.homePage)}';`:"",r=rt.default.resolve(process.cwd(),"index.css"),i=Jt.default.existsSync(r)?"import './index.css';":"",s=o.homePage?"homePage: HomePage,":"",c=t?.plugins?.flatMap(x=>Object.entries(x.components||{}))||[],u=c.map(([x,p])=>`import * as _comp_${x} from '${R(p)}';
17
+ const ${x} = _comp_${x}.default || _comp_${x}['${x}'] || _comp_${x};`).join(`
18
+ `),n=c.map(([x])=>x).join(", "),l=rt.default.basename(o.docsDir||"docs"),d=rt.default.resolve(process.cwd(),o.docsDir||"docs"),g=["tsx","ts","jsx","js"].map(x=>rt.default.resolve(d,`pages-external/index.${x}`)).find(x=>Jt.default.existsSync(x)),C=g?`import * as _external_module from '${R(g)}';`:"";return s=g?"homePage: _external_module.homePage || HomePage,":o.homePage?"homePage: HomePage,":"",`
20
19
  import { createBoltdocsApp as _createApp } from 'boltdocs/client';
21
20
  import _routes from 'virtual:boltdocs-routes';
22
21
  import _config from 'virtual:boltdocs-config';
@@ -24,7 +23,7 @@ import _user_mdx_components from 'virtual:boltdocs-mdx-components';
24
23
  ${i}
25
24
  ${e}
26
25
  ${u}
27
- ${f}
26
+ ${C}
28
27
 
29
28
  _createApp({
30
29
  target: '#root',
@@ -34,10 +33,10 @@ _createApp({
34
33
  modules: import.meta.glob('/${l}/**/*.{md,mdx}'),
35
34
  hot: import.meta.hot,
36
35
  ${s}
37
- ${w}
36
+ ${g?"externalPages: _external_module.pages, externalLayout: _external_module.layout,":""}
38
37
  components: { ${n}${n?", ":""} ...(_user_mdx_components || {}) },
39
38
  });
40
- `}p();function wt(o){return`<!doctype html>
39
+ `}m();function Pt(o){return`<!doctype html>
41
40
  <html lang="en">
42
41
  <head>
43
42
  <meta charset="UTF-8" />
@@ -47,7 +46,7 @@ _createApp({
47
46
  <body>
48
47
  <div id="root"></div>
49
48
  </body>
50
- </html>`}function Jt(o,t){let e=t.theme,r=e?.title||"Boltdocs",i=e?.description||"",s=e?.favicon;!s&&e?.logo&&(typeof e.logo=="string"?s=e.logo:s=e.logo.light||e.logo.dark);let c=[s?`<link rel="icon" href="${s}">`:"",`<meta name="description" content="${i}">`,`<meta property="og:title" content="${r}">`,`<meta property="og:description" content="${i}">`,e?.ogImage?`<meta property="og:image" content="${e.ogImage}">`:"",'<meta property="og:type" content="website">','<meta name="twitter:card" content="summary_large_image">',`<meta name="twitter:title" content="${r}">`,`<meta name="twitter:description" content="${i}">`,e?.ogImage?`<meta name="twitter:image" content="${e.ogImage}">`:"",'<meta name="generator" content="Boltdocs">'].filter(Boolean).join(`
49
+ </html>`}function Kt(o,t){let e=t.theme,r=e?.title||"Boltdocs",i=e?.description||"",s=e?.favicon;!s&&e?.logo&&(typeof e.logo=="string"?s=e.logo:s=e.logo.light||e.logo.dark);let c=[s?`<link rel="icon" href="${s}">`:"",`<meta name="description" content="${i}">`,`<meta property="og:title" content="${r}">`,`<meta property="og:description" content="${i}">`,e?.ogImage?`<meta property="og:image" content="${e.ogImage}">`:"",'<meta property="og:type" content="website">','<meta name="twitter:card" content="summary_large_image">',`<meta name="twitter:title" content="${r}">`,`<meta name="twitter:description" content="${i}">`,e?.ogImage?`<meta name="twitter:image" content="${e.ogImage}">`:"",'<meta name="generator" content="Boltdocs">'].filter(Boolean).join(`
51
50
  `),u=`
52
51
  <script>
53
52
  (function() {
@@ -67,13 +66,13 @@ _createApp({
67
66
  `;return o.includes("<title>")?o=o.replace(/<title>.*?<\/title>/,`<title>${r}</title>`):o=o.replace("</head>",` <title>${r}</title>
68
67
  </head>`),o=o.replace("</head>",` ${c}
69
68
  ${u} </head>`),!o.includes("src/main")&&!o.includes("virtual:boltdocs-entry")&&(o=o.replace("</body>",` <script type="module">import "virtual:boltdocs-entry";</script>
70
- </body>`)),o}p();function he(o){let t=[];for(let e of o)if(t.push({id:e.path,title:e.title,content:e._content||"",url:e.path,display:e.groupTitle?`${e.groupTitle} > ${e.title}`:e.title,locale:e.locale,version:e.version}),e.headings)for(let r of e.headings)t.push({id:`${e.path}#${r.id}`,title:r.text,content:`${r.text} in ${e.title}`,url:`${e.path}#${r.id}`,display:`${e.title} > ${r.text}`,locale:e.locale,version:e.version});return t}var Kt=v(require("fs"));p();function ve(o={},t){let e=_.default.resolve(process.cwd(),o.docsDir||"docs"),r=R(e),i=t,s,c=!1,u=i?.plugins?.flatMap(n=>n.vitePlugins||[])||[];return[{name:"vite-plugin-boltdocs",enforce:"pre",async config(n,l){c=l.command==="build";let d=n.envDir||process.cwd(),f=(0,ye.loadEnv)(l.mode,d,"");return Object.assign(process.env,f),i||(i=await M(e)),{optimizeDeps:{include:["react","react-dom"],exclude:["boltdocs","boltdocs/client","boltdocs/hooks","boltdocs/primitives","boltdocs/base-ui","boltdocs/mdx","boltdocs/integrations","boltdocs/client/hooks","boltdocs/client/primitives"]}}},configResolved(n){s=n},configureServer(n){n.middlewares.use((a,m,x)=>{if(a.url==="/robots.txt"){let h=bt(i);m.statusCode=200,m.setHeader("Content-Type","text/plain"),m.end(h);return}x()}),n.middlewares.use(async(a,m,x)=>{let h=a.url?.split("?")[0]||"/",B=a.headers.accept||"",g=h==="/"||h.startsWith("/docs")||i.i18n&&Object.keys(i.i18n.locales).some(C=>h.startsWith(`/${C}/docs`)||h===`/${C}`)||i.external&&Object.keys(i.external).some(C=>h.startsWith(C)),P=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(h);if(B.includes("text/html")&&!P&&g){let C=wt(i);C=Jt(C,i),C=await n.transformIndexHtml(a.url||"/",C),m.statusCode=200,m.setHeader("Content-Type","text/html"),m.end(C);return}x()});let l=vt.map(a=>_.default.resolve(process.cwd(),a)),d=["tsx","jsx"],f=d.map(a=>_.default.resolve(e,`layout.${a}`)),w=["tsx","ts","jsx","js"],y=w.map(a=>_.default.resolve(e,`mdx-components.${a}`));n.watcher.add([...l,...y,...f]);let $=async(a,m)=>{try{let x=R(a);if(vt.some(g=>x.endsWith(g))){n.restart();return}if(w.some(g=>x.endsWith(`mdx-components.${g}`))){let g=n.moduleGraph.getModuleById("\0virtual:boltdocs-mdx-components");g&&n.moduleGraph.invalidateModule(g),n.ws.send({type:"full-reload"});return}if(d.some(g=>x.endsWith(`layout.${g}`))){let g=n.moduleGraph.getModuleById("\0virtual:boltdocs-layout");g&&n.moduleGraph.invalidateModule(g),n.ws.send({type:"full-reload"});return}if(!x.startsWith(r)||!Qt(x))return;if(m==="add"||m==="unlink"){Ut(),i=await M(e);let g=n.moduleGraph.getModuleById("\0virtual:boltdocs-config");g&&n.moduleGraph.invalidateModule(g),n.ws.send({type:"custom",event:"boltdocs:config-update",data:{theme:i?.theme,integrations:i?.integrations,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl}})}else Gt(a);let h=await q(e,i,"/docs",m!=="change"),B=n.moduleGraph.getModuleById("\0virtual:boltdocs-routes");B&&n.moduleGraph.invalidateModule(B),n.ws.send({type:"custom",event:"boltdocs:routes-update",data:h})}catch(x){console.error(`[boltdocs] HMR error during ${m} event:`,x)}};n.watcher.on("add",a=>$(a,"add")),n.watcher.on("unlink",a=>$(a,"unlink")),n.watcher.on("change",a=>$(a,"change"))},resolveId(n){if(n==="virtual:boltdocs-routes"||n==="virtual:boltdocs-config"||n==="virtual:boltdocs-entry"||n==="virtual:boltdocs-mdx-components"||n==="virtual:boltdocs-layout"||n==="virtual:boltdocs-search")return"\0"+n},async load(n){if(n==="\0virtual:boltdocs-routes"){let l=await q(e,i);return`export default ${JSON.stringify(l,null,2)};`}if(n==="\0virtual:boltdocs-config"){let l={theme:i?.theme,integrations:i?.integrations,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl};return`export default ${JSON.stringify(l,null,2)};`}if(n==="\0virtual:boltdocs-entry")return fe(o,i);if(n==="\0virtual:boltdocs-mdx-components"){let l=["tsx","ts","jsx","js"],d=null;for(let f of l){let w=_.default.resolve(e,`mdx-components.${f}`);if(Kt.default.existsSync(w)){d=w;break}}if(d){let f=R(d);return`import * as components from '${f}';
69
+ </body>`)),o}m();function he(o){let t=[];for(let e of o)if(t.push({id:e.path,title:e.title,content:e._content||"",url:e.path,display:e.groupTitle?`${e.groupTitle} > ${e.title}`:e.title,locale:e.locale,version:e.version}),e.headings)for(let r of e.headings)t.push({id:`${e.path}#${r.id}`,title:r.text,content:`${r.text} in ${e.title}`,url:`${e.path}#${r.id}`,display:`${e.title} > ${r.text}`,locale:e.locale,version:e.version});return t}var Xt=P(require("fs"));m();function ve(o={},t){let e=T.default.resolve(process.cwd(),o.docsDir||"docs"),r=R(e),i=t,s,c=!1,u=i?.plugins?.flatMap(n=>n.vitePlugins||[])||[];return[{name:"vite-plugin-boltdocs",enforce:"pre",async config(n,l){c=l.command==="build";let d=n.envDir||process.cwd(),g=(0,ye.loadEnv)(l.mode,d,"");return Object.assign(process.env,g),i||(i=await _(e)),{optimizeDeps:{include:["react","react-dom"],exclude:["boltdocs","boltdocs/client","boltdocs/hooks","boltdocs/primitives","boltdocs/base-ui","boltdocs/mdx","boltdocs/integrations","boltdocs/client/hooks","boltdocs/client/primitives"]}}},configResolved(n){s=n},configureServer(n){n.middlewares.use((a,h,f)=>{if(a.url==="/robots.txt"){let b=wt(i);h.statusCode=200,h.setHeader("Content-Type","text/plain"),h.end(b);return}f()}),n.middlewares.use(async(a,h,f)=>{let b=a.url?.split("?")[0]||"/",v=a.headers.accept||"",y=b==="/"||b.startsWith("/docs")||i.i18n&&Object.keys(i.i18n.locales).some(D=>b.startsWith(`/${D}/docs`)||b===`/${D}`)||!0,S=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(b);if(v.includes("text/html")&&!S&&y){let D=Pt(i);D=Kt(D,i),D=await n.transformIndexHtml(a.url||"/",D),h.statusCode=200,h.setHeader("Content-Type","text/html"),h.end(D);return}f()});let l=bt.map(a=>T.default.resolve(process.cwd(),a)),d=["tsx","jsx"],g=d.map(a=>T.default.resolve(e,`layout.${a}`)),C=["tsx","ts","jsx","js"],w=C.map(a=>T.default.resolve(e,`mdx-components.${a}`)),x=C.map(a=>T.default.resolve(e,`pages-external/index.${a}`));n.watcher.add([...l,...w,...g,...x]);let p=async(a,h)=>{try{let f=R(a);if(bt.some(y=>f.endsWith(y))){n.restart();return}if(C.some(y=>f.endsWith(`mdx-components.${y}`))){let y=n.moduleGraph.getModuleById("\0virtual:boltdocs-mdx-components");y&&n.moduleGraph.invalidateModule(y),n.ws.send({type:"full-reload"});return}if(d.some(y=>f.endsWith(`layout.${y}`))){let y=n.moduleGraph.getModuleById("\0virtual:boltdocs-layout");y&&n.moduleGraph.invalidateModule(y),n.ws.send({type:"full-reload"});return}if(f.includes("/pages-external/")||f.includes("\\pages-external\\")){let y=n.moduleGraph.getModuleById("\0virtual:boltdocs-entry");y&&n.moduleGraph.invalidateModule(y),n.ws.send({type:"full-reload"});return}if(!f.startsWith(r)||!te(f))return;if(h==="add"||h==="unlink"){Gt(),i=await _(e);let y=n.moduleGraph.getModuleById("\0virtual:boltdocs-config");y&&n.moduleGraph.invalidateModule(y),n.ws.send({type:"custom",event:"boltdocs:config-update",data:{theme:i?.theme,integrations:i?.integrations,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl}})}else Wt(a);let b=await q(e,i,"/docs",h!=="change"),v=n.moduleGraph.getModuleById("\0virtual:boltdocs-routes");v&&n.moduleGraph.invalidateModule(v),n.ws.send({type:"custom",event:"boltdocs:routes-update",data:b})}catch(f){console.error(`[boltdocs] HMR error during ${h} event:`,f)}};n.watcher.on("add",a=>p(a,"add")),n.watcher.on("unlink",a=>p(a,"unlink")),n.watcher.on("change",a=>p(a,"change"))},resolveId(n){if(n==="virtual:boltdocs-routes"||n==="virtual:boltdocs-config"||n==="virtual:boltdocs-entry"||n==="virtual:boltdocs-mdx-components"||n==="virtual:boltdocs-layout"||n==="virtual:boltdocs-search")return"\0"+n},async load(n){if(n==="\0virtual:boltdocs-routes"){let l=await q(e,i);return`export default ${JSON.stringify(l,null,2)};`}if(n==="\0virtual:boltdocs-config"){let l={theme:i?.theme,integrations:i?.integrations,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl,plugins:i?.plugins?.map(d=>({name:d.name}))};return`export default ${JSON.stringify(l,null,2)};`}if(n==="\0virtual:boltdocs-entry")return fe(o,i);if(n==="\0virtual:boltdocs-mdx-components"){let l=["tsx","ts","jsx","js"],d=null;for(let g of l){let C=T.default.resolve(e,`mdx-components.${g}`);if(Xt.default.existsSync(C)){d=C;break}}if(d){let g=R(d);return`import * as components from '${g}';
71
70
  const mdxComponents = components.default || components;
72
71
  export default mdxComponents;
73
- export * from '${f}';`}return"export default {};"}if(n==="\0virtual:boltdocs-layout"){let l=["tsx","jsx"],d=null;for(let f of l){let w=_.default.resolve(e,`layout.${f}`);if(Kt.default.existsSync(w)){d=w;break}}return d?`import UserLayout from '${R(d)}';
72
+ export * from '${g}';`}return"export default {};"}if(n==="\0virtual:boltdocs-layout"){let l=["tsx","jsx"],d=null;for(let g of l){let C=T.default.resolve(e,`layout.${g}`);if(Xt.default.existsSync(C)){d=C;break}}return d?`import UserLayout from '${R(d)}';
74
73
  export default UserLayout;`:`import { DefaultLayout } from 'boltdocs/client';
75
- export default DefaultLayout;`}if(n==="\0virtual:boltdocs-search"){let l=await q(e,i),d=he(l);return`export default ${JSON.stringify(d,null,2)};`}},transformIndexHtml:{order:"pre",handler(n){return Jt(n,i)}},async closeBundle(){if(!c)return;let n=s?.build?.outDir?_.default.resolve(s.root,s.build.outDir):_.default.resolve(process.cwd(),"dist"),l=_.default.basename(e||"docs");await Vt({docsDir:e,docsDirName:l,outDir:n,config:i});let{flushCache:d}=await Promise.resolve().then(()=>(it(),Nt));await d()}},(0,xe.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:"preset-default"}]}}),...u.filter(n=>!!n)]}p();var De=v(require("@mdx-js/rollup")),Re=v(require("remark-gfm")),ke=v(require("remark-frontmatter")),Me=v(require("rehype-slug")),Te=v(require("crypto"));p();it();var be="v3",J=new ot("mdx");p();var $e=require("unist-util-visit");p();var we=require("shiki"),$t=null;async function Pt(o){if($t)return $t;let t=typeof o=="object"?[o.light,o.dark]:[o??"github-dark"];return["github-light","github-dark"].forEach(e=>{t.includes(e)||t.push(e)}),$t=await(0,we.createHighlighter)({themes:t,langs:["tsx","jsx","ts","js","json","md","mdx","css","html","bash","sh","yaml","yml"]}),$t}function Pe(o){return async t=>{let e=o?.theme?.codeTheme??{light:"github-light",dark:"github-dark"},r=await Pt(e);(0,$e.visit)(t,["mdxJsxFlowElement","mdxJsxTextElement"],i=>{if(i.name!=="ComponentPreview")return;let s=i.attributes?.find(l=>l.name==="code"),c="";if(s){if(typeof s.value=="string")c=s.value;else if(s.value?.type==="mdxJsxAttributeValueExpression"){let l=s.value.value??"";c=l.match(/^[`'"](.+)[`'"]$/)?.[1]??l}}if(!c)return;let u=typeof e=="object"?{themes:{light:e.light,dark:e.dark},lang:"tsx"}:{theme:e,lang:"tsx"},n=r.codeToHtml(c,u);i.attributes=(i.attributes??[]).filter(l=>l.name!=="highlightedHtml"),i.attributes.push({type:"mdxJsxAttribute",name:"highlightedHtml",value:n})})}}p();var Ce=require("unist-util-visit");function Se(o){return async t=>{let e=o?.theme?.codeTheme||{light:"github-light",dark:"github-dark"},r=await Pt(e);(0,Ce.visit)(t,"element",i=>{if(i.tagName==="pre"&&i.children?.[0]?.tagName==="code"){let s=i.children[0],u=(s.properties?.className||[]).find(w=>w.startsWith("language-")),n=u?u.slice(9):"text",l=s.children[0]?.value||"",d={lang:n};typeof e=="object"?d.themes={light:e.light,dark:e.dark}:d.theme=e;let f=r.codeToHtml(l,d);i.properties.dataHighlighted="true",i.properties.highlightedHtml=f,i.children=[]}})}}var Be=!1,Ct=0,rt=0;function _e(o,t=De.default){let e=o?.plugins?.flatMap(s=>s.remarkPlugins||[])||[],r=o?.plugins?.flatMap(s=>s.rehypePlugins||[])||[],i=t({remarkPlugins:[Re.default,ke.default,[Pe,o],...e],rehypePlugins:[Me.default,[Se,o],...r],jsxRuntime:"automatic",providerImportSource:"@mdx-js/react"});return{...i,name:"vite-plugin-boltdocs-mdx",async buildStart(){Ct=0,rt=0,Be||(J.load(),Be=!0),i.buildStart&&await i.buildStart.call(this)},async transform(s,c,u){if(!c.endsWith(".md")&&!c.endsWith(".mdx"))return i.transform?.call(this,s,c,u);console.log(`[boltdocs] Transforming MDX: ${c}`),rt++;let n=Te.default.createHash("md5").update(s).digest("hex"),l=`${c}:${n}:${be}`,d=J.get(l);if(d)return Ct++,{code:d,map:null};let f=await i.transform.call(this,s,c,u);return f&&typeof f=="object"&&f.code&&J.set(l,f.code),f},async buildEnd(){rt>0&&console.log(`[boltdocs] MDX Cache Performance: ${Ct}/${rt} hits (${Math.round(Ct/rt*100)||0}%)`),J.save(),await J.flush(),i.buildEnd&&await i.buildEnd.call(this)}}}async function Ie(o){let t=o?.docsDir||"docs",e=await M(t),r={...o,homePage:o?.homePage||e.homePage};return[...ve(r,e),_e(e)]}async function st(o,t="development"){let e=await M("docs",o);return{root:o,mode:t,plugins:[(0,Fe.default)(),(0,Oe.default)(),await Ie({docsDir:e.docsDir,homePage:e.homePage})],...e.vite}}var lt={};Yt(lt,{colors:()=>K,error:()=>F,formatLog:()=>St,info:()=>at,success:()=>ct});p();var K={reset:"\x1B[0m",bold:"\x1B[1m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m"};function St(o,t=""){return`${t}${K.bold}[boltdocs]${K.reset} ${o}${K.reset}`}function at(o){console.log(St(o))}function F(o,t){console.error(St(o,K.red)),t&&console.error(t)}function ct(o){console.log(St(o,K.green))}async function Le(o=process.cwd()){try{let t=await st(o,"development"),e=await(0,je.createServer)(t);await e.listen(),e.printUrls(),e.bindCLIShortcuts({print:!0})}catch(t){F("Failed to start dev server:",t),process.exit(1)}}p();var Bt=require("vite");var He=v(require("path")),dt=v(require("fs"));async function Ae(o=process.cwd()){let t=!1,e=He.default.resolve(o,"index.html");try{if(!dt.default.existsSync(e)){let i=await M("docs",o);dt.default.writeFileSync(e,wt(i),"utf-8"),t=!0}let r=await st(o,"production");await(0,Bt.build)(r),ct("Build completed successfully.")}catch(r){F("Build failed:",r),process.exit(1)}finally{t&&dt.default.existsSync(e)&&dt.default.unlinkSync(e)}}async function Ee(o=process.cwd()){try{let t=await st(o,"production");(await(0,Bt.preview)(t)).printUrls()}catch(t){F("Failed to start preview server:",t),process.exit(1)}}p();var A=v(require("path")),mt=v(require("fs")),ze=v(require("fast-glob"));T();async function Ne(o=process.cwd()){let{colors:t}=lt;at(`${t.bold}Running documentation health check...${t.reset}
76
- `);let e=performance.now();try{let r=await M("docs",o),i=A.default.resolve(o,"docs");mt.default.existsSync(i)||(F(`Documentation directory not found at ${i}`),process.exit(1));let s=await(0,ze.default)(["**/*.md","**/*.mdx"],{cwd:i,absolute:!0,suppressErrors:!0}),c=0,u=0,n=0,l=new Map,d=(y,$)=>{let a=A.default.relative(i,y),m=l.get(a);m||(m=[],l.set(a,m)),m.push($),$.level==="high"?c++:$.level==="warning"?u++:$.level==="low"&&n++},f="/docs";for(let y of s){let{data:$,content:a}=ft(y);$.title||d(y,{level:"warning",message:'Missing "title" in frontmatter.',suggestion:"Add `title: Your Title` to the YAML frontmatter at the top of the file."}),$.description||d(y,{level:"low",message:'Missing "description" in frontmatter.',suggestion:"Adding a description helps with SEO and search previews."});let m=/\[.*?\]\((.*?)\)/g,x=/<a\s+[^>]*href=["']([^"']+)["'][^>]*>/g,h=[...a.matchAll(m),...a.matchAll(x)];for(let B of h){let g=B[1];if(!g||g.startsWith("http")||g.startsWith("https")||g.startsWith("#")||g.startsWith("mailto:")||g.startsWith("tel:")||(g=g.split("#")[0],!g))continue;let P;if(g.startsWith("/")){let N=g;(g.startsWith(f+"/")||g===f)&&(N=g.substring(f.length)),P=A.default.join(i,N)}else P=A.default.resolve(A.default.dirname(y),g);let C=["",".md",".mdx","/index.md","/index.mdx"],j=!1;for(let N of C){let X=P+N;if(mt.default.existsSync(X)&&mt.default.statSync(X).isFile()){j=!0;break}}j||d(y,{level:"high",message:`Broken internal link: "${g}"`,suggestion:`Ensure the file exists at "${P}". If it's a directory, ensure it has an "index.md" or "index.mdx".`})}}if(r.i18n){let{defaultLocale:y,locales:$}=r.i18n,a=Object.keys($).filter(m=>m!==y);for(let m of s){let h=R(A.default.relative(i,m)).split("/");if(h[0]===y){let B=h.slice(1).join("/");for(let g of a){let P=[g,...h.slice(1)],C=A.default.join(i,...P);mt.default.existsSync(C)||d(m,{level:"warning",message:`Missing translation for locale "${g}"`,suggestion:`Create a translated version of this file at "${g}/${B}".`})}}}}if(l.size===0)ct(`All documentation files are healthy!
77
- `);else{for(let[y,$]of l.entries()){console.log(`\u{1F4C4} ${t.bold}${y}${t.reset}`);let a=$.sort((m,x)=>{let h={high:1,warning:2,low:3};return h[m.level]-h[x.level]});for(let m of a){let x="",h="";m.level==="high"?(x="\u274C",h=t.red):m.level==="warning"?(x="\u26A0\uFE0F",h=t.yellow):(x="\u2139\uFE0F",h=t.cyan),console.log(` ${h}${x} ${m.level.toUpperCase()}:${t.reset} ${m.message}`),m.suggestion&&console.log(` ${t.gray}\u{1F4A1} Suggestion: ${m.suggestion}${t.reset}`)}console.log("")}console.log(`${t.bold}Summary:${t.reset}`),console.log(` ${t.red}${c} high-level errors${t.reset}`),console.log(` ${t.yellow}${u} warnings${t.reset}`),console.log(` ${t.cyan}${n} minor improvements${t.reset}
78
- `),c>0&&F("HIGH ERROR: Fix these to ensure your documentation builds correctly."),(u>0||n>0)&&at("TIP: Address warnings and suggestions for premium quality docs."),console.log("")}let w=performance.now()-e;at(`Finished in ${w.toFixed(2)}ms
79
- `),c>0&&process.exit(1)}catch(r){F("Failed to run doctor check:",r),process.exit(1)}}var z=(0,Ue.default)("boltdocs");z.command("[root]","Start development server").alias("dev").action(Le);z.command("build [root]","Build for production").action(Ae);z.command("preview [root]","Preview production build").action(Ee);z.command("doctor [root]","Check documentation health").action(Ne);z.help();z.version("2.0.0");z.parse();
74
+ export default DefaultLayout;`}if(n==="\0virtual:boltdocs-search"){let l=await q(e,i),d=he(l);return`export default ${JSON.stringify(d,null,2)};`}},transformIndexHtml:{order:"pre",handler(n){return Kt(n,i)}},async closeBundle(){if(!c)return;let n=s?.build?.outDir?T.default.resolve(s.root,s.build.outDir):T.default.resolve(process.cwd(),"dist"),l=T.default.basename(e||"docs");await qt({docsDir:e,docsDirName:l,outDir:n,config:i});let{flushCache:d}=await Promise.resolve().then(()=>(it(),Ut));await d()}},(0,xe.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:"preset-default"}]}}),...u.filter(n=>!!n)]}m();var Re=P(require("@mdx-js/rollup")),ke=P(require("remark-gfm")),_e=P(require("remark-frontmatter")),Te=P(require("rehype-slug")),Fe=P(require("crypto"));m();it();var be="v4",J=new ot("mdx");m();var Pe=require("unist-util-visit");m();var we=require("shiki"),$t=null;async function Ct(o){if($t)return $t;let t=typeof o=="object"?[o.light,o.dark]:[o??"github-dark"];return["github-light","github-dark"].forEach(e=>{t.includes(e)||t.push(e)}),$t=await(0,we.createHighlighter)({themes:t,langs:["tsx","jsx","ts","js","json","md","mdx","css","html","bash","sh","yaml","yml"]}),$t}function $e(o){return async t=>{let e=o?.theme?.codeTheme??{light:"github-light",dark:"github-dark"},r=await Ct(e);(0,Pe.visit)(t,["mdxJsxFlowElement","mdxJsxTextElement"],i=>{if(i.name!=="ComponentPreview")return;let s=i.attributes?.find(l=>l.name==="code"),c="";if(s){if(typeof s.value=="string")c=s.value;else if(s.value?.type==="mdxJsxAttributeValueExpression"){let l=s.value.value??"";c=l.match(/^[`'"]([\s\S]+)[`'"]$/)?.[1]??l}}if(!c)return;let u=typeof e=="object"?{themes:{light:e.light,dark:e.dark},lang:"tsx"}:{theme:e,lang:"tsx"},n=r.codeToHtml(c,u);i.attributes=(i.attributes??[]).filter(l=>l.name!=="highlightedHtml"),i.attributes.push({type:"mdxJsxAttribute",name:"highlightedHtml",value:n})})}}m();var Ce=require("unist-util-visit");function Se(o){return async t=>{let e=o?.theme?.codeTheme||{light:"github-light",dark:"github-dark"},r=await Ct(e);(0,Ce.visit)(t,"element",i=>{if(i.tagName==="pre"&&i.children?.[0]?.tagName==="code"){let s=i.children[0],u=(s.properties?.className||[]).find(p=>p.startsWith("language-")),n=u?u.slice(9):"text",l=s.children[0]?.value||"",g=(s.data?.meta||s.properties?.metastring||"").match(/title\s*=\s*"([^"]*)"/),C=g?g[1]:void 0,w={lang:n};typeof e=="object"?w.themes={light:e.light,dark:e.dark}:w.theme=e;let x=r.codeToHtml(l,w);i.properties.dataHighlighted="true",i.properties.highlightedHtml=x,i.properties["data-lang"]=n,C&&(i.properties.title=C),i.children=[]}})}}m();var De=require("unist-util-visit");function Be(){return o=>{(0,De.visit)(o,"code",t=>{if(t.data=t.data||{},t.data.hProperties=t.data.hProperties||{},t.lang&&(t.data.hProperties["data-lang"]=t.lang),!t.meta)return;let e=t.meta,r=e.match(/title\s*=\s*"([^"]*)"/);r&&(t.data.hProperties.title=r[1]),t.data.hProperties.metastring=e})}}var Me=!1,St=0,st=0;function Ie(o,t=Re.default){let e=o?.plugins?.flatMap(s=>s.remarkPlugins||[])||[],r=o?.plugins?.flatMap(s=>s.rehypePlugins||[])||[],i=t({remarkPlugins:[ke.default,_e.default,Be,[$e,o],...e],rehypePlugins:[Te.default,[Se,o],...r],jsxRuntime:"automatic",providerImportSource:"@mdx-js/react"});return{...i,name:"vite-plugin-boltdocs-mdx",async buildStart(){St=0,st=0,Me||(J.load(),Me=!0),i.buildStart&&await i.buildStart.call(this)},async transform(s,c,u){if(!c.endsWith(".md")&&!c.endsWith(".mdx"))return i.transform?.call(this,s,c,u);console.log(`[boltdocs] Transforming MDX: ${c}`),st++;let n=Fe.default.createHash("md5").update(s).digest("hex"),l=`${c}:${n}:${be}`,d=J.get(l);if(d)return St++,{code:d,map:null};let g=await i.transform.call(this,s,c,u);return g&&typeof g=="object"&&g.code&&J.set(l,g.code),g},async buildEnd(){st>0&&console.log(`[boltdocs] MDX Cache Performance: ${St}/${st} hits (${Math.round(St/st*100)||0}%)`),J.save(),await J.flush(),i.buildEnd&&await i.buildEnd.call(this)}}}async function He(o){let t=o?.docsDir||"docs",e=await _(t),r={...o,homePage:o?.homePage||e.homePage};return[...ve(r,e),Ie(e)]}async function at(o,t="development"){let e=await _("docs",o);return{root:o,mode:t,plugins:[(0,Oe.default)(),(0,je.default)(),await He({docsDir:e.docsDir,homePage:e.homePage})],...e.vite}}var dt={};Zt(dt,{colors:()=>K,error:()=>j,formatLog:()=>Dt,info:()=>ct,success:()=>lt});m();var K={reset:"\x1B[0m",bold:"\x1B[1m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m"};function Dt(o,t=""){return`${t}${K.bold}[boltdocs]${K.reset} ${o}${K.reset}`}function ct(o){console.log(Dt(o))}function j(o,t){console.error(Dt(o,K.red)),t&&console.error(t)}function lt(o){console.log(Dt(o,K.green))}async function Ae(o=process.cwd()){try{let t=await at(o,"development"),e=await(0,Le.createServer)(t);await e.listen(),e.printUrls(),e.bindCLIShortcuts({print:!0})}catch(t){j("Failed to start dev server:",t),process.exit(1)}}m();var Bt=require("vite");var Ee=P(require("path")),pt=P(require("fs"));async function ze(o=process.cwd()){let t=!1,e=Ee.default.resolve(o,"index.html");try{if(!pt.default.existsSync(e)){let i=await _("docs",o);pt.default.writeFileSync(e,Pt(i),"utf-8"),t=!0}let r=await at(o,"production");await(0,Bt.build)(r),lt("Build completed successfully.")}catch(r){j("Build failed:",r),process.exit(1)}finally{t&&pt.default.existsSync(e)&&pt.default.unlinkSync(e)}}async function Ne(o=process.cwd()){try{let t=await at(o,"production");(await(0,Bt.preview)(t)).printUrls()}catch(t){j("Failed to start preview server:",t),process.exit(1)}}m();var E=P(require("path")),mt=P(require("fs")),Ue=P(require("fast-glob"));F();async function Ge(o=process.cwd()){let{colors:t}=dt;ct(`${t.bold}Running documentation health check...${t.reset}
75
+ `);let e=performance.now();try{let r=await _("docs",o),i=E.default.resolve(o,"docs");mt.default.existsSync(i)||(j(`Documentation directory not found at ${i}`),process.exit(1));let s=await(0,Ue.default)(["**/*.md","**/*.mdx"],{cwd:i,absolute:!0,suppressErrors:!0}),c=0,u=0,n=0,l=new Map,d=(w,x)=>{let p=E.default.relative(i,w),a=l.get(p);a||(a=[],l.set(p,a)),a.push(x),x.level==="high"?c++:x.level==="warning"?u++:x.level==="low"&&n++},g="/docs";for(let w of s){let{data:x,content:p}=ht(w);x.title||d(w,{level:"warning",message:'Missing "title" in frontmatter.',suggestion:"Add `title: Your Title` to the YAML frontmatter at the top of the file."}),x.description||d(w,{level:"low",message:'Missing "description" in frontmatter.',suggestion:"Adding a description helps with SEO and search previews."});let a=/\[.*?\]\((.*?)\)/g,h=/<a\s+[^>]*href=["']([^"']+)["'][^>]*>/g,f=[...p.matchAll(a),...p.matchAll(h)];for(let b of f){let v=b[1];if(!v||v.startsWith("http")||v.startsWith("https")||v.startsWith("#")||v.startsWith("mailto:")||v.startsWith("tel:")||(v=v.split("#")[0],!v))continue;let y;if(v.startsWith("/")){let H=v;(v.startsWith(g+"/")||v===g)&&(H=v.substring(g.length)),y=E.default.join(i,H)}else y=E.default.resolve(E.default.dirname(w),v);let S=["",".md",".mdx","/index.md","/index.mdx"],D=!1;for(let H of S){let X=y+H;if(mt.default.existsSync(X)&&mt.default.statSync(X).isFile()){D=!0;break}}D||d(w,{level:"high",message:`Broken internal link: "${v}"`,suggestion:`Ensure the file exists at "${y}". If it's a directory, ensure it has an "index.md" or "index.mdx".`})}}if(r.i18n){let{defaultLocale:w,locales:x}=r.i18n,p=Object.keys(x).filter(a=>a!==w);for(let a of s){let f=R(E.default.relative(i,a)).split("/");if(f[0]===w){let b=f.slice(1).join("/");for(let v of p){let y=[v,...f.slice(1)],S=E.default.join(i,...y);mt.default.existsSync(S)||d(a,{level:"warning",message:`Missing translation for locale "${v}"`,suggestion:`Create a translated version of this file at "${v}/${b}".`})}}}}if(l.size===0)lt(`All documentation files are healthy!
76
+ `);else{for(let[w,x]of l.entries()){console.log(`\u{1F4C4} ${t.bold}${w}${t.reset}`);let p=x.sort((a,h)=>{let f={high:1,warning:2,low:3};return f[a.level]-f[h.level]});for(let a of p){let h="",f="";a.level==="high"?(h="\u274C",f=t.red):a.level==="warning"?(h="\u26A0\uFE0F",f=t.yellow):(h="\u2139\uFE0F",f=t.cyan),console.log(` ${f}${h} ${a.level.toUpperCase()}:${t.reset} ${a.message}`),a.suggestion&&console.log(` ${t.gray}\u{1F4A1} Suggestion: ${a.suggestion}${t.reset}`)}console.log("")}console.log(`${t.bold}Summary:${t.reset}`),console.log(` ${t.red}${c} high-level errors${t.reset}`),console.log(` ${t.yellow}${u} warnings${t.reset}`),console.log(` ${t.cyan}${n} minor improvements${t.reset}
77
+ `),c>0&&j("HIGH ERROR: Fix these to ensure your documentation builds correctly."),(u>0||n>0)&&ct("TIP: Address warnings and suggestions for premium quality docs."),console.log("")}let C=performance.now()-e;ct(`Finished in ${C.toFixed(2)}ms
78
+ `),c>0&&process.exit(1)}catch(r){j("Failed to run doctor check:",r),process.exit(1)}}var N=(0,We.default)("boltdocs");N.command("[root]","Start development server").alias("dev").action(Ae);N.command("build [root]","Build for production").action(ze);N.command("preview [root]","Preview production build").action(Ne);N.command("doctor [root]","Check documentation health").action(Ge);N.help();N.version("2.0.0");N.parse();