boltdocs 2.7.10 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/README.md +2 -2
  2. package/dist/banner-3N4Jd_L9.d.ts +100 -0
  3. package/dist/banner-MynZD_Ox.d.cts +100 -0
  4. package/dist/cache-BMUyNiiA.mjs +6 -0
  5. package/dist/cache-CKm45d2w.cjs +6 -0
  6. package/dist/client/index.cjs +2268 -1
  7. package/dist/client/index.d.cts +86 -110
  8. package/dist/client/index.d.ts +87 -111
  9. package/dist/client/index.js +2214 -1
  10. package/dist/client/mdx.cjs +12 -1
  11. package/dist/client/mdx.d.cts +39 -93
  12. package/dist/client/mdx.d.ts +38 -93
  13. package/dist/client/mdx.js +7 -1
  14. package/dist/client/primitives.cjs +60 -1
  15. package/dist/client/primitives.d.cts +411 -347
  16. package/dist/client/primitives.d.ts +411 -347
  17. package/dist/client/primitives.js +20 -1
  18. package/dist/docs-layout-CwCq42Zt.cjs +1348 -0
  19. package/dist/docs-layout-Dn6S5g59.js +1167 -0
  20. package/dist/doctor-BArviV8X.cjs +28 -0
  21. package/dist/doctor-CgLA7_Uv.mjs +28 -0
  22. package/dist/{doctor-CrytFkqW.cjs → doctor-DyNUVe96.cjs} +1 -1
  23. package/dist/{routes-DP1vmWRj.cjs → doctor-aN_leTbh.mjs} +1 -1
  24. package/dist/{generator-ClVanhvi.mjs → generator-BHCrLU6h.mjs} +2 -2
  25. package/dist/{generator-CHqxiQhF.cjs → generator-CC2yHzhZ.cjs} +2 -2
  26. package/dist/icons-dev-DvJ-hh9x.cjs +1209 -0
  27. package/dist/icons-dev-Oju24Wjp.js +845 -0
  28. package/dist/image-Ch4-GxdO.cjs +268 -0
  29. package/dist/image-Do8V9PCW.js +214 -0
  30. package/dist/mdx-D3A2_l7P.js +520 -0
  31. package/dist/mdx-PLhhPJRS.cjs +531 -0
  32. package/dist/node/cli-entry.cjs +3 -1
  33. package/dist/node/cli-entry.mjs +3 -1
  34. package/dist/node/index.cjs +1 -1
  35. package/dist/node/index.d.cts +258 -152
  36. package/dist/node/index.d.mts +258 -150
  37. package/dist/node/index.mjs +1 -1
  38. package/dist/node/routes/worker.cjs +1 -1
  39. package/dist/node/routes/worker.mjs +1 -1
  40. package/dist/node-BmlP0eBP.cjs +159 -0
  41. package/dist/node-Y8_4ayje.mjs +159 -0
  42. package/dist/package-2nFy_NsW.cjs +6 -0
  43. package/dist/{package--0Yf0t1N.mjs → package-DAbtltXX.mjs} +1 -1
  44. package/dist/parser-B7-6PyQz.cjs +6 -0
  45. package/dist/{parser-Aq8LoH-0.cjs → parser-BzB-zCkF.cjs} +1 -1
  46. package/dist/parser-WGZdWs0X.mjs +6 -0
  47. package/dist/routes-BDDSxAl0.mjs +6 -0
  48. package/dist/routes-DJNJ-rTt.cjs +6 -0
  49. package/dist/routes-DiYC4nD2.cjs +6 -0
  50. package/dist/routes-_Bb2f4eI.mjs +6 -0
  51. package/dist/search-dialog-BXVoecTx.cjs +483 -0
  52. package/dist/search-dialog-BYhOov4S.cjs +331 -0
  53. package/dist/search-dialog-C09riYmx.js +313 -0
  54. package/dist/search-dialog-CUeAfy-8.cjs +8 -0
  55. package/dist/search-dialog-D8gLkhUV.js +453 -0
  56. package/dist/search-dialog-DHc_8FFX.js +8 -0
  57. package/dist/{sidebar-CcBkrm06.d.cts → sidebar-DNq4_ZAa.d.ts} +118 -52
  58. package/dist/{sidebar-CyZS9YOm.d.ts → sidebar-Dlkgbxs6.d.cts} +118 -52
  59. package/dist/utils-BYITg7T5.mjs +7 -0
  60. package/dist/utils-Cjmx1hhk.cjs +7 -0
  61. package/dist/worker-pool-CtqklOXq.cjs +6 -0
  62. package/dist/worker-pool-k0DY6k8T.mjs +6 -0
  63. package/package.json +5 -6
  64. package/src/shared/config-utils.ts +4 -0
  65. package/src/shared/types.ts +52 -6
  66. package/dist/cache-Ba-DZQNH.cjs +0 -6
  67. package/dist/cache-BuMZ58L5.mjs +0 -6
  68. package/dist/cards-BakZPTz9.d.ts +0 -30
  69. package/dist/cards-CQn9mXZS.d.cts +0 -30
  70. package/dist/docs-layout-KoWNZc8_.js +0 -6
  71. package/dist/docs-layout-x2yKt2cL.cjs +0 -6
  72. package/dist/doctor-Be7Ly1oM.mjs +0 -21
  73. package/dist/doctor-jMxWZyLJ.cjs +0 -21
  74. package/dist/icons-dev-B_RZIyxu.js +0 -6
  75. package/dist/icons-dev-BlV3wWFT.cjs +0 -6
  76. package/dist/image-BHhTvQzr.cjs +0 -6
  77. package/dist/image-CqKzYD8f.js +0 -6
  78. package/dist/mdx-DudBEac0.js +0 -7
  79. package/dist/mdx-r4cDQxWu.cjs +0 -7
  80. package/dist/node-DtEDyN1u.cjs +0 -111
  81. package/dist/node-_1jhMGYx.mjs +0 -111
  82. package/dist/package-DrwtlXfk.cjs +0 -6
  83. package/dist/parser-CdNbqN5y.cjs +0 -6
  84. package/dist/parser-nE792MLO.mjs +0 -6
  85. package/dist/rolldown-runtime-fkIsjY3S.mjs +0 -6
  86. package/dist/routes-2k3tbUmC.cjs +0 -6
  87. package/dist/routes-CpxZIsMM.mjs +0 -6
  88. package/dist/search-dialog-B584t9ZF.js +0 -6
  89. package/dist/search-dialog-BvBopRsZ.cjs +0 -6
  90. package/dist/search-dialog-ByvGScjt.js +0 -6
  91. package/dist/search-dialog-Cyko6TJm.cjs +0 -6
  92. package/dist/search-dialog-D6BNohIJ.js +0 -6
  93. package/dist/search-dialog-DuYTIefy.cjs +0 -6
  94. package/dist/utils-CG65J0Sc.mjs +0 -7
  95. package/dist/utils-CKunkU96.cjs +0 -7
  96. package/dist/worker-pool-CGn7DrLb.mjs +0 -6
  97. package/dist/worker-pool-Crbqgw5R.cjs +0 -6
  98. package/src/client/app/config-context.tsx +0 -51
  99. package/src/client/app/doc-page.tsx +0 -38
  100. package/src/client/app/docs-layout.tsx +0 -28
  101. package/src/client/app/head.tsx +0 -122
  102. package/src/client/app/helmet-compat.tsx +0 -36
  103. package/src/client/app/mdx-component.tsx +0 -8
  104. package/src/client/app/mdx-components-context.tsx +0 -72
  105. package/src/client/app/routes-context.tsx +0 -34
  106. package/src/client/app/scroll-handler.tsx +0 -74
  107. package/src/client/app/theme-context.tsx +0 -103
  108. package/src/client/app/ui-context.tsx +0 -42
  109. package/src/client/components/docs-layout-default.tsx +0 -85
  110. package/src/client/components/icons-dev.tsx +0 -282
  111. package/src/client/components/mdx/callout.tsx +0 -97
  112. package/src/client/components/mdx/card.tsx +0 -99
  113. package/src/client/components/mdx/cards.tsx +0 -27
  114. package/src/client/components/mdx/code-block.tsx +0 -184
  115. package/src/client/components/mdx/field.tsx +0 -33
  116. package/src/client/components/mdx/image.tsx +0 -44
  117. package/src/client/components/mdx/index.ts +0 -19
  118. package/src/client/components/mdx/table.tsx +0 -54
  119. package/src/client/components/mdx/typographics.tsx +0 -120
  120. package/src/client/components/mdx/use-code-block.ts +0 -34
  121. package/src/client/components/primitives/breadcrumbs.tsx +0 -54
  122. package/src/client/components/primitives/button-group.tsx +0 -54
  123. package/src/client/components/primitives/button.tsx +0 -6
  124. package/src/client/components/primitives/code-block.tsx +0 -120
  125. package/src/client/components/primitives/docs-layout.tsx +0 -125
  126. package/src/client/components/primitives/error-boundary.tsx +0 -107
  127. package/src/client/components/primitives/heading.tsx +0 -128
  128. package/src/client/components/primitives/helpers/observer.ts +0 -141
  129. package/src/client/components/primitives/image.tsx +0 -26
  130. package/src/client/components/primitives/link.tsx +0 -102
  131. package/src/client/components/primitives/menu.tsx +0 -137
  132. package/src/client/components/primitives/navbar.tsx +0 -466
  133. package/src/client/components/primitives/on-this-page.tsx +0 -430
  134. package/src/client/components/primitives/page-nav.tsx +0 -51
  135. package/src/client/components/primitives/popover.tsx +0 -28
  136. package/src/client/components/primitives/search-dialog.tsx +0 -193
  137. package/src/client/components/primitives/sidebar.tsx +0 -423
  138. package/src/client/components/primitives/skeleton.tsx +0 -26
  139. package/src/client/components/primitives/tabs.tsx +0 -70
  140. package/src/client/components/primitives/tooltip.tsx +0 -81
  141. package/src/client/components/primitives/types.ts +0 -11
  142. package/src/client/components/ui-base/banner.tsx +0 -66
  143. package/src/client/components/ui-base/breadcrumbs.tsx +0 -44
  144. package/src/client/components/ui-base/copy-markdown.tsx +0 -107
  145. package/src/client/components/ui-base/error-boundary.tsx +0 -15
  146. package/src/client/components/ui-base/github-stars.tsx +0 -29
  147. package/src/client/components/ui-base/icons.tsx +0 -240
  148. package/src/client/components/ui-base/index.ts +0 -16
  149. package/src/client/components/ui-base/last-updated.tsx +0 -27
  150. package/src/client/components/ui-base/navbar.tsx +0 -266
  151. package/src/client/components/ui-base/not-found.tsx +0 -26
  152. package/src/client/components/ui-base/on-this-page.tsx +0 -57
  153. package/src/client/components/ui-base/page-nav.tsx +0 -50
  154. package/src/client/components/ui-base/search-dialog.tsx +0 -163
  155. package/src/client/components/ui-base/search-highlight.tsx +0 -10
  156. package/src/client/components/ui-base/sidebar.tsx +0 -92
  157. package/src/client/components/ui-base/tabs.tsx +0 -83
  158. package/src/client/components/ui-base/theme-toggle.tsx +0 -130
  159. package/src/client/components/ui-base/version-i18n.tsx +0 -80
  160. package/src/client/hooks/index.ts +0 -13
  161. package/src/client/hooks/use-analytics.ts +0 -272
  162. package/src/client/hooks/use-breadcrumbs.ts +0 -22
  163. package/src/client/hooks/use-i18n.ts +0 -182
  164. package/src/client/hooks/use-localized-to.ts +0 -113
  165. package/src/client/hooks/use-location.ts +0 -5
  166. package/src/client/hooks/use-navbar.ts +0 -130
  167. package/src/client/hooks/use-page-nav.ts +0 -46
  168. package/src/client/hooks/use-routes.ts +0 -108
  169. package/src/client/hooks/use-search-highlight.ts +0 -185
  170. package/src/client/hooks/use-search.ts +0 -118
  171. package/src/client/hooks/use-sidebar.ts +0 -205
  172. package/src/client/hooks/use-tabs.ts +0 -46
  173. package/src/client/hooks/use-version.ts +0 -111
  174. package/src/client/index.ts +0 -31
  175. package/src/client/mdx.ts +0 -2
  176. package/src/client/primitives.ts +0 -19
  177. package/src/client/ssg/boltdocs-shell.tsx +0 -148
  178. package/src/client/ssg/create-routes.tsx +0 -473
  179. package/src/client/ssg/index.ts +0 -4
  180. package/src/client/ssg/mdx-page.tsx +0 -38
  181. package/src/client/store/boltdocs-context.tsx +0 -137
  182. package/src/client/theme/neutral.css +0 -141
  183. package/src/client/theme/reset.css +0 -189
  184. package/src/client/types.ts +0 -116
  185. package/src/client/utils/cn.ts +0 -6
  186. package/src/client/utils/copy-clipboard.ts +0 -22
  187. package/src/client/utils/get-base-file-path.ts +0 -21
  188. package/src/client/utils/github.ts +0 -121
  189. package/src/client/utils/i18n.ts +0 -23
  190. package/src/client/utils/path.ts +0 -9
  191. package/src/client/utils/react-to-text.ts +0 -34
  192. package/src/client/virtual.d.ts +0 -24
  193. /package/dist/{meta-loader-CWg2gnbY.mjs → meta-loader-DzwDFtdT.mjs} +0 -0
@@ -3,4 +3,2271 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../icons-dev-BlV3wWFT.cjs`),t=require(`../docs-layout-x2yKt2cL.cjs`),n=require(`../image-BHhTvQzr.cjs`),r=require(`../search-dialog-BvBopRsZ.cjs`),i=require(`../search-dialog-DuYTIefy.cjs`),a=require(`../mdx-r4cDQxWu.cjs`);let o=require(`react-router-dom`),s=require(`react`),c=require(`react/jsx-runtime`),l=require(`react-aria-components`),u=require(`virtual:boltdocs-icons`);u=e.rt(u);let d=require(`react-helmet-async`);d=e.rt(d);let f=require(`virtual:boltdocs-mdx-components`);f=e.rt(f);let p=require(`virtual:boltdocs-layout`);p=e.rt(p);let m=require(`@bdocs/ssg`);const h=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),g=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),_=globalThis[h]||(globalThis[h]=(0,s.createContext)({}));function v(){let e=(0,s.use)(_);return(!e||Object.keys(e).length===0)&&globalThis[g]?globalThis[g]:e}function y({components:e,children:t}){let n=(0,s.useMemo)(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[g]=n),(0,c.jsx)(_.Provider,{value:n,children:t})}function b(){let{currentRoute:t}=e.X(),n=[];return t&&(t.groupTitle&&n.push({label:t.groupTitle}),n.push({label:t.title,href:t.path})),{crumbs:n,activeRoute:t}}function x(){let{crumbs:n,activeRoute:r}=b();return n.length===0?null:(0,c.jsxs)(t.N.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[(0,c.jsx)(t.N.Item,{children:(0,c.jsx)(t.N.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:(0,c.jsx)(e.F,{size:14})})}),n.map((n,i)=>{let a=n.href===r?.path;return(0,c.jsxs)(t.N.Item,{className:`gap-2`,children:[(0,c.jsx)(t.N.Separator,{className:`text-muted/40`}),(0,c.jsx)(t.N.Link,{href:n.href,className:e.y(`transition-colors`,a?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:n.label})]},`crumb-${n.href}-${n.label}-${i}`)})]})}const S=e=>{let[t,n]=(0,s.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function C({content:n,mdxRaw:r}){let i=r||n||``,{copied:a,handleCopy:o,handleOpenRaw:s}=S(i);return i?(0,c.jsx)(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:(0,c.jsxs)(t.j,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[(0,c.jsx)(t.M,{onPress:o,className:e.y(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,a&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":a?`Copied!`:`Copy Markdown`,children:a?(0,c.jsx)(e.w,{size:14}):(0,c.jsx)(e.k,{size:14})}),(0,c.jsxs)(t.M,{onPress:o,className:e.y(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,a&&`text-emerald-500 hover:bg-emerald-500/5`),children:[a?(0,c.jsx)(e.w,{size:16}):(0,c.jsx)(e.k,{size:16}),a?`Copied!`:`Copy Markdown`]}),(0,c.jsxs)(t.k.Trigger,{placement:`bottom end`,children:[(0,c.jsx)(t.M,{className:e.y(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:(0,c.jsx)(e.T,{size:14})}),(0,c.jsxs)(t.k.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{onAction:o,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(e.k,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),(0,c.jsxs)(t.k.Item,{onAction:s,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(e.j,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function w({children:e,fallback:n}){return(0,c.jsx)(t.D,{fallback:n,children:e})}async function T(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:ee(i.stargazers_count)}const ee=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function te({repo:t}){let[n,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{t&&T(t).then(e=>r(e)).catch(()=>r(`0`))},[t]),(0,c.jsxs)(`a`,{href:`https://github.com/${t}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[(0,c.jsx)(e.s,{className:`h-4 w-4 text-body`}),n!==null&&(0,c.jsxs)(`span`,{className:`tabular-nums font-medium`,children:[n,` stars`]})]})}function E(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function D(){let t=e.nt(),{theme:r,resolvedTheme:i}=n.l(),a=(0,o.useLocation)(),{currentLocale:c}=e.X(),l=t.theme||{},u=E(l.title,c)||`Boltdocs`,d=l.navbar||[],f=l.socialLinks||[],p=l.githubRepo,m=(0,s.useMemo)(()=>d.map(e=>{let n=e.href||e.to||e.link||``,r=e=>{let n=a.pathname;if(n===e)return!0;if(!e||e===`/`)return n===`/`;let r=e=>{let n=e.split(`/`).filter(Boolean),r=0;return t.i18n?.locales&&n[r]&&t.i18n.locales[n[r]]&&r++,t.versions?.versions&&n[r]&&t.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},i=r(e),o=r(n);return i.length===0?o.length===0:o.length<i.length?!1:i.every((e,t)=>o[t]===e)},i=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:E(e.label||e.text,c),href:t,active:r(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(e.items);return{label:E(e.label||e.text,c),href:n,active:r(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:i}}),[d,a.pathname,c,t]),h=l.logo;return{links:m,title:u,logo:h?typeof h==`string`?h:i===`dark`?h.dark:h.light:null,logoProps:{alt:(h&&typeof h==`object`?h.alt:void 0)||u,width:h&&typeof h==`object`?h.width:void 0,height:h&&typeof h==`object`?h.height:void 0},github:p?`https://github.com/${p}`:null,social:f,config:t,theme:r}}function O(){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:`h-9 w-9`});let u=r===`system`?e.V:r===`dark`?e.H:e.K;return(0,c.jsxs)(t.k.Trigger,{placement:`bottom right`,children:[(0,c.jsx)(l.Button,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:(0,c.jsx)(u,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),(0,c.jsxs)(t.k.Root,{selectionMode:`single`,selectedKeys:[r],onSelectionChange:e=>{let t=Array.from(e)[0];i(t)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.K,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Light`})]}),(0,c.jsxs)(t.k.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.H,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Dark`})]}),(0,c.jsxs)(t.k.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.V,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`System`})]})]})]})}function ne({className:t}){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:e.y(`h-10 w-full bg-surface rounded-xl animate-pulse`,t)});let l=r===`dark`;return(0,c.jsxs)(`div`,{className:e.y(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,t),children:[(0,c.jsx)(`div`,{className:e.y(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,l?`translate-x-full`:`translate-x-0`)}),(0,c.jsx)(`button`,{onClick:()=>i(`light`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,l?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:(0,c.jsx)(e.K,{size:18})}),(0,c.jsx)(`button`,{onClick:()=>i(`dark`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,l?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:(0,c.jsx)(e.H,{size:18})})]})}function k(t=[],n=[]){let r=(0,o.useLocation)(),i=(0,s.useRef)([]),[a,c]=(0,s.useState)({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),l=e.Z(r.pathname),u=n.find(t=>e.Z(t.path)===l)?.tab?.toLowerCase(),d=t.findIndex(e=>e.id.toLowerCase()===u),f=d===-1?0:d;return(0,s.useEffect)(()=>{let e=i.current[f];e&&c({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[f,t.length,r.pathname]),{tabs:t,activeIndex:f,indicatorStyle:a,tabRefs:i,activeTabId:u}}function re({tabs:n,routes:r}){let{currentLocale:i}=e.X(),{indicatorStyle:a,tabRefs:o,activeIndex:l}=k(n,r);(0,s.useEffect)(()=>{let e=o.current[l];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[l]);let d=t=>{if(!t)return null;if(t.trim().startsWith(`<svg`))return(0,c.jsx)(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:t}});let n={...e.Y,...u.default},r=n[t]||n[t+`Icon`];return r?(0,c.jsx)(r,{size:16}):(0,c.jsx)(`img`,{src:t,alt:``,className:`h-4 w-4 object-contain`})};return(0,c.jsx)(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:(0,c.jsxs)(t.E.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[n.map((t,n)=>{let a=n===l,s=r.find(e=>e.tab&&e.tab.toLowerCase()===t.id.toLowerCase());return(0,c.jsxs)(e._,{href:s?s.path:`#`,ref:e=>{o.current[n]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${a?`text-primary-500`:`text-muted hover:text-body`}`,children:[d(t.icon),(0,c.jsx)(`span`,{children:E(t.text,i)})]},t.id)}),(0,c.jsx)(t.E.Indicator,{style:a,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function A(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function j(){let t=(0,o.useNavigate)(),n=e.nt(),{allRoutes:r,currentRoute:i,currentVersion:a,currentLocale:c}=e.X(),l=n.versions,{setVersion:u}=e.$();return{currentVersion:a,currentVersionLabel:l?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:(0,s.useMemo)(()=>l?l.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[l,a]),handleVersionChange:e=>{if(!l||e===a)return;u(e);let o=`${(n.base||`/docs`).replace(/\/$/,``)}/${e}${c?`/${c}`:``}`;if(i){let t=A(i.filePath,i.version,i.locale),a=r.find(r=>A(r.filePath,r.version,r.locale)===t&&(r.version||l.defaultVersion)===e&&(!n.i18n||(r.locale||n.i18n.defaultLocale)===c));if(a)o=a.path;else{let t=r.find(t=>A(t.filePath,t.version,t.locale)===`index.md`&&(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}}else{let t=r.find(t=>(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}t(o)}}}function M(){let t=(0,o.useNavigate)(),n=e.nt(),{allRoutes:r,currentRoute:i,currentLocale:a,currentVersion:c}=e.X(),l=n.i18n,{setLocale:u}=e.$(),d=e=>{if(!l||e===a)return;u(e);let o=n.base||`/`,s=o===`/`?``:o.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let t=A(i.filePath,i.version,i.locale),n=r.find(n=>A(n.filePath,n.version,n.locale)===t&&(n.locale||l.defaultLocale)===e&&n.version===i.version);if(n)f=n.path;else{let t=r.find(t=>A(t.filePath,t.version,t.locale)===`index.md`&&(t.locale||l.defaultLocale)===e&&t.version===i.version);f=t?t.path:`${s}${i.version?`/${i.version}`:``}${e===l.defaultLocale?``:`/${e}`}`||`/`}}else{let t=i.path,n=t.split(`/`).filter(Boolean);if(n.length>0&&(Array.isArray(l.locales)?l.locales.includes(n[0]):l.locales[n[0]])&&(n.shift(),t=`/`+n.join(`/`)),e===l.defaultLocale)f=t===``?`/`:t;else{let n=t.startsWith(`/`)?t:`/${t}`;f=`/${e}${n===`/`?``:n}`}}else{let t=r.find(t=>(t.locale||l.defaultLocale)===e&&(t.version||n.versions?.defaultVersion)===(c||n.versions?.defaultVersion));if(t)f=t.path;else{let t=c&&c!==n.versions?.defaultVersion?`/${c}`:``;f=e===l.defaultLocale?`${s}${t}`:`${s}${t}/${e}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),t(f)},f=l?.locales,p=f?Array.isArray(f)?a:f[a]:void 0;return{currentLocale:a,currentLocaleLabel:l?.localeConfigs?.[a]?.label||p||a,availableLocales:(0,s.useMemo)(()=>l?Array.isArray(l.locales)?l.locales.map(e=>({key:e,label:l?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(l.locales).map(([e,t])=>({key:e,label:l?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[l,a]),handleLocaleChange:d}}function N({className:n}){let{currentVersionLabel:r,availableVersions:i,handleVersionChange:a}=j();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsx)(`span`,{className:`font-semibold text-[0.8125rem]`,children:r}),(0,c.jsx)(e.T,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function P({className:n}){let{currentLocale:r,availableLocales:i,handleLocaleChange:a}=M();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,c.jsx)(e.L,{className:`w-3.5 h-3.5 text-primary-500`}),(0,c.jsx)(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:r||`en`})]}),(0,c.jsx)(e.T,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:(0,c.jsx)(`span`,{children:e.label})},`${e.value??``}`)})})]})}const F=(0,s.lazy)(()=>Promise.resolve().then(()=>require(`../search-dialog-Cyko6TJm.cjs`)).then(e=>({default:e.SearchDialog})));function I(){let{links:n,title:i,logo:a,logoProps:l,github:u,social:d,config:f}=D(),{routes:p,allRoutes:m,currentRoute:h,currentVersion:g,currentLocale:_}=e.X(),{pathname:v}=(0,o.useLocation)(),{isSidebarOpen:y,toggleSidebar:b}=t.T(),[x,S]=(0,s.useState)(!1),C=f.theme||{},w=!!h?.filePath,T=C?.tabs&&C.tabs.length>0;return(0,c.jsxs)(r.n.Root,{className:e.y(`border-b border-subtle bg-main/80 backdrop-blur-md`,T&&`border-b-0`),children:[(0,c.jsxs)(r.n.Content,{children:[(0,c.jsxs)(r.n.Left,{children:[w&&(0,c.jsx)(t.M,{onPress:b,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":y?`Close sidebar`:`Open sidebar`,children:y?(0,c.jsx)(e.J,{className:`w-5 h-5 text-body`}):(0,c.jsx)(e.B,{className:`w-5 h-5 text-body`})}),a&&(0,c.jsx)(r.n.Logo,{src:a,alt:l?.alt||i,width:l?.width??24,height:l?.height??24,href:`site:/`}),(0,c.jsx)(r.n.Title,{href:`site:/`,children:i}),(0,c.jsx)(`div`,{className:`hidden sm:block`,children:f.versions&&g&&(0,c.jsx)(N,{})})]}),(0,c.jsx)(r.n.Center,{children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:(0,c.jsx)(F,{routes:p||[]})})}),(0,c.jsxs)(r.n.Right,{children:[(0,c.jsx)(s.Suspense,{fallback:null,children:(0,c.jsx)(`div`,{className:`lg:hidden`,children:(0,c.jsx)(F,{routes:p||[]})})}),(0,c.jsx)(r.n.Links,{children:n.map(e=>(0,c.jsx)(ie,{link:e},e.href))}),(0,c.jsxs)(`div`,{className:`hidden sm:flex items-center gap-2`,children:[f.i18n&&_&&(0,c.jsx)(P,{}),(0,c.jsx)(r.n.Split,{className:`bg-subtle`})]}),(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(O,{})}),u&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(te,{repo:C?.githubRepo??``})}),d.length>0&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(r.n.Split,{className:`bg-subtle`})}),(0,c.jsx)(`div`,{className:`hidden md:flex items-center gap-1`,children:d.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),(0,c.jsx)(r.n.More,{onPress:()=>S(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),(0,c.jsxs)(r.n.MobileMenu,{isOpen:x,onClose:()=>S(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[(0,c.jsx)(`div`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,c.jsx)(L,{link:e,onClose:()=>S(!1)},e.href))}),d.length>0&&(0,c.jsxs)(`div`,{className:`mt-6`,children:[(0,c.jsx)(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),(0,c.jsx)(`div`,{className:`flex flex-wrap gap-2 px-2`,children:d.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),w&&T&&C?.tabs&&(0,c.jsx)(`div`,{className:`w-full border-b border-subtle bg-main`,children:(0,c.jsx)(re,{tabs:C.tabs,routes:m||p||[]})})]})}function ie({link:t}){let n=e.b(t.href||``),{pathname:i}=(0,o.useLocation)(),a=i===n||i.startsWith(n+`/`);return t.items&&t.items.length>0?(0,c.jsx)(r.n.Dropdown,{label:(0,c.jsx)(`span`,{className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,a?`text-primary-500`:`text-muted hover:text-body`),children:t.label}),children:t.items?.map(t=>(0,c.jsx)(r.n.DropdownItem,{href:e.b(t.href||``),label:t.label},t.href))}):(0,c.jsx)(r.n.Link,{...t,href:n,active:a,className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,a?`text-primary-500`:`text-muted hover:text-body`)})}function L({link:t,onClose:n}){let i=e.b(t.href||``),{pathname:a}=(0,o.useLocation)(),s=a===i;return t.items&&t.items.length>0?(0,c.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,c.jsx)(`div`,{className:e.y(`px-3 py-2 text-sm transition-all`,s?`text-body`:`text-muted/80 hover:text-body`),children:t.label}),(0,c.jsx)(`div`,{className:`flex flex-col gap-1 pl-4`,children:t.items?.map(e=>(0,c.jsx)(L,{link:e,onClose:n},e.href))})]}):(0,c.jsx)(r.n.MobileLink,{...t,href:i,active:s,onPress:n,className:e.y(`transition-all`,s?`text-body`:`text-muted/80 hover:text-body`)})}function R(){return(0,c.jsx)(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:(0,c.jsxs)(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[(0,c.jsx)(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),(0,c.jsxs)(`div`,{className:`space-y-2`,children:[(0,c.jsx)(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),(0,c.jsx)(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),(0,c.jsxs)(e._,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[(0,c.jsx)(e.C,{size:14}),` Go to Home`]})]})})}function z({headings:n=[],editLink:r,communityHelp:i,filePath:a}){return n.length===0?null:(0,c.jsxs)(t._.Root,{children:[(0,c.jsxs)(t._.Header,{className:`flex flex-row gap-x-2`,children:[(0,c.jsx)(e.q,{size:16}),`On this page`]}),(0,c.jsx)(t._.Tree,{headings:n}),(r||i)&&(0,c.jsxs)(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[(0,c.jsx)(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),(0,c.jsxs)(`ul`,{className:`space-y-3`,children:[r&&a&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:r.replace(`:path`,a),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(e.W,{size:16}),`Edit this page`]})}),i&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(e.O,{size:16}),`Community help`]})})]})]})]})}function B(){let{routes:t,currentRoute:n}=e.X(),r=(0,o.useLocation)();return(0,s.useMemo)(()=>{if(!n)return{prevPage:null,nextPage:null,currentRoute:null};let e=n.tab?.toLowerCase(),i=e?t.filter(t=>t.tab?.toLowerCase()===e):t.filter(e=>!e.tab),a=i.findIndex(e=>e.path===r.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:n}},[t,n,r.pathname])}function V(){let{prevPage:e,nextPage:n}=B();return!e&&!n?null:(0,c.jsxs)(t.h.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?(0,c.jsxs)(t.h.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):(0,c.jsx)(`div`,{}),n?(0,c.jsxs)(t.h.Link,{to:n.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:n.title})]}):(0,c.jsx)(`div`,{})]})}function H({routes:n,config:r}){let{logo:i,title:a,logoProps:o}=D(),{closeSidebar:s}=t.T(),l=i?(0,c.jsx)(`img`,{src:i,alt:o?.alt||a,width:24,height:24,className:`rounded-xl`}):null,u=r.versions||r.i18n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t.i.Root,{children:(0,c.jsx)(t.i.Content,{children:(0,c.jsx)(t.i.Items,{routes:n})})}),(0,c.jsxs)(t.i.Mobile,{children:[(0,c.jsxs)(t.i.Header,{children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-3`,children:[l,(0,c.jsx)(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:a})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,c.jsx)(ne,{className:`w-24 h-9 rounded-xl`}),(0,c.jsx)(t.M,{onPress:s,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:(0,c.jsx)(e.J,{size:20})})]})]}),(0,c.jsxs)(t.i.Content,{children:[u&&(0,c.jsxs)(`div`,{className:`flex flex-col gap-4 mb-10`,children:[(0,c.jsxs)(`div`,{className:`flex gap-3`,children:[r.versions&&(0,c.jsx)(N,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),r.i18n&&(0,c.jsx)(P,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),(0,c.jsx)(`div`,{className:`mt-2 border-b border-subtle`})]}),(0,c.jsx)(t.i.Items,{routes:n})]})]})]})}const U=Object.assign(H,{Root:t.i.Root,Mobile:t.i.Mobile,Header:t.i.Header,Content:t.i.Content,Group:t.i.Group,Link:t.i.Link,SubGroup:t.i.SubGroup,Item:t.i.Item,Items:t.i.Items});function W({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return(0,c.jsxs)(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[(0,c.jsx)(`span`,{}),(0,c.jsxs)(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function G({route:e,content:t,mdxComponents:n}){let r=v(),i=(0,s.useMemo)(()=>({LastUpdated:W,...r,...n}),[r,n]),a=i.LastUpdated||W;return t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t,{components:i}),e?.lastUpdated&&(0,c.jsx)(a,{date:e.lastUpdated})]}):null}function K({MDXComponent:e,mdxComponents:t}){let n=(0,o.useLoaderData)(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?(0,c.jsx)(G,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const q=d,J=q.Helmet||q.default?.Helmet||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),Y=q.HelmetProvider||q.default?.HelmetProvider||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e}));function ae(){let{pathname:e,hash:t}=(0,o.useLocation)(),n=(e=`auto`)=>{let n=document.querySelector(`.boltdocs-content`)||window,r=()=>n===window?window.scrollY:n.scrollTop,i=(e,t)=>{n===window?window.scrollTo({top:e,behavior:t}):n.scrollTo({top:e,behavior:t})};if(t){let a=t.replace(`#`,``),o=document.getElementById(a);if(o){let t=n===window?0:n.getBoundingClientRect().top;return i(o.getBoundingClientRect().top-t-80+r(),e),!0}}return i(0,e),!1};return(0,s.useLayoutEffect)(()=>{n(`auto`)},[e,t]),(0,s.useEffect)(()=>{n(`auto`);let e=requestAnimationFrame(()=>{n(`auto`),window.dispatchEvent(new Event(`resize`))});return()=>cancelAnimationFrame(e)},[e,t]),null}const oe={...a.t,NotFound:R,404:R};function X(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function se({config:t}){let{currentLocale:n}=e.$();return(0,s.useEffect)(()=>{if(!t.i18n||typeof document>`u`)return;let e=n||t.i18n.defaultLocale,r=t.i18n.localeConfigs?.[e];document.documentElement.lang=r?.htmlLang||e||`en`,document.documentElement.dir=r?.direction||`ltr`},[n,t.i18n]),null}function ce({config:t,routeMap:n}){let r=(0,o.useLocation)(),{setLocale:i,setVersion:a}=e.$();return(0,s.useEffect)(()=>{let e=X(r.pathname),o=n.get(e);o&&(t.i18n&&i(o.locale||t.i18n.defaultLocale),t.versions&&a(o.version||t.versions.defaultVersion))},[r.pathname,t,n,i,a]),null}function Z({config:r,routes:i,components:a={}}){let l=(0,s.useMemo)(()=>({...oe,...f.default,...a}),[a]),{pathname:u}=(0,o.useLocation)(),d=(0,s.useMemo)(()=>X(u||`/`),[u]),p=(0,s.useMemo)(()=>{let e=new Map;for(let t of i){let n=X(t.path===``?`/`:t.path);e.set(n,t)}return e},[i]),m=(0,s.useMemo)(()=>{let e=p.get(d),t,n;return e&&(r.i18n&&(t=e.locale||r.i18n.defaultLocale),r.versions&&(n=e.version||r.versions.defaultVersion)),{initLocale:t,initVersion:n}},[d,r,p]);return(0,c.jsx)(Y,{children:(0,c.jsx)(e.et,{routes:i,children:(0,c.jsx)(n.c,{children:(0,c.jsx)(t.w,{children:(0,c.jsx)(y,{components:l,children:(0,c.jsxs)(e.tt.Provider,{value:r,children:[(0,c.jsx)(ae,{}),(0,c.jsxs)(e.Q,{initialLocale:m.initLocale,initialVersion:m.initVersion,children:[(0,c.jsx)(ce,{config:r,routeMap:p}),(0,c.jsx)(se,{config:r}),(0,c.jsx)(o.Outlet,{})]})]})})})})})})}function le({siteTitle:t,siteDescription:n,routes:r}){let i=(0,o.useLocation)(),a=e.nt(),{currentLocale:l}=e.X(),u=(0,s.useMemo)(()=>r?.find?.(e=>e.path===i.pathname),[r,i.pathname]),d=u?.title,f=E(n,l),p=u?.description||f||``,m=E(t,l),h=d?`${d} | ${m}`:m,g=u?.seo||{},_=a?.seo?.metatags||{},v=a?.seo?.thumbnails?.background,y=g[`og:image`]||v;return(0,c.jsxs)(J,{children:[(0,c.jsx)(`title`,{children:h}),(0,c.jsx)(`meta`,{name:`description`,content:p}),(0,c.jsx)(`meta`,{property:`og:title`,content:h}),(0,c.jsx)(`meta`,{property:`og:description`,content:p}),(0,c.jsx)(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&(0,c.jsx)(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&(0,c.jsx)(`link`,{rel:`canonical`,href:window.location.origin+i.pathname}),(0,c.jsx)(`meta`,{name:`twitter:card`,content:`summary`}),(0,c.jsx)(`meta`,{name:`twitter:title`,content:h}),(0,c.jsx)(`meta`,{name:`twitter:description`,content:p}),y&&(0,c.jsx)(`meta`,{name:`twitter:image`,content:y}),y&&(0,c.jsx)(`meta`,{property:`og:image`,content:y}),(0,c.jsx)(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(_).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e)),Object.entries(g).map(([e,t])=>e===`noindex`&&t===!0?(0,c.jsx)(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?(0,c.jsx)(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?(0,c.jsx)(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e))]})}function ue(){let t=e.nt(),{currentRoute:n,allRoutes:r}=e.X();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(le,{siteTitle:t.theme?.title,siteDescription:t.theme?.description,routes:r||[]}),(0,c.jsx)(p.default,{route:n,children:(0,c.jsx)(o.Outlet,{})})]})}const de=()=>(0,c.jsx)(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),fe=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return(0,s.useEffect)(()=>{if(!{}.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return{}.hot.on(`boltdocs:mdx-update`,e),()=>({}).hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?(0,c.jsx)(K,{MDXComponent:i,mdxComponents:r}):(0,c.jsx)(de,{})},pe=()=>{let e=v();return(0,c.jsx)(e.NotFound||e[404]||R,{})};function me(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:o}=e,s=a||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),l=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},u=[],d=n.versions?.defaultVersion,f=(n.base||`/docs`).replace(/\/$/,``),p=(n.base||`/docs`).replace(/\/$/,``);p||=`/`,d&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(f)?t.substring(f.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===d||n.startsWith(`${d}/`))){let t=`${f}/${d}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;u.push({...e,path:t,version:d})}});let m=[...t,...u],h=new Map,g=Object.keys(r);if(g.length>0){let e=g[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of g){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?h.set(i,e):h.set(r,e)}}let _=m.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=h.get(t),i=n?r[n]:null,a=l(e.path===``?`/`:e.path),s=a===p?`.`:a.startsWith(p+`/`)?a.slice(p.length+1):a;return{path:s,element:(0,c.jsx)(fe,{moduleKey:n,moduleLoader:i,route:e,components:o},n||s),loader:async()=>({path:s,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[s]}}),v=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],y=n.versions?.versions?.map(e=>e.path)||[],b=[];b.push({path:p,filter:()=>!0});let x=[];y.length>0&&y.forEach(e=>x.push(`/${e}`)),v.length>0&&v.forEach(e=>x.push(`/${e}`)),y.length>0&&v.length>0&&y.forEach(e=>{v.forEach(t=>{x.push(`/${e}/${t}`)})}),x.forEach(e=>{let t=p===`/`?e:`${p}${e}`;b.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let S=new Set(_.map(e=>(e.path||``).replace(/\/$/,``))),C=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;C.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{C.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),b.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(S.has(r)||C.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,o=a&&S.has(a.replace(/\/$/,``))?_.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):_.find(e=>t(e.path)&&e.path!==r);if(!o&&_.length>0&&(o=_[0]),o){let t=e===p?`.`:e.startsWith(p+`/`)?e.slice(p.length+1):e,r=t===`.`;_.push({...r?{index:!0}:{path:t},element:o.element,loader:o.loader,getStaticPaths:()=>[]});let i=m.find(e=>{let t=l(e.path===``?`/`:e.path);return(t===p?`.`:t.startsWith(p+`/`)?t.slice(p.length+1):t)===o.path});if(i){let t=l(i.path),r=n.siteUrl?`${n.siteUrl.replace(/\/$/,``)}${t}`:t;m.push({...i,path:e,filePath:``,slugParts:[],seo:{...i.seo,canonical:r}})}}}});let w=[{path:p,element:(0,c.jsx)(ue,{}),children:_}],T=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;w.find(e=>e.path===r)||(T.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),w.push({path:r,element:(0,c.jsx)(s,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;w.find(e=>e.path===r)||(T.push({path:r,locale:n,title:e,filePath:``,headings:[]}),w.push({path:r,element:(0,c.jsx)(s,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),w.push({path:`*`,element:(0,c.jsx)(s,{children:(0,c.jsx)(pe,{})})}),[{element:(0,c.jsx)(Z,{config:n,routes:[...m,...T],components:o}),children:w}]}function Q(e){return typeof window>`u`?$():typeof window.gtag==`function`?he(e):window.dataLayer?ge(e):$()}function he(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function ge(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function $(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const _e=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function ve(e={}){let{config:n,autoTrackPageViews:r=!0,autoTrackDownloads:i=!0,autoTrackExternalLinks:a=!0,excludePatterns:o=[]}=e,c=typeof globalThis<`u`?globalThis[_e]:void 0,l=n??c?.integrations,u=(0,s.useMemo)(()=>Q(l),[l]),d=(0,s.useRef)(``),f=t.r();return(0,s.useEffect)(()=>{if(!r||!u.isEnabled)return;let e=f.pathname+f.search;e!==d.current&&(d.current=e,u.trackPageView(e,document.title))},[f.pathname,r,u]),(0,s.useEffect)(()=>{if(!i||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!o.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;u.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,a,u,o]),(0,s.useEffect)(()=>{if(!a||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(o.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&u.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[a,u,o]),u}function ye(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)((t,n)=>{e.trackPageView(t,n)},[e])}function be(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)(t=>{e.trackEvent(t)},[e])}function xe({children:n}){let{routes:r,currentRoute:i}=e.X(),a=e.nt();return(0,c.jsxs)(t.t,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[(0,c.jsx)(I,{}),(0,c.jsxs)(t.t.Body,{className:`bg-main`,children:[(0,c.jsx)(U,{routes:r||[],config:a}),(0,c.jsx)(t.t.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:(0,c.jsxs)(t.t.ContentMdx,{className:`max-w-3xl sm:max-w-4xl lg:max-w-4xl px-2 pt-8 pb-24`,children:[(0,c.jsxs)(t.t.Header,{children:[(0,c.jsxs)(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,c.jsx)(x,{}),(0,c.jsx)(C,{mdxRaw:i?._rawContent,route:i})]}),i?.title&&(0,c.jsx)(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:i.title}),i?.description&&(0,c.jsx)(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:i.description})]}),(0,c.jsx)(w,{children:(0,c.jsx)(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:n})}),(0,c.jsx)(t.t.Footer,{children:(0,c.jsx)(V,{})})]})}),(0,c.jsx)(z,{headings:i?.headings,editLink:a.theme?.editLink,communityHelp:a.theme?.communityHelp,filePath:i?.filePath})]})]})}const Se=Object.assign(xe,{Body:t.t.Body,Content:t.t.Content,ContentMdx:t.t.ContentMdx,Header:t.t.Header,Footer:t.t.Footer});exports.BoltdocsShell=Z,exports.Breadcrumbs=x,exports.Card=a.r,exports.Cards=a.n,exports.CopyMarkdown=C,exports.DocsLayout=Se,exports.ErrorBoundary=w,exports.MdxPage=K,exports.Navbar=I,exports.NotFound=R,exports.OnThisPage=z,exports.PageNav=V,exports.SearchDialog=i.t,exports.Sidebar=U,Object.defineProperty(exports,`ViteReactSSG`,{enumerable:!0,get:function(){return m.ViteReactSSG}}),exports.cn=e.y,exports.copyToClipboard=a.i,exports.createRoutes=me,exports.getStarsRepo=T,exports.getTranslated=E,exports.reactToText=a.a,exports.useAnalytics=ve,exports.useBreadcrumbs=b,exports.useConfig=e.nt,exports.useI18n=M,exports.useLocalizedTo=e.b,exports.useLocation=t.r,exports.useMdxComponents=v,exports.useNavbar=D,exports.usePageNav=B,exports.useRoutes=e.X,exports.useSearch=i.n,exports.useSearchHighlight=t.n,exports.useSidebar=t.m,exports.useTabs=k,exports.useTheme=n.l,exports.useTrackEvent=be,exports.useTrackPageView=ye,exports.useUI=t.T,exports.useVersion=j;
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7
+ const require_icons_dev = require('../icons-dev-DvJ-hh9x.cjs');
8
+ const require_image = require('../image-Ch4-GxdO.cjs');
9
+ const require_mdx = require('../mdx-PLhhPJRS.cjs');
10
+ const require_docs_layout = require('../docs-layout-CwCq42Zt.cjs');
11
+ const require_search_dialog = require('../search-dialog-BXVoecTx.cjs');
12
+ const require_search_dialog$1 = require('../search-dialog-BYhOov4S.cjs');
13
+ let react = require("react");
14
+ let react_router_dom = require("react-router-dom");
15
+ let react_jsx_runtime = require("react/jsx-runtime");
16
+ let react_helmet_async = require("react-helmet-async");
17
+ react_helmet_async = require_icons_dev.__toESM(react_helmet_async);
18
+ let react_aria_components = require("react-aria-components");
19
+ let virtual_boltdocs_mdx_components = require("virtual:boltdocs-mdx-components");
20
+ virtual_boltdocs_mdx_components = require_icons_dev.__toESM(virtual_boltdocs_mdx_components);
21
+ let virtual_boltdocs_icons = require("virtual:boltdocs-icons");
22
+ virtual_boltdocs_icons = require_icons_dev.__toESM(virtual_boltdocs_icons);
23
+ let virtual_boltdocs_layout = require("virtual:boltdocs-layout");
24
+ virtual_boltdocs_layout = require_icons_dev.__toESM(virtual_boltdocs_layout);
25
+ let _bdocs_ssg = require("@bdocs/ssg");
26
+
27
+ //#region src/client/app/mdx-components-context.tsx
28
+ const MDX_COMPONENTS_CONTEXT_SYMBOL = Symbol.for("__BDOCS_MDX_COMPONENTS_CONTEXT__");
29
+ const registry = globalThis;
30
+ if (!registry[MDX_COMPONENTS_CONTEXT_SYMBOL]) registry[MDX_COMPONENTS_CONTEXT_SYMBOL] = (0, react.createContext)({});
31
+ const MdxComponentsContext = registry[MDX_COMPONENTS_CONTEXT_SYMBOL];
32
+ function useMdxComponents() {
33
+ return (0, react.use)(MdxComponentsContext);
34
+ }
35
+ function MdxComponentsProvider({ components, children }) {
36
+ const processedComponents = (0, react.useMemo)(() => {
37
+ const processed = {};
38
+ const frontmatter = {};
39
+ let hasFrontmatter = false;
40
+ Object.entries(components).forEach(([key, value]) => {
41
+ if (key.startsWith("Frontmatter_")) {
42
+ const cleanKey = key.slice(12);
43
+ frontmatter[cleanKey] = value;
44
+ hasFrontmatter = true;
45
+ } else processed[key] = value;
46
+ });
47
+ if (hasFrontmatter) processed.Frontmatter = frontmatter;
48
+ return processed;
49
+ }, [components]);
50
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MdxComponentsContext.Provider, {
51
+ value: processedComponents,
52
+ children
53
+ });
54
+ }
55
+
56
+ //#endregion
57
+ //#region src/client/app/helmet-compat.tsx
58
+ const mod = react_helmet_async;
59
+ /**
60
+ * The `<Helmet>` component, resolved across CJS/ESM module shapes.
61
+ * Falls back to a transparent fragment wrapper if the module cannot be resolved.
62
+ */
63
+ const Helmet = mod.Helmet || mod.default?.Helmet || (({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children }));
64
+ /**
65
+ * The `<HelmetProvider>` component, resolved across CJS/ESM module shapes.
66
+ * Falls back to a transparent fragment wrapper if the module cannot be resolved.
67
+ */
68
+ const HelmetProvider = mod.HelmetProvider || mod.default?.HelmetProvider || (({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children }));
69
+
70
+ //#endregion
71
+ //#region src/client/app/scroll-handler.tsx
72
+ /**
73
+ * Handles scroll restoration and hash scrolling on navigation.
74
+ * It ensures the page scrolls to top on pathname changes,
75
+ * or specifically to an anchor element if a hash is present.
76
+ */
77
+ function ScrollHandler() {
78
+ const { pathname, hash } = (0, react_router_dom.useLocation)();
79
+ const handleScroll = (behavior = "auto") => {
80
+ const container = document.querySelector(".boltdocs-content") || window;
81
+ const getScrollTop = () => {
82
+ if (container === window) return window.scrollY;
83
+ return container.scrollTop;
84
+ };
85
+ const scrollTo = (top, scrollBehavior) => {
86
+ if (container === window) window.scrollTo({
87
+ top,
88
+ behavior: scrollBehavior
89
+ });
90
+ else container.scrollTo({
91
+ top,
92
+ behavior: scrollBehavior
93
+ });
94
+ };
95
+ if (hash) {
96
+ const id = hash.replace("#", "");
97
+ const element = document.getElementById(id);
98
+ if (element) {
99
+ const offset = 80;
100
+ const containerTop = container === window ? 0 : container.getBoundingClientRect().top;
101
+ scrollTo(element.getBoundingClientRect().top - containerTop - offset + getScrollTop(), behavior);
102
+ return true;
103
+ }
104
+ }
105
+ scrollTo(0, behavior);
106
+ return false;
107
+ };
108
+ (0, react.useLayoutEffect)(() => {
109
+ handleScroll("auto");
110
+ }, [pathname, hash]);
111
+ (0, react.useEffect)(() => {
112
+ handleScroll("auto");
113
+ const rafId = requestAnimationFrame(() => {
114
+ handleScroll("auto");
115
+ window.dispatchEvent(new Event("resize"));
116
+ });
117
+ return () => cancelAnimationFrame(rafId);
118
+ }, [pathname, hash]);
119
+ return null;
120
+ }
121
+
122
+ //#endregion
123
+ //#region src/client/components/ui-base/not-found.tsx
124
+ function NotFound() {
125
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
126
+ className: "flex items-center justify-center min-h-[65vh] text-center px-4",
127
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
128
+ className: "space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs",
129
+ children: [
130
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
131
+ className: "block text-7xl font-extrabold tracking-tight text-primary-500",
132
+ children: "404"
133
+ }),
134
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
135
+ className: "space-y-2",
136
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
137
+ className: "text-xl font-bold text-body",
138
+ children: "Page Not Found"
139
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
140
+ className: "text-sm text-muted leading-relaxed",
141
+ children: "The page you're looking for doesn't exist or has been moved."
142
+ })]
143
+ }),
144
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_icons_dev.Link, {
145
+ href: "/",
146
+ className: "inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none",
147
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.ArrowLeft, { size: 14 }), " Go to Home"]
148
+ })
149
+ ]
150
+ })
151
+ });
152
+ }
153
+
154
+ //#endregion
155
+ //#region src/client/app/mdx-component.tsx
156
+ const mdxComponentsDefault = {
157
+ ...require_mdx.mdx_components_default,
158
+ NotFound,
159
+ "404": NotFound
160
+ };
161
+
162
+ //#endregion
163
+ //#region src/client/ssg/boltdocs-shell.tsx
164
+ /**
165
+ * Updates the HTML lang and dir attributes based on the current locale configuration.
166
+ */
167
+ function I18nUpdater({ config }) {
168
+ const { currentLocale } = require_icons_dev.useBoltdocsContext();
169
+ (0, react.useEffect)(() => {
170
+ if (!config.i18n || typeof document === "undefined") return;
171
+ const locale = currentLocale || config.i18n.defaultLocale;
172
+ const localeConfig = config.i18n.localeConfigs?.[locale];
173
+ document.documentElement.lang = localeConfig?.htmlLang || locale || "en";
174
+ document.documentElement.dir = localeConfig?.direction || "ltr";
175
+ }, [currentLocale, config.i18n]);
176
+ return null;
177
+ }
178
+ function StoreSync({ config, routeMap }) {
179
+ const location = (0, react_router_dom.useLocation)();
180
+ const { setLocale, setVersion } = require_icons_dev.useBoltdocsContext();
181
+ (0, react.useEffect)(() => {
182
+ const currentPath = require_icons_dev.normalizePath(location.pathname);
183
+ const matchedRoute = routeMap.get(currentPath);
184
+ if (matchedRoute) {
185
+ if (config.i18n) setLocale(matchedRoute.locale || config.i18n.defaultLocale);
186
+ if (config.versions) setVersion(matchedRoute.version || config.versions.defaultVersion);
187
+ }
188
+ }, [
189
+ location.pathname,
190
+ config,
191
+ routeMap,
192
+ setLocale,
193
+ setVersion
194
+ ]);
195
+ return null;
196
+ }
197
+ function BoltdocsShell({ config, routes, components = {} }) {
198
+ const allComponents = (0, react.useMemo)(() => ({
199
+ ...mdxComponentsDefault,
200
+ ...virtual_boltdocs_mdx_components.default,
201
+ ...components
202
+ }), [components]);
203
+ const { pathname } = (0, react_router_dom.useLocation)();
204
+ const currentPath = (0, react.useMemo)(() => require_icons_dev.normalizePath(pathname || "/"), [pathname]);
205
+ const routeMap = (0, react.useMemo)(() => {
206
+ const map = /* @__PURE__ */ new Map();
207
+ for (const r of routes) {
208
+ const key = require_icons_dev.normalizePath(r.path === "" ? "/" : r.path);
209
+ map.set(key, r);
210
+ }
211
+ return map;
212
+ }, [routes]);
213
+ const initialData = (0, react.useMemo)(() => {
214
+ const matched = routeMap.get(currentPath);
215
+ let initLocale;
216
+ let initVersion;
217
+ if (matched) {
218
+ if (config.i18n) initLocale = matched.locale || config.i18n.defaultLocale;
219
+ if (config.versions) initVersion = matched.version || config.versions.defaultVersion;
220
+ }
221
+ return {
222
+ initLocale,
223
+ initVersion
224
+ };
225
+ }, [
226
+ currentPath,
227
+ config,
228
+ routeMap
229
+ ]);
230
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HelmetProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.RoutesProvider, {
231
+ routes,
232
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_image.ThemeProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.UIProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MdxComponentsProvider, {
233
+ components: allComponents,
234
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_icons_dev.ConfigContext.Provider, {
235
+ value: config,
236
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScrollHandler, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_icons_dev.BoltdocsProvider, {
237
+ initialLocale: initialData.initLocale,
238
+ initialVersion: initialData.initVersion,
239
+ children: [
240
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StoreSync, {
241
+ config,
242
+ routeMap
243
+ }),
244
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(I18nUpdater, { config }),
245
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog$1.InternalErrorBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.Outlet, {}) })
246
+ ]
247
+ })]
248
+ })
249
+ }) }) })
250
+ }) });
251
+ }
252
+
253
+ //#endregion
254
+ //#region src/client/hooks/use-merged-components.ts
255
+ function useMergedComponents(propComponents) {
256
+ const contextComponents = useMdxComponents();
257
+ return (0, react.useMemo)(() => {
258
+ if (!propComponents) return contextComponents;
259
+ const merged = { ...contextComponents };
260
+ const mergedFrontmatter = { ...contextComponents.Frontmatter || {} };
261
+ let hasPropFrontmatter = false;
262
+ Object.entries(propComponents).forEach(([key, value]) => {
263
+ if (key.startsWith("Frontmatter_")) {
264
+ const cleanKey = key.slice(12);
265
+ mergedFrontmatter[cleanKey] = value;
266
+ hasPropFrontmatter = true;
267
+ } else if (key === "Frontmatter" && value && typeof value === "object") {
268
+ Object.assign(mergedFrontmatter, value);
269
+ hasPropFrontmatter = true;
270
+ } else merged[key] = value;
271
+ });
272
+ if (hasPropFrontmatter || contextComponents.Frontmatter) merged.Frontmatter = mergedFrontmatter;
273
+ return merged;
274
+ }, [contextComponents, propComponents]);
275
+ }
276
+
277
+ //#endregion
278
+ //#region src/client/app/doc-page.tsx
279
+ /**
280
+ * DocPage renders the MDX content and page-specific metadata.
281
+ * It is rendered inside the Outlet of DocsLayout.
282
+ */
283
+ function DocPage({ route, content: Content, mdxComponents: propComponents }) {
284
+ const allComponents = useMergedComponents(propComponents);
285
+ const { LastUpdated } = allComponents;
286
+ if (!Content) return null;
287
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Content, { components: allComponents }), route?.lastUpdated && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LastUpdated, { date: route.lastUpdated })] });
288
+ }
289
+
290
+ //#endregion
291
+ //#region src/client/ssg/mdx-page.tsx
292
+ /**
293
+ * Renders an MDX page by consuming pre-loaded route data.
294
+ *
295
+ * - If the route belongs to a collection (`data.collection` is set), renders
296
+ * the custom post component if provided, else falls back to the standard DocPage.
297
+ * - Otherwise, renders the standard `DocPage` layout.
298
+ */
299
+ function MdxPage({ MDXComponent, mdxComponents: propComponents, collectionPostComponent: CollectionPost }) {
300
+ const data = (0, react_router_dom.useLoaderData)();
301
+ if (!MDXComponent) return null;
302
+ if (!!data?.collection && CollectionPost) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollectionPost, {
303
+ MDXComponent,
304
+ mdxComponents: propComponents
305
+ });
306
+ const docData = data;
307
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DocPage, {
308
+ route: {
309
+ path: docData.path,
310
+ filePath: docData.filePath,
311
+ title: docData.frontmatter?.title,
312
+ description: docData.frontmatter?.description,
313
+ headings: docData.headings,
314
+ locale: docData.locale,
315
+ version: docData.version,
316
+ group: docData.group,
317
+ groupTitle: docData.groupTitle,
318
+ lastUpdated: docData.lastUpdated,
319
+ frontmatter: docData.frontmatter
320
+ },
321
+ content: MDXComponent,
322
+ mdxComponents: propComponents
323
+ });
324
+ }
325
+
326
+ //#endregion
327
+ //#region src/client/hooks/use-breadcrumbs.ts
328
+ /**
329
+ * Hook to generate breadcrumbs based on the current active route.
330
+ */
331
+ function useBreadcrumbs() {
332
+ const { currentRoute: activeRoute } = require_icons_dev.useRoutes();
333
+ const crumbs = [];
334
+ if (activeRoute) {
335
+ if (activeRoute.groupTitle) crumbs.push({ label: activeRoute.groupTitle });
336
+ crumbs.push({
337
+ label: activeRoute.title,
338
+ href: activeRoute.path
339
+ });
340
+ }
341
+ return {
342
+ crumbs,
343
+ activeRoute
344
+ };
345
+ }
346
+
347
+ //#endregion
348
+ //#region src/client/components/ui-base/breadcrumbs.tsx
349
+ function Breadcrumbs() {
350
+ const { crumbs, activeRoute } = useBreadcrumbs();
351
+ if (crumbs.length === 0) return null;
352
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Breadcrumbs.Root, {
353
+ className: "gap-2 text-xs sm:text-sm font-medium",
354
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Breadcrumbs.Item, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Breadcrumbs.Link, {
355
+ href: "/",
356
+ className: "text-muted hover:text-body transition-colors flex items-center",
357
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Home, { size: 14 })
358
+ }) }), crumbs.map((crumb, i) => {
359
+ const isActive = crumb.href === activeRoute?.path;
360
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Breadcrumbs.Item, {
361
+ className: "gap-2",
362
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Breadcrumbs.Separator, { className: "text-muted/40" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Breadcrumbs.Link, {
363
+ href: crumb.href,
364
+ className: require_icons_dev.cn("transition-colors", isActive ? "text-body font-semibold cursor-default pointer-events-none" : "text-muted hover:text-body"),
365
+ children: crumb.label
366
+ })]
367
+ }, `crumb-${crumb.href}-${crumb.label}-${i}`);
368
+ })]
369
+ });
370
+ }
371
+
372
+ //#endregion
373
+ //#region src/client/components/ui-base/copy-markdown.tsx
374
+ const useCopyMarkdown = (content) => {
375
+ const [copied, setCopied] = (0, react.useState)(false);
376
+ const timerRef = (0, react.useRef)(null);
377
+ (0, react.useEffect)(() => {
378
+ return () => {
379
+ if (timerRef.current) clearTimeout(timerRef.current);
380
+ };
381
+ }, []);
382
+ const handleCopy = () => {
383
+ navigator.clipboard.writeText(content);
384
+ setCopied(true);
385
+ if (timerRef.current) clearTimeout(timerRef.current);
386
+ timerRef.current = setTimeout(() => {
387
+ setCopied(false);
388
+ timerRef.current = null;
389
+ }, 2e3);
390
+ };
391
+ const handleOpenRaw = () => {
392
+ const blob = new Blob([content], { type: "text/plain;charset=utf-8" });
393
+ const url = URL.createObjectURL(blob);
394
+ window.open(url, "_blank");
395
+ };
396
+ return {
397
+ copied,
398
+ handleCopy,
399
+ handleOpenRaw
400
+ };
401
+ };
402
+ function CopyMarkdown({ content, mdxRaw }) {
403
+ const displayContent = mdxRaw || content || "";
404
+ const { copied, handleCopy, handleOpenRaw } = useCopyMarkdown(displayContent);
405
+ if (!displayContent) return null;
406
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
407
+ className: "relative inline-flex z-100 shrink-0 w-max",
408
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.ButtonGroup, {
409
+ className: "rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden",
410
+ children: [
411
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Button, {
412
+ onPress: handleCopy,
413
+ className: require_icons_dev.cn("md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none", "text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body", copied && "text-emerald-500 hover:bg-emerald-500/5"),
414
+ "aria-label": copied ? "Copied!" : "Copy Markdown",
415
+ children: copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Check, { size: 14 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Copy, { size: 14 })
416
+ }),
417
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_search_dialog.Button, {
418
+ onPress: handleCopy,
419
+ className: require_icons_dev.cn("hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none", "text-body transition-all duration-300 hover:bg-primary-500/5", copied && "text-emerald-500 hover:bg-emerald-500/5"),
420
+ children: [copied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Check, { size: 16 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Copy, { size: 16 }), copied ? "Copied!" : "Copy Markdown"]
421
+ }),
422
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Menu.Trigger, {
423
+ placement: "bottom end",
424
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Button, {
425
+ className: require_icons_dev.cn("flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer", "transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500"),
426
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.ChevronDown, { size: 14 })
427
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Menu.Root, {
428
+ className: "w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100",
429
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Menu.Item, {
430
+ onAction: handleCopy,
431
+ className: "flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group",
432
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Copy, {
433
+ size: 16,
434
+ className: "size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400"
435
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
436
+ className: "ml-2",
437
+ children: "Copy Markdown"
438
+ })]
439
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Menu.Item, {
440
+ onAction: handleOpenRaw,
441
+ className: "flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group",
442
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.ExternalLink, {
443
+ size: 16,
444
+ className: "size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400"
445
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
446
+ className: "ml-2",
447
+ children: "View as Markdown"
448
+ })]
449
+ })]
450
+ })]
451
+ })
452
+ ]
453
+ })
454
+ });
455
+ }
456
+
457
+ //#endregion
458
+ //#region src/client/components/ui-base/error-boundary.tsx
459
+ function ErrorBoundary({ children, fallback }) {
460
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.ErrorBoundary, {
461
+ fallback,
462
+ children
463
+ });
464
+ }
465
+
466
+ //#endregion
467
+ //#region src/client/utils/github.ts
468
+ const BASE_URL = "https://api.github.com";
469
+ /**
470
+ * Get the number of stars for a GitHub repository.
471
+ * @param repo - owner/repo
472
+ * @param token - The GitHub token.
473
+ * @param baseUrl - The GitHub API base URL.
474
+ * @returns The number of stars for the repository.
475
+ * @example
476
+ * getStarsRepo('owner/repo') // 100k
477
+ */
478
+ async function getStarsRepo(repo, token, baseUrl = BASE_URL) {
479
+ const headers = new Headers();
480
+ if (token) headers.append("authorization", token);
481
+ const data = await (await fetch(`${baseUrl}/repos/${repo}`, { headers })).json();
482
+ if (data.stargazers_count !== void 0) return formatStars(data.stargazers_count);
483
+ else return "0";
484
+ }
485
+ /**
486
+ * Format a number of stars in a compact form.
487
+ * @param count - The number of stars to format.
488
+ * @returns The formatted number of stars.
489
+ */
490
+ const formatStars = (count) => {
491
+ return Intl.NumberFormat("en", {
492
+ notation: "compact",
493
+ compactDisplay: "short"
494
+ }).format(count);
495
+ };
496
+
497
+ //#endregion
498
+ //#region src/client/components/ui-base/github-stars.tsx
499
+ function GithubStars({ repo }) {
500
+ const [stars, setStars] = (0, react.useState)(null);
501
+ (0, react.useEffect)(() => {
502
+ if (repo) getStarsRepo(repo).then((stars) => setStars(stars)).catch(() => setStars("0"));
503
+ }, [repo]);
504
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
505
+ href: `https://github.com/${repo}`,
506
+ target: "_blank",
507
+ rel: "noopener noreferrer",
508
+ className: "inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none",
509
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Github, { className: "h-4 w-4 text-body" }), stars !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
510
+ className: "tabular-nums font-medium",
511
+ children: [stars, " stars"]
512
+ })]
513
+ });
514
+ }
515
+
516
+ //#endregion
517
+ //#region src/client/utils/i18n.ts
518
+ /**
519
+ * Retrieves the correct translation from a value that can be either
520
+ * a simple string or a map of locale-specific strings.
521
+ *
522
+ * @param value - The text to translate
523
+ * @param locale - The current active locale (e.g., 'en', 'es')
524
+ * @returns The translated string
525
+ */
526
+ function getTranslated(value, locale) {
527
+ if (!value) return "";
528
+ if (typeof value === "string") return value;
529
+ if (locale && value[locale]) return value[locale];
530
+ return Object.values(value)[0] || "";
531
+ }
532
+
533
+ //#endregion
534
+ //#region src/client/hooks/use-navbar.ts
535
+ function useNavbar() {
536
+ const config = require_icons_dev.useConfig();
537
+ const { theme, resolvedTheme } = require_image.useTheme();
538
+ const location = (0, react_router_dom.useLocation)();
539
+ const { currentLocale } = require_icons_dev.useRoutes();
540
+ const themeConfig = config.theme || {};
541
+ const title = getTranslated(themeConfig.title, currentLocale) || "Boltdocs";
542
+ const rawLinks = themeConfig.navbar || [];
543
+ const socialLinks = themeConfig.socialLinks || [];
544
+ const githubRepo = themeConfig.githubRepo;
545
+ const links = (0, react.useMemo)(() => {
546
+ return rawLinks.map((item) => {
547
+ const href = item.href || item.to || item.link || "";
548
+ const getIsActive = (h) => {
549
+ const activePath = location.pathname;
550
+ if (activePath === h) return true;
551
+ if (!h || h === "/") return activePath === "/";
552
+ const cleanPathParts = (p) => {
553
+ const parts = p.split("/").filter(Boolean);
554
+ let i = 0;
555
+ if (config.i18n?.locales && parts[i] && config.i18n.locales[parts[i]]) i++;
556
+ if (config.versions?.versions && parts[i]) {
557
+ if (config.versions.versions.some((v) => v.path === parts[i])) i++;
558
+ }
559
+ return parts.slice(i);
560
+ };
561
+ const hParts = cleanPathParts(h);
562
+ const pParts = cleanPathParts(activePath);
563
+ if (hParts.length === 0) return pParts.length === 0;
564
+ if (pParts.length < hParts.length) return false;
565
+ return hParts.every((part, i) => pParts[i] === part);
566
+ };
567
+ const processItems = (items) => {
568
+ if (!items || items.length === 0) return void 0;
569
+ return items.map((subItem) => {
570
+ const subHref = subItem.href || subItem.to || subItem.link || "";
571
+ return {
572
+ label: getTranslated(subItem.label || subItem.text, currentLocale),
573
+ href: subHref,
574
+ active: getIsActive(subHref),
575
+ to: subHref.startsWith("http") || subHref.startsWith("//") ? "external" : void 0
576
+ };
577
+ });
578
+ };
579
+ const linkItems = processItems(item.items);
580
+ return {
581
+ label: getTranslated(item.label || item.text, currentLocale),
582
+ href,
583
+ active: getIsActive(href),
584
+ to: href.startsWith("http") || href.startsWith("//") ? "external" : void 0,
585
+ items: linkItems
586
+ };
587
+ });
588
+ }, [
589
+ rawLinks,
590
+ location.pathname,
591
+ currentLocale,
592
+ config
593
+ ]);
594
+ const logo = themeConfig.logo;
595
+ return {
596
+ links,
597
+ title,
598
+ logo: !logo ? null : typeof logo === "string" ? logo : resolvedTheme === "dark" ? logo.dark : logo.light,
599
+ logoProps: {
600
+ alt: (logo && typeof logo === "object" ? logo.alt : void 0) || title,
601
+ width: logo && typeof logo === "object" ? logo.width : void 0,
602
+ height: logo && typeof logo === "object" ? logo.height : void 0
603
+ },
604
+ github: githubRepo ? `https://github.com/${githubRepo}` : null,
605
+ social: socialLinks,
606
+ config,
607
+ theme
608
+ };
609
+ }
610
+
611
+ //#endregion
612
+ //#region src/client/components/ui-base/theme-toggle.tsx
613
+ function ThemeToggle() {
614
+ const { theme, setTheme } = require_image.useTheme();
615
+ const [mounted, setMounted] = (0, react.useState)(false);
616
+ (0, react.useEffect)(() => {
617
+ setMounted(true);
618
+ }, []);
619
+ if (!mounted) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "h-9 w-9" });
620
+ const Icon = theme === "system" ? require_icons_dev.Monitor : theme === "dark" ? require_icons_dev.Moon : require_icons_dev.Sun;
621
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Menu.Trigger, {
622
+ placement: "bottom right",
623
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_aria_components.Button, {
624
+ className: "flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer",
625
+ "aria-label": "Selection theme",
626
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
627
+ size: 20,
628
+ className: "animate-in fade-in zoom-in duration-300"
629
+ })
630
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Menu.Root, {
631
+ selectionMode: "single",
632
+ selectedKeys: [theme],
633
+ onSelectionChange: (keys) => {
634
+ const newTheme = Array.from(keys)[0];
635
+ setTheme(newTheme);
636
+ },
637
+ className: "w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100",
638
+ children: [
639
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Menu.Item, {
640
+ id: "light",
641
+ className: "group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5",
642
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Sun, {
643
+ className: "group-hover:text-primary-500 dark:group-hover:text-primary-200",
644
+ size: 16
645
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
646
+ className: "ml-2",
647
+ children: "Light"
648
+ })]
649
+ }),
650
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Menu.Item, {
651
+ id: "dark",
652
+ className: "flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5",
653
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Moon, {
654
+ className: "group-hover:text-primary-500 dark:group-hover:text-primary-200",
655
+ size: 16
656
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
657
+ className: "ml-2",
658
+ children: "Dark"
659
+ })]
660
+ }),
661
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Menu.Item, {
662
+ id: "system",
663
+ className: "flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5",
664
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Monitor, {
665
+ className: "group-hover:text-primary-500 dark:group-hover:text-primary-200",
666
+ size: 16
667
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
668
+ className: "ml-2",
669
+ children: "System"
670
+ })]
671
+ })
672
+ ]
673
+ })]
674
+ });
675
+ }
676
+ function ThemeSwitcher({ className }) {
677
+ const { theme, setTheme } = require_image.useTheme();
678
+ const [mounted, setMounted] = (0, react.useState)(false);
679
+ (0, react.useEffect)(() => {
680
+ setMounted(true);
681
+ }, []);
682
+ if (!mounted) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: require_icons_dev.cn("h-10 w-full bg-surface rounded-xl animate-pulse", className) });
683
+ const isDark = theme === "dark";
684
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
685
+ className: require_icons_dev.cn("flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11", className),
686
+ children: [
687
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: require_icons_dev.cn("absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs", isDark ? "translate-x-full" : "translate-x-0") }),
688
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
689
+ onClick: () => setTheme("light"),
690
+ className: require_icons_dev.cn("flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent", !isDark ? "text-body font-semibold" : "text-muted hover:text-body"),
691
+ "aria-label": "Light mode",
692
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Sun, { size: 18 })
693
+ }),
694
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
695
+ onClick: () => setTheme("dark"),
696
+ className: require_icons_dev.cn("flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent", isDark ? "text-body font-semibold" : "text-muted hover:text-body"),
697
+ "aria-label": "Dark mode",
698
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Moon, { size: 18 })
699
+ })
700
+ ]
701
+ });
702
+ }
703
+
704
+ //#endregion
705
+ //#region src/client/hooks/use-tabs.ts
706
+ function useTabs(tabs = [], routes = []) {
707
+ const location = (0, react_router_dom.useLocation)();
708
+ const tabRefs = (0, react.useRef)([]);
709
+ const [indicatorStyle, setIndicatorStyle] = (0, react.useState)({
710
+ opacity: 0,
711
+ transform: "translateX(0) scaleX(0)",
712
+ width: 0
713
+ });
714
+ const currentPath = require_icons_dev.normalizePath(location.pathname);
715
+ const activeTabId = routes.find((r) => require_icons_dev.normalizePath(r.path) === currentPath)?.tab?.toLowerCase();
716
+ const activeIndex = tabs.findIndex((tab) => tab.id.toLowerCase() === activeTabId);
717
+ const finalActiveIndex = activeIndex === -1 ? 0 : activeIndex;
718
+ (0, react.useEffect)(() => {
719
+ const activeTab = tabRefs.current[finalActiveIndex];
720
+ if (activeTab) setIndicatorStyle({
721
+ opacity: 1,
722
+ width: activeTab.offsetWidth,
723
+ transform: `translateX(${activeTab.offsetLeft}px)`
724
+ });
725
+ }, [
726
+ finalActiveIndex,
727
+ tabs.length,
728
+ location.pathname
729
+ ]);
730
+ return {
731
+ tabs,
732
+ activeIndex: finalActiveIndex,
733
+ indicatorStyle,
734
+ tabRefs,
735
+ activeTabId
736
+ };
737
+ }
738
+
739
+ //#endregion
740
+ //#region src/client/components/ui-base/tabs.tsx
741
+ function Tabs({ tabs, routes }) {
742
+ const { currentLocale } = require_icons_dev.useRoutes();
743
+ const { indicatorStyle, tabRefs, activeIndex } = useTabs(tabs, routes);
744
+ (0, react.useEffect)(() => {
745
+ const activeTab = tabRefs.current[activeIndex];
746
+ if (activeTab) activeTab.scrollIntoView({
747
+ behavior: "smooth",
748
+ block: "nearest",
749
+ inline: "center"
750
+ });
751
+ }, [activeIndex]);
752
+ const renderTabIcon = (iconName) => {
753
+ if (!iconName) return null;
754
+ if (iconName.trim().startsWith("<svg")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
755
+ className: "h-4 w-4",
756
+ dangerouslySetInnerHTML: { __html: iconName }
757
+ });
758
+ const icons = {
759
+ ...require_icons_dev.icons_exports,
760
+ ...virtual_boltdocs_icons.default
761
+ };
762
+ const TabIcon = icons[iconName] || icons[iconName + "Icon"];
763
+ if (TabIcon) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabIcon, { size: 16 });
764
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
765
+ src: iconName,
766
+ alt: "",
767
+ className: "h-4 w-4 object-contain"
768
+ });
769
+ };
770
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
771
+ className: "mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none",
772
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Tabs.List, {
773
+ className: "border-none py-0 scrollbar-hide relative flex flex-row items-center overflow-x-auto",
774
+ children: [tabs.map((tab, index) => {
775
+ const isActive = index === activeIndex;
776
+ const firstRoute = routes.find((r) => r.tab && r.tab.toLowerCase() === tab.id.toLowerCase());
777
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_icons_dev.Link, {
778
+ href: firstRoute ? firstRoute.path : "#",
779
+ ref: (el) => {
780
+ tabRefs.current[index] = el;
781
+ },
782
+ className: `relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${isActive ? "text-primary-500" : "text-muted hover:text-body"}`,
783
+ children: [renderTabIcon(tab.icon), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: getTranslated(tab.text, currentLocale) })]
784
+ }, tab.id);
785
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Tabs.Indicator, {
786
+ style: indicatorStyle,
787
+ className: "h-0.5 bg-primary-500 rounded-full transition-all duration-300"
788
+ })]
789
+ })
790
+ });
791
+ }
792
+
793
+ //#endregion
794
+ //#region src/client/utils/get-base-file-path.ts
795
+ /**
796
+ * Get the base file path by removing version and locale prefixes.
797
+ * @param filePath - The full file path.
798
+ * @param version - The version to remove from the path.
799
+ * @param locale - The locale to remove from the path.
800
+ * @returns The base file path.
801
+ */
802
+ function getBaseFilePath(filePath, version, locale) {
803
+ let path = filePath;
804
+ if (version && (path === version || path.startsWith(version + "/"))) path = path === version ? "index.md" : path.slice(version.length + 1);
805
+ if (locale && (path === locale || path.startsWith(locale + "/"))) path = path === locale ? "index.md" : path.slice(locale.length + 1);
806
+ return path;
807
+ }
808
+
809
+ //#endregion
810
+ //#region src/client/hooks/use-version.ts
811
+ /**
812
+ * Hook to manage and switch between different versions of the documentation.
813
+ */
814
+ function useVersion() {
815
+ const navigate = (0, react_router_dom.useNavigate)();
816
+ const config = require_icons_dev.useConfig();
817
+ const { allRoutes, currentRoute, currentVersion, currentLocale } = require_icons_dev.useRoutes();
818
+ const versions = config.versions;
819
+ const { setVersion } = require_icons_dev.useBoltdocsContext();
820
+ const handleVersionChange = (version) => {
821
+ if (!versions || version === currentVersion) return;
822
+ setVersion(version);
823
+ let targetPath = `${(config.base || "/docs").replace(/\/$/, "")}/${version}${currentLocale ? `/${currentLocale}` : ""}`;
824
+ if (currentRoute) {
825
+ const baseFile = getBaseFilePath(currentRoute.filePath, currentRoute.version, currentRoute.locale);
826
+ const targetRoute = allRoutes.find((r) => getBaseFilePath(r.filePath, r.version, r.locale) === baseFile && (r.version || versions.defaultVersion) === version && (!config.i18n || (r.locale || config.i18n.defaultLocale) === currentLocale));
827
+ if (targetRoute) targetPath = targetRoute.path;
828
+ else {
829
+ const versionIndexRoute = allRoutes.find((r) => getBaseFilePath(r.filePath, r.version, r.locale) === "index.md" && (r.version || versions.defaultVersion) === version && (!config.i18n || (r.locale || config.i18n.defaultLocale) === currentLocale));
830
+ if (versionIndexRoute) targetPath = versionIndexRoute.path;
831
+ }
832
+ } else {
833
+ const fallbackRoute = allRoutes.find((r) => (r.version || versions.defaultVersion) === version && (!config.i18n || (r.locale || config.i18n.defaultLocale) === currentLocale));
834
+ if (fallbackRoute) targetPath = fallbackRoute.path;
835
+ }
836
+ navigate(targetPath);
837
+ };
838
+ return {
839
+ currentVersion,
840
+ currentVersionLabel: (versions?.versions?.find?.((v) => v.path === currentVersion))?.label || currentVersion,
841
+ availableVersions: (0, react.useMemo)(() => {
842
+ return versions?.versions ? versions.versions.map((v) => ({
843
+ key: v.path,
844
+ label: v.label,
845
+ value: v.path,
846
+ isCurrent: v.path === currentVersion
847
+ })) : [];
848
+ }, [versions, currentVersion]),
849
+ handleVersionChange
850
+ };
851
+ }
852
+
853
+ //#endregion
854
+ //#region src/client/hooks/use-i18n.ts
855
+ /**
856
+ * Hook to manage and switch between different locales (languages) of the documentation.
857
+ */
858
+ function useI18n() {
859
+ const navigate = (0, react_router_dom.useNavigate)();
860
+ const config = require_icons_dev.useConfig();
861
+ const { allRoutes, currentRoute, currentLocale, currentVersion } = require_icons_dev.useRoutes();
862
+ const i18n = config.i18n;
863
+ const { setLocale } = require_icons_dev.useBoltdocsContext();
864
+ const handleLocaleChange = (locale) => {
865
+ if (!i18n || locale === currentLocale) return;
866
+ setLocale(locale);
867
+ const base = config.base || "/";
868
+ const safeBase = base === "/" ? "" : base.replace(/\/$/, "");
869
+ const isDocRoute = !!currentRoute?.filePath;
870
+ let targetPath = "";
871
+ if (currentRoute) if (isDocRoute) {
872
+ const baseFile = getBaseFilePath(currentRoute.filePath, currentRoute.version, currentRoute.locale);
873
+ const targetRoute = allRoutes.find((r) => getBaseFilePath(r.filePath, r.version, r.locale) === baseFile && (r.locale || i18n.defaultLocale) === locale && r.version === currentRoute.version);
874
+ if (targetRoute) targetPath = targetRoute.path;
875
+ else {
876
+ const defaultIndexRoute = allRoutes.find((r) => getBaseFilePath(r.filePath, r.version, r.locale) === "index.md" && (r.locale || i18n.defaultLocale) === locale && r.version === currentRoute.version);
877
+ if (defaultIndexRoute) targetPath = defaultIndexRoute.path;
878
+ else targetPath = `${safeBase}${currentRoute.version ? `/${currentRoute.version}` : ""}${locale === i18n.defaultLocale ? "" : `/${locale}`}` || "/";
879
+ }
880
+ } else {
881
+ let rawExternal = currentRoute.path;
882
+ const parts = rawExternal.split("/").filter(Boolean);
883
+ if (parts.length > 0 && (Array.isArray(i18n.locales) ? i18n.locales.includes(parts[0]) : !!i18n.locales[parts[0]])) {
884
+ parts.shift();
885
+ rawExternal = "/" + parts.join("/");
886
+ }
887
+ if (locale === i18n.defaultLocale) targetPath = rawExternal === "" ? "/" : rawExternal;
888
+ else {
889
+ const cleanExt = rawExternal.startsWith("/") ? rawExternal : `/${rawExternal}`;
890
+ targetPath = `/${locale}${cleanExt === "/" ? "" : cleanExt}`;
891
+ }
892
+ }
893
+ else {
894
+ const targetRoute = allRoutes.find((r) => (r.locale || i18n.defaultLocale) === locale && (r.version || config.versions?.defaultVersion) === (currentVersion || config.versions?.defaultVersion));
895
+ if (targetRoute) targetPath = targetRoute.path;
896
+ else {
897
+ const vPath = currentVersion && currentVersion !== config.versions?.defaultVersion ? `/${currentVersion}` : "";
898
+ targetPath = locale === i18n.defaultLocale ? `${safeBase}${vPath}` : `${safeBase}${vPath}/${locale}`;
899
+ }
900
+ }
901
+ if (!targetPath || targetPath === "") targetPath = "/";
902
+ targetPath = targetPath.replace(/\/+/g, "/");
903
+ navigate(targetPath);
904
+ };
905
+ const locales = i18n?.locales;
906
+ const defaultLabel = locales ? Array.isArray(locales) ? currentLocale : locales[currentLocale] : void 0;
907
+ return {
908
+ currentLocale,
909
+ currentLocaleLabel: (i18n?.localeConfigs?.[currentLocale])?.label || defaultLabel || currentLocale,
910
+ availableLocales: (0, react.useMemo)(() => {
911
+ return i18n ? Array.isArray(i18n.locales) ? i18n.locales.map((key) => {
912
+ return {
913
+ key,
914
+ label: (i18n?.localeConfigs?.[key])?.label || key,
915
+ value: key,
916
+ isCurrent: key === currentLocale
917
+ };
918
+ }) : Object.entries(i18n.locales).map(([key, label]) => {
919
+ return {
920
+ key,
921
+ label: (i18n?.localeConfigs?.[key])?.label || label,
922
+ value: key,
923
+ isCurrent: key === currentLocale
924
+ };
925
+ }) : [];
926
+ }, [i18n, currentLocale]),
927
+ handleLocaleChange
928
+ };
929
+ }
930
+
931
+ //#endregion
932
+ //#region src/client/components/ui-base/version-i18n.tsx
933
+ function VersionSelector({ className }) {
934
+ const { currentVersionLabel, availableVersions, handleVersionChange } = useVersion();
935
+ if (availableVersions.length === 0) return null;
936
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Menu.Trigger, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_search_dialog.Button, {
937
+ className: require_icons_dev.cn("flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer", className),
938
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
939
+ className: "font-semibold text-[0.8125rem]",
940
+ children: currentVersionLabel
941
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.ChevronDown, { className: "w-3.5 h-3.5 text-muted/60" })]
942
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Menu.Root, {
943
+ className: "w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100",
944
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Menu.Section, {
945
+ items: availableVersions,
946
+ children: (version) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Menu.Item, {
947
+ onPress: () => handleVersionChange(version.value),
948
+ className: "flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5",
949
+ children: version.label
950
+ }, `${version.value ?? ""}`)
951
+ })
952
+ })] });
953
+ }
954
+ function I18nSelector({ className }) {
955
+ const { currentLocale, availableLocales, handleLocaleChange } = useI18n();
956
+ if (availableLocales.length === 0) return null;
957
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Menu.Trigger, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_search_dialog.Button, {
958
+ className: require_icons_dev.cn("flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer", className),
959
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
960
+ className: "flex items-center gap-1.5",
961
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Languages, { className: "w-3.5 h-3.5 text-primary-500" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
962
+ className: "font-bold text-[0.75rem] uppercase opacity-90",
963
+ children: currentLocale || "en"
964
+ })]
965
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.ChevronDown, { className: "w-3.5 h-3.5 text-muted/60" })]
966
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Menu.Root, {
967
+ className: "w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100",
968
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Menu.Section, {
969
+ items: availableLocales,
970
+ children: (locale) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Menu.Item, {
971
+ onPress: () => handleLocaleChange(locale.value),
972
+ className: "flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5",
973
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: locale.label })
974
+ }, `${locale.value ?? ""}`)
975
+ })
976
+ })] });
977
+ }
978
+
979
+ //#endregion
980
+ //#region src/client/components/ui-base/navbar.tsx
981
+ const SearchDialog$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("../search-dialog-CUeAfy-8.cjs")).then((m) => ({ default: m.SearchDialog })));
982
+ function Navbar() {
983
+ const { links, title, logo, logoProps, github, social, config } = useNavbar();
984
+ const { routes, currentRoute, isCollectionPage, currentVersion, currentLocale } = require_icons_dev.useRoutes();
985
+ const { isSidebarOpen, toggleSidebar } = require_docs_layout.useUI();
986
+ const [isMobileMenuOpen, setIsMobileMenuOpen] = (0, react.useState)(false);
987
+ const themeConfig = config.theme || {};
988
+ const isDocs = !!currentRoute?.filePath && !isCollectionPage;
989
+ const hasTabs = themeConfig?.tabs && themeConfig.tabs.length > 0;
990
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_search_dialog.Navbar.Root, {
991
+ className: require_icons_dev.cn("border-b border-subtle bg-main/80 backdrop-blur-md", hasTabs && "border-b-0"),
992
+ children: [
993
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_search_dialog.Navbar.Content, { children: [
994
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_search_dialog.Navbar.Left, { children: [
995
+ isDocs && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Button, {
996
+ onPress: toggleSidebar,
997
+ className: "mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors",
998
+ "aria-label": isSidebarOpen ? "Close sidebar" : "Open sidebar",
999
+ children: isSidebarOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.X, { className: "w-5 h-5 text-body" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Menu, { className: "w-5 h-5 text-body" })
1000
+ }),
1001
+ logo && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.Logo, {
1002
+ src: logo,
1003
+ alt: logoProps?.alt || title,
1004
+ width: logoProps?.width ?? 24,
1005
+ height: logoProps?.height ?? 24,
1006
+ href: "site:/"
1007
+ }),
1008
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.Title, {
1009
+ href: "site:/",
1010
+ children: title
1011
+ }),
1012
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1013
+ className: "hidden sm:block",
1014
+ children: config.versions && currentVersion && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VersionSelector, {})
1015
+ })
1016
+ ] }),
1017
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.Center, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
1018
+ fallback: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "h-9 w-32 animate-pulse rounded-md bg-surface" }),
1019
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchDialog$1, { routes: routes || [] })
1020
+ }) }),
1021
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_search_dialog.Navbar.Right, { children: [
1022
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
1023
+ fallback: null,
1024
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1025
+ className: "lg:hidden",
1026
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchDialog$1, { routes: routes || [] })
1027
+ })
1028
+ }),
1029
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.Links, { children: links.map((link) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavbarLinkItem, { link }, link.href)) }),
1030
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1031
+ className: "hidden sm:flex items-center gap-2",
1032
+ children: [config.i18n && currentLocale && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(I18nSelector, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.Split, { className: "bg-subtle" })]
1033
+ }),
1034
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1035
+ className: "hidden md:block",
1036
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeToggle, {})
1037
+ }),
1038
+ github && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1039
+ className: "hidden md:block",
1040
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GithubStars, { repo: themeConfig?.githubRepo ?? "" })
1041
+ }),
1042
+ social.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1043
+ className: "hidden md:block",
1044
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.Split, { className: "bg-subtle" })
1045
+ }),
1046
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1047
+ className: "hidden md:flex items-center gap-1",
1048
+ children: social.map(({ icon, link }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.Socials, {
1049
+ icon,
1050
+ link,
1051
+ className: "p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30"
1052
+ }, link))
1053
+ }),
1054
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.More, {
1055
+ onPress: () => setIsMobileMenuOpen(true),
1056
+ className: "text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30"
1057
+ })
1058
+ ] })
1059
+ ] }),
1060
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_search_dialog.Navbar.MobileMenu, {
1061
+ isOpen: isMobileMenuOpen,
1062
+ onClose: () => setIsMobileMenuOpen(false),
1063
+ className: "bg-main/98 backdrop-blur-2xl",
1064
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1065
+ className: "flex flex-col gap-1",
1066
+ children: links.map((link) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavbarMobileLinkItem, {
1067
+ link,
1068
+ onClose: () => setIsMobileMenuOpen(false)
1069
+ }, link.href))
1070
+ }), social.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1071
+ className: "mt-6",
1072
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1073
+ className: "px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50",
1074
+ children: "Connect"
1075
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1076
+ className: "flex flex-wrap gap-2 px-2",
1077
+ children: social.map(({ icon, link }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.Socials, {
1078
+ icon,
1079
+ link,
1080
+ className: "p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center"
1081
+ }, link))
1082
+ })]
1083
+ })]
1084
+ }),
1085
+ isDocs && hasTabs && themeConfig?.tabs && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1086
+ className: "w-full border-b border-subtle bg-main",
1087
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tabs, {
1088
+ tabs: themeConfig.tabs,
1089
+ routes: routes || []
1090
+ })
1091
+ })
1092
+ ]
1093
+ });
1094
+ }
1095
+ function NavbarLinkItem({ link }) {
1096
+ const localizedHref = require_icons_dev.useLocalizedTo(link.href || "");
1097
+ const { pathname } = (0, react_router_dom.useLocation)();
1098
+ const active = pathname === localizedHref || pathname.startsWith(localizedHref + "/");
1099
+ if (link.items && link.items.length > 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.Dropdown, {
1100
+ label: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1101
+ className: require_icons_dev.cn("transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1", active ? "text-primary-500" : "text-muted hover:text-body"),
1102
+ children: link.label
1103
+ }),
1104
+ children: link.items?.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.DropdownItem, {
1105
+ href: require_icons_dev.useLocalizedTo(item.href || ""),
1106
+ label: item.label
1107
+ }, item.href))
1108
+ });
1109
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.Link, {
1110
+ ...link,
1111
+ href: localizedHref,
1112
+ active,
1113
+ className: require_icons_dev.cn("transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm", active ? "text-primary-500" : "text-muted hover:text-body")
1114
+ });
1115
+ }
1116
+ function NavbarMobileLinkItem({ link, onClose }) {
1117
+ const localizedHref = require_icons_dev.useLocalizedTo(link.href || "");
1118
+ const { pathname } = (0, react_router_dom.useLocation)();
1119
+ const active = pathname === localizedHref;
1120
+ if (link.items && link.items.length > 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1121
+ className: "flex flex-col gap-1",
1122
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1123
+ className: require_icons_dev.cn("px-3 py-2 text-sm transition-all", active ? "text-body" : "text-muted/80 hover:text-body"),
1124
+ children: link.label
1125
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1126
+ className: "flex flex-col gap-1 pl-4",
1127
+ children: link.items?.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavbarMobileLinkItem, {
1128
+ link: item,
1129
+ onClose
1130
+ }, item.href))
1131
+ })]
1132
+ });
1133
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Navbar.MobileLink, {
1134
+ ...link,
1135
+ href: localizedHref,
1136
+ active,
1137
+ onPress: onClose,
1138
+ className: require_icons_dev.cn("transition-all", active ? "text-body" : "text-muted/80 hover:text-body")
1139
+ });
1140
+ }
1141
+
1142
+ //#endregion
1143
+ //#region src/client/components/ui-base/on-this-page.tsx
1144
+ function OnThisPage({ headings = [], editLink, communityHelp, filePath }) {
1145
+ if (headings.length === 0) return null;
1146
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.OnThisPage.Root, { children: [
1147
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.OnThisPage.Header, {
1148
+ className: "flex flex-row gap-x-2",
1149
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.TextAlignStart, { size: 16 }), "On this page"]
1150
+ }),
1151
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.OnThisPage.Tree, { headings }),
1152
+ (editLink || communityHelp) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1153
+ className: "mt-8 pt-8 border-t border-subtle space-y-4",
1154
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1155
+ className: "text-xs font-bold text-body",
1156
+ children: "Need help?"
1157
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
1158
+ className: "space-y-3",
1159
+ children: [editLink && filePath && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
1160
+ href: editLink.replace(":path", filePath),
1161
+ target: "_blank",
1162
+ rel: "noopener noreferrer",
1163
+ className: "flex items-center gap-2 text-sm text-muted hover:text-body transition-colors",
1164
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.Pencil, { size: 16 }), "Edit this page"]
1165
+ }) }), communityHelp && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
1166
+ href: communityHelp,
1167
+ target: "_blank",
1168
+ rel: "noopener noreferrer",
1169
+ className: "flex items-center gap-2 text-sm text-muted hover:text-body transition-colors",
1170
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.CircleHelp, { size: 16 }), "Community help"]
1171
+ }) })]
1172
+ })]
1173
+ })
1174
+ ] });
1175
+ }
1176
+
1177
+ //#endregion
1178
+ //#region src/client/hooks/use-page-nav.ts
1179
+ /**
1180
+ * Hook to manage the previous and next button functionality for documentation pages.
1181
+ * Intelligent: respects current locale, version, and tab to keep navigation logical.
1182
+ */
1183
+ function usePageNav() {
1184
+ const { routes, currentRoute } = require_icons_dev.useRoutes();
1185
+ const location = (0, react_router_dom.useLocation)();
1186
+ return (0, react.useMemo)(() => {
1187
+ if (!currentRoute) return {
1188
+ prevPage: null,
1189
+ nextPage: null,
1190
+ currentRoute: null
1191
+ };
1192
+ const activeTabId = currentRoute.tab?.toLowerCase();
1193
+ const contextRoutes = activeTabId ? routes.filter((r) => r.tab?.toLowerCase() === activeTabId) : routes.filter((r) => !r.tab);
1194
+ const currentIndex = contextRoutes.findIndex((r) => r.path === location.pathname);
1195
+ return {
1196
+ prevPage: currentIndex > 0 ? contextRoutes[currentIndex - 1] : null,
1197
+ nextPage: currentIndex !== -1 && currentIndex < contextRoutes.length - 1 ? contextRoutes[currentIndex + 1] : null,
1198
+ currentRoute
1199
+ };
1200
+ }, [
1201
+ routes,
1202
+ currentRoute,
1203
+ location.pathname
1204
+ ]);
1205
+ }
1206
+
1207
+ //#endregion
1208
+ //#region src/client/components/ui-base/page-nav.tsx
1209
+ /**
1210
+ * Component to display the previous and next page navigation buttons.
1211
+ * Enhanced with subtle entrance animations, modern card layout, and hover highlights.
1212
+ */
1213
+ function PageNav() {
1214
+ const { prevPage, nextPage } = usePageNav();
1215
+ if (!prevPage && !nextPage) return null;
1216
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.PageNav.Root, {
1217
+ className: "pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none",
1218
+ children: [prevPage ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.PageNav.Link, {
1219
+ to: prevPage.path,
1220
+ direction: "prev",
1221
+ className: "group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20",
1222
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.PageNav.Title, {
1223
+ className: "text-xs font-bold uppercase tracking-wider text-muted/60 mb-1",
1224
+ children: "Previous"
1225
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.PageNav.Description, {
1226
+ className: "text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors",
1227
+ children: prevPage.title
1228
+ })]
1229
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {}), nextPage ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.PageNav.Link, {
1230
+ to: nextPage.path,
1231
+ direction: "next",
1232
+ className: "group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20",
1233
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.PageNav.Title, {
1234
+ className: "text-xs font-bold uppercase tracking-wider text-muted/60 mb-1",
1235
+ children: "Next"
1236
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.PageNav.Description, {
1237
+ className: "text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors",
1238
+ children: nextPage.title
1239
+ })]
1240
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {})]
1241
+ });
1242
+ }
1243
+
1244
+ //#endregion
1245
+ //#region src/client/components/ui-base/sidebar.tsx
1246
+ function SidebarMain({ routes, config }) {
1247
+ const { logo, title, logoProps } = useNavbar();
1248
+ const { closeSidebar } = require_docs_layout.useUI();
1249
+ const SidebarLogo = logo ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
1250
+ src: logo,
1251
+ alt: logoProps?.alt || title,
1252
+ width: 24,
1253
+ height: 24,
1254
+ className: "rounded-xl"
1255
+ }) : null;
1256
+ const hasUtilities = config.versions || config.i18n;
1257
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Sidebar.Root, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Sidebar.Content, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Sidebar.Items, { routes }) }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Sidebar.Mobile, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Sidebar.Header, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1258
+ className: "flex items-center gap-3",
1259
+ children: [SidebarLogo, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1260
+ className: "font-bold text-lg tracking-tight text-body truncate max-w-[120px]",
1261
+ children: title
1262
+ })]
1263
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1264
+ className: "flex items-center gap-2",
1265
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeSwitcher, { className: "w-24 h-9 rounded-xl" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog.Button, {
1266
+ onPress: closeSidebar,
1267
+ className: "h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors",
1268
+ "aria-label": "Close sidebar",
1269
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.X, { size: 20 })
1270
+ })]
1271
+ })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.Sidebar.Content, { children: [hasUtilities && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1272
+ className: "flex flex-col gap-4 mb-10",
1273
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1274
+ className: "flex gap-3",
1275
+ children: [config.versions && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VersionSelector, { className: "flex-1 justify-between h-10 bg-surface border-subtle rounded-xl" }), config.i18n && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(I18nSelector, { className: "flex-1 justify-between h-10 bg-surface border-subtle rounded-xl" })]
1276
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "mt-2 border-b border-subtle" })]
1277
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.Sidebar.Items, { routes })] })] })] });
1278
+ }
1279
+ const Sidebar = Object.assign(SidebarMain, {
1280
+ Root: require_docs_layout.Sidebar.Root,
1281
+ Mobile: require_docs_layout.Sidebar.Mobile,
1282
+ Header: require_docs_layout.Sidebar.Header,
1283
+ Content: require_docs_layout.Sidebar.Content,
1284
+ Group: require_docs_layout.Sidebar.Group,
1285
+ Link: require_docs_layout.Sidebar.Link,
1286
+ SubGroup: require_docs_layout.Sidebar.SubGroup,
1287
+ Item: require_docs_layout.Sidebar.Item,
1288
+ Items: require_docs_layout.Sidebar.Items
1289
+ });
1290
+
1291
+ //#endregion
1292
+ //#region src/client/components/ui-base/banner.tsx
1293
+ function Banner({ children, className = "", dismissible = false, id = "boltdocs-banner", ...props }) {
1294
+ const [isVisible, setIsVisible] = (0, react.useState)(true);
1295
+ (0, react.useEffect)(() => {
1296
+ if (dismissible && id) {
1297
+ if (localStorage.getItem(`boltdocs-banner-dismissed-${id}`) === "true") setIsVisible(false);
1298
+ }
1299
+ }, [dismissible, id]);
1300
+ const handleDismiss = () => {
1301
+ setIsVisible(false);
1302
+ if (dismissible && id) localStorage.setItem(`boltdocs-banner-dismissed-${id}`, "true");
1303
+ };
1304
+ if (!isVisible) return null;
1305
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1306
+ className: require_icons_dev.cn("relative flex items-center justify-center px-4 py-2.5 text-xs font-semibold tracking-wide bg-primary-500/10 dark:bg-primary-500/15 text-primary-700 dark:text-primary-300 border-b border-primary-500/20 select-none animate-in fade-in duration-300", className),
1307
+ ...props,
1308
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1309
+ className: "flex-1 text-center flex items-center justify-center gap-2",
1310
+ children
1311
+ }), dismissible && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1312
+ onClick: handleDismiss,
1313
+ className: "absolute right-3 top-1/2 -translate-y-1/2 p-1.5 opacity-70 hover:opacity-100 transition-all duration-300 rounded-xl hover:bg-primary-500/10 cursor-pointer border-none bg-transparent flex items-center justify-center outline-none",
1314
+ "aria-label": "Dismiss banner",
1315
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icons_dev.X, { className: "w-3.5 h-3.5" })
1316
+ })]
1317
+ });
1318
+ }
1319
+
1320
+ //#endregion
1321
+ //#region src/client/ssg/mdx-elements.tsx
1322
+ const Loading = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1323
+ className: "text-muted text-sm py-4",
1324
+ children: "Loading..."
1325
+ });
1326
+ function resolveModuleLoader(loader) {
1327
+ return typeof loader === "function" ? loader() : Promise.resolve(loader);
1328
+ }
1329
+ const EagerMdxElement = ({ moduleLoader, moduleKey, route, components, collectionPostComponent }) => {
1330
+ const [mod, setMod] = (0, react.useState)(moduleLoader);
1331
+ (0, react.useEffect)(() => {
1332
+ setMod(moduleLoader);
1333
+ }, [moduleLoader]);
1334
+ (0, react.useEffect)(() => {
1335
+ if (!{}.hot || !moduleKey) return;
1336
+ const handler = (data) => {
1337
+ if (data.relPath.replace(/\\/g, "/").replace(/^\//, "") !== route.filePath.replace(/\\/g, "/").replace(/^\//, "")) return;
1338
+ import(moduleKey + "?t=" + Date.now()).then((m) => {
1339
+ setMod(m);
1340
+ });
1341
+ };
1342
+ ({}).hot.on("boltdocs:mdx-update", handler);
1343
+ return () => ({}).hot?.off("boltdocs:mdx-update", handler);
1344
+ }, [moduleKey, route.filePath]);
1345
+ const MDXComponent = mod?.default ?? mod ?? null;
1346
+ if (!MDXComponent) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Loading, {});
1347
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MdxPage, {
1348
+ MDXComponent,
1349
+ mdxComponents: components,
1350
+ collectionPostComponent
1351
+ });
1352
+ };
1353
+ const NotFoundWrapper = () => {
1354
+ const components = useMdxComponents();
1355
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(components.NotFound || components["404"] || NotFound, {});
1356
+ };
1357
+
1358
+ //#endregion
1359
+ //#region src/client/app/head.tsx
1360
+ function Head({ siteTitle, siteDescription, routes }) {
1361
+ const location = (0, react_router_dom.useLocation)();
1362
+ const config = require_icons_dev.useConfig();
1363
+ const { currentLocale } = require_icons_dev.useRoutes();
1364
+ const currentRoute = (0, react.useMemo)(() => routes?.find?.((r) => r.path === location.pathname), [routes, location.pathname]);
1365
+ const pageTitle = currentRoute?.title;
1366
+ const translatedSiteDescription = getTranslated(siteDescription, currentLocale);
1367
+ const pageDescription = currentRoute?.description || translatedSiteDescription || "";
1368
+ const translatedSiteTitle = getTranslated(siteTitle, currentLocale);
1369
+ const finalTitle = pageTitle ? `${pageTitle} | ${translatedSiteTitle}` : translatedSiteTitle;
1370
+ const seo = currentRoute?.seo || {};
1371
+ const canonicalUrl = seo.canonical || (config?.siteUrl && currentRoute?.path ? `${config.siteUrl.replace(/\/$/, "")}${currentRoute.path}` : void 0);
1372
+ const ogUrl = seo["og:url"] || canonicalUrl || (typeof window !== "undefined" ? window.location.href : void 0);
1373
+ const globalMetatags = config?.seo?.metatags || {};
1374
+ const defaultOgImage = config?.seo?.thumbnails?.background;
1375
+ const ogImage = seo["og:image"] || defaultOgImage;
1376
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Helmet, { children: [
1377
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("title", { children: finalTitle }),
1378
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1379
+ name: "description",
1380
+ content: pageDescription
1381
+ }),
1382
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1383
+ property: "og:title",
1384
+ content: finalTitle
1385
+ }),
1386
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1387
+ property: "og:description",
1388
+ content: pageDescription
1389
+ }),
1390
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1391
+ property: "og:type",
1392
+ content: "article"
1393
+ }),
1394
+ canonicalUrl && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("link", {
1395
+ rel: "canonical",
1396
+ href: canonicalUrl
1397
+ }),
1398
+ ogUrl && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1399
+ property: "og:url",
1400
+ content: ogUrl
1401
+ }),
1402
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1403
+ name: "twitter:card",
1404
+ content: "summary"
1405
+ }),
1406
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1407
+ name: "twitter:title",
1408
+ content: finalTitle
1409
+ }),
1410
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1411
+ name: "twitter:description",
1412
+ content: pageDescription
1413
+ }),
1414
+ ogImage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1415
+ name: "twitter:image",
1416
+ content: ogImage
1417
+ }),
1418
+ ogImage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1419
+ property: "og:image",
1420
+ content: ogImage
1421
+ }),
1422
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1423
+ name: "generator",
1424
+ content: "Boltdocs"
1425
+ }),
1426
+ Object.entries(globalMetatags).map(([key, value]) => {
1427
+ return key.startsWith("og:") || key.startsWith("music:") || key.startsWith("video:") || key.startsWith("article:") || key.startsWith("book:") || key.startsWith("profile:") ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1428
+ property: key,
1429
+ content: value
1430
+ }, key) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1431
+ name: key,
1432
+ content: value
1433
+ }, key);
1434
+ }),
1435
+ Object.entries(seo).map(([key, value]) => {
1436
+ if (key === "noindex" && value === true) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1437
+ name: "robots",
1438
+ content: "noindex"
1439
+ }, "noindex");
1440
+ if (key === "robots") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1441
+ name: "robots",
1442
+ content: value
1443
+ }, "robots");
1444
+ if (key === "canonical" || key === "og:url") return null;
1445
+ return key.startsWith("og:") || key.startsWith("music:") || key.startsWith("video:") || key.startsWith("article:") || key.startsWith("book:") || key.startsWith("profile:") ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1446
+ property: key,
1447
+ content: value
1448
+ }, key) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("meta", {
1449
+ name: key,
1450
+ content: value
1451
+ }, key);
1452
+ })
1453
+ ] });
1454
+ }
1455
+
1456
+ //#endregion
1457
+ //#region src/client/collections/collections-context.tsx
1458
+ const CollectionsContext = (0, react.createContext)({});
1459
+ function useCollectionsData() {
1460
+ return (0, react.use)(CollectionsContext);
1461
+ }
1462
+
1463
+ //#endregion
1464
+ //#region src/client/app/docs-layout.tsx
1465
+ function DocsLayout({ collectionsData }) {
1466
+ const config = require_icons_dev.useConfig();
1467
+ const { currentRoute, allRoutes } = require_icons_dev.useRoutes();
1468
+ const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Head, {
1469
+ siteTitle: config.theme?.title,
1470
+ siteDescription: config.theme?.description,
1471
+ routes: allRoutes || []
1472
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_search_dialog$1.InternalErrorBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(virtual_boltdocs_layout.default, {
1473
+ route: currentRoute,
1474
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.Outlet, {})
1475
+ }) })] });
1476
+ if (collectionsData) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollectionsContext.Provider, {
1477
+ value: collectionsData,
1478
+ children: content
1479
+ });
1480
+ return content;
1481
+ }
1482
+
1483
+ //#endregion
1484
+ //#region src/client/ssg/create-routes.utils.ts
1485
+ function withBase(path, config) {
1486
+ const base = config.base || "/";
1487
+ if (path.startsWith(base)) return path;
1488
+ return `${base === "/" ? "" : base.replace(/\/$/, "")}${path.startsWith("/") ? path : `/${path}`}` || "/";
1489
+ }
1490
+ function buildModuleMap(mdxModules) {
1491
+ const moduleMap = /* @__PURE__ */ new Map();
1492
+ const mdxModuleKeys = Object.keys(mdxModules);
1493
+ if (mdxModuleKeys.length > 0) {
1494
+ const docsDirName = mdxModuleKeys[0].replace(/\\/g, "/").split("/").filter(Boolean)[0] || "docs";
1495
+ const primaryPrefix = `/${docsDirName}/`;
1496
+ const altPrefix = `./${docsDirName}/`;
1497
+ for (const rawKey of mdxModuleKeys) {
1498
+ const k = rawKey.replace(/\\/g, "/");
1499
+ let relativePath = "";
1500
+ if (k.indexOf(primaryPrefix) !== -1) relativePath = k.substring(k.indexOf(primaryPrefix) + primaryPrefix.length);
1501
+ else if (k.startsWith(altPrefix)) relativePath = k.substring(altPrefix.length);
1502
+ if (relativePath) moduleMap.set(relativePath, rawKey);
1503
+ else moduleMap.set(k, rawKey);
1504
+ }
1505
+ }
1506
+ return moduleMap;
1507
+ }
1508
+
1509
+ //#endregion
1510
+ //#region src/client/ssg/create-routes.doc.tsx
1511
+ function buildDocRoutes(options) {
1512
+ const { routesData, config, mdxModules, components, externalPages } = options;
1513
+ const baseDocsPath = (config.base || "/docs").replace(/\/$/, "") || "/";
1514
+ const defaultVersionMetadata = [];
1515
+ const defaultVersion = config.versions?.defaultVersion;
1516
+ const docsBase = (config.base || "/docs").replace(/\/$/, "");
1517
+ if (defaultVersion) routesData.filter((r) => !r.collection).forEach((route) => {
1518
+ if (route.version) return;
1519
+ const p = route.path || "";
1520
+ const subPath = p.startsWith(docsBase) ? p.substring(docsBase.length).replace(/^\//, "") : p.replace(/^\//, "");
1521
+ if (!(subPath === defaultVersion || subPath.startsWith(`${defaultVersion}/`))) {
1522
+ const explicitPath = `${docsBase}/${defaultVersion}/${subPath}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
1523
+ defaultVersionMetadata.push({
1524
+ ...route,
1525
+ path: explicitPath,
1526
+ version: defaultVersion
1527
+ });
1528
+ }
1529
+ });
1530
+ const docMetadata = [...routesData.filter((r) => !r.collection), ...defaultVersionMetadata];
1531
+ const moduleMap = buildModuleMap(mdxModules);
1532
+ const mdxModuleKeys = Object.keys(mdxModules);
1533
+ const isLazy = mdxModuleKeys.length > 0 && typeof mdxModules[mdxModuleKeys[0]] === "function";
1534
+ const docRoutes = docMetadata.map((route) => {
1535
+ const normalizedFilePath = route.filePath.replace(/\\/g, "/");
1536
+ const moduleKey = moduleMap.get(normalizedFilePath);
1537
+ const moduleLoader = moduleKey ? mdxModules[moduleKey] : null;
1538
+ const fullPath = withBase(route.path === "" ? "/" : route.path, config);
1539
+ const path = fullPath === baseDocsPath ? "." : fullPath.startsWith(baseDocsPath + "/") ? fullPath.slice(baseDocsPath.length + 1) : fullPath;
1540
+ const routeRecord = {
1541
+ path,
1542
+ loader: async () => ({
1543
+ path,
1544
+ frontmatter: {
1545
+ title: route.title,
1546
+ description: route.description || "",
1547
+ ...route.frontmatter || {}
1548
+ },
1549
+ seo: route.seo,
1550
+ headings: route.headings || [],
1551
+ filePath: route.filePath,
1552
+ locale: route.locale,
1553
+ version: route.version,
1554
+ group: route.group,
1555
+ groupTitle: route.groupTitle,
1556
+ date: route.date,
1557
+ lastUpdated: route.lastUpdated
1558
+ }),
1559
+ getStaticPaths: () => [path]
1560
+ };
1561
+ if (isLazy && moduleLoader) routeRecord.lazy = async () => {
1562
+ const mod = await resolveModuleLoader(moduleLoader);
1563
+ return { Component: function LoadedMdxRoute() {
1564
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EagerMdxElement, {
1565
+ moduleKey,
1566
+ moduleLoader: mod,
1567
+ route,
1568
+ components
1569
+ }, moduleKey || path);
1570
+ } };
1571
+ };
1572
+ else routeRecord.element = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EagerMdxElement, {
1573
+ moduleKey,
1574
+ moduleLoader,
1575
+ route,
1576
+ components
1577
+ }, moduleKey || path);
1578
+ return routeRecord;
1579
+ });
1580
+ const locales = config.i18n?.locales ? Array.isArray(config.i18n.locales) ? config.i18n.locales : Object.keys(config.i18n.locales) : [];
1581
+ const allVersions = config.versions?.versions?.map((v) => v.path) || [];
1582
+ const targetBasePaths = [];
1583
+ targetBasePaths.push({
1584
+ path: baseDocsPath,
1585
+ filter: () => true
1586
+ });
1587
+ const subPaths = [];
1588
+ if (allVersions.length > 0) allVersions.forEach((v) => subPaths.push(`/${v}`));
1589
+ if (locales.length > 0) locales.forEach((l) => subPaths.push(`/${l}`));
1590
+ if (allVersions.length > 0 && locales.length > 0) allVersions.forEach((v) => {
1591
+ locales.forEach((l) => {
1592
+ subPaths.push(`/${v}/${l}`);
1593
+ });
1594
+ });
1595
+ subPaths.forEach((sp) => {
1596
+ const fullP = baseDocsPath === "/" ? sp : `${baseDocsPath}${sp}`;
1597
+ targetBasePaths.push({
1598
+ path: fullP,
1599
+ filter: (rp) => rp.startsWith(fullP.replace(/\/$/, "") + "/")
1600
+ });
1601
+ });
1602
+ const docPathRegistry = new Set(docRoutes.map((r) => (r.path || "").replace(/\/$/, "")));
1603
+ const externalPaths = /* @__PURE__ */ new Set();
1604
+ if (externalPages) Object.keys(externalPages).forEach((rawPath) => {
1605
+ const p = rawPath.startsWith("/") ? rawPath : `/${rawPath}`;
1606
+ externalPaths.add(p.replace(/\/$/, ""));
1607
+ if (config.i18n) Object.keys(config.i18n.locales).forEach((locale) => {
1608
+ externalPaths.add(`/${locale}${p === "/" ? "" : p}`.replace(/\/$/, ""));
1609
+ });
1610
+ });
1611
+ targetBasePaths.forEach(({ path: bPath, filter }) => {
1612
+ if (bPath === "/") return;
1613
+ const normalizedPath = bPath.replace(/\/$/, "");
1614
+ if (!(docPathRegistry.has(normalizedPath) || externalPaths.has(normalizedPath))) {
1615
+ const defaultTab = config.theme?.tabs?.[0]?.id;
1616
+ const defaultTabPath = defaultTab ? `${normalizedPath}/${defaultTab}`.replace(/\/+/g, "/") : null;
1617
+ let matchedRouteObj = defaultTabPath && docPathRegistry.has(defaultTabPath.replace(/\/$/, "")) ? docRoutes.find((r) => r.path.replace(/\/$/, "") === defaultTabPath.replace(/\/$/, "")) : docRoutes.find((r) => filter(r.path) && r.path !== normalizedPath);
1618
+ if (!matchedRouteObj && docRoutes.length > 0) matchedRouteObj = docRoutes[0];
1619
+ if (matchedRouteObj) {
1620
+ const redirectPath = bPath === baseDocsPath ? "." : bPath.startsWith(baseDocsPath + "/") ? bPath.slice(baseDocsPath.length + 1) : bPath;
1621
+ const isBasePathFallback = redirectPath === ".";
1622
+ docRoutes.push({
1623
+ ...isBasePathFallback ? { index: true } : { path: redirectPath },
1624
+ element: matchedRouteObj.element,
1625
+ loader: matchedRouteObj.loader,
1626
+ getStaticPaths: () => []
1627
+ });
1628
+ const matchedMetaObj = docMetadata.find((m) => {
1629
+ const fullPath = withBase(m.path === "" ? "/" : m.path, config);
1630
+ return (fullPath === baseDocsPath ? "." : fullPath.startsWith(baseDocsPath + "/") ? fullPath.slice(baseDocsPath.length + 1) : fullPath) === matchedRouteObj.path;
1631
+ });
1632
+ if (matchedMetaObj) {
1633
+ const canonicalPath = withBase(matchedMetaObj.path, config);
1634
+ const canonicalUrl = config.siteUrl ? `${config.siteUrl.replace(/\/$/, "")}${canonicalPath}` : canonicalPath;
1635
+ docMetadata.push({
1636
+ ...matchedMetaObj,
1637
+ path: bPath,
1638
+ filePath: "",
1639
+ slugParts: [],
1640
+ seo: {
1641
+ ...matchedMetaObj.seo,
1642
+ canonical: canonicalUrl
1643
+ }
1644
+ });
1645
+ }
1646
+ }
1647
+ }
1648
+ });
1649
+ return {
1650
+ routes: docRoutes,
1651
+ metadata: docMetadata
1652
+ };
1653
+ }
1654
+
1655
+ //#endregion
1656
+ //#region src/client/ssg/create-routes.external.tsx
1657
+ function buildExternalRoutes(options) {
1658
+ const { externalPages, externalLayout, config } = options;
1659
+ const children = [];
1660
+ const metadata = [];
1661
+ if (!externalPages) return {
1662
+ children,
1663
+ metadata
1664
+ };
1665
+ const EffectiveExternalLayout = externalLayout || (({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children }));
1666
+ Object.entries(externalPages).forEach(([rawPath, ExtComponent]) => {
1667
+ const path = rawPath.startsWith("/") ? rawPath : `/${rawPath}`;
1668
+ metadata.push({
1669
+ path,
1670
+ locale: config.i18n?.defaultLocale,
1671
+ title: rawPath === "/" ? "Home" : rawPath.replace(/^\//, "").split("/").pop() || "Page",
1672
+ filePath: "",
1673
+ headings: []
1674
+ });
1675
+ children.push({
1676
+ path,
1677
+ element: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EffectiveExternalLayout, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExtComponent, {}) }),
1678
+ loader: async () => ({
1679
+ path,
1680
+ locale: config.i18n?.defaultLocale
1681
+ }),
1682
+ getStaticPaths: () => [path]
1683
+ });
1684
+ if (config.i18n) Object.keys(config.i18n.locales).forEach((locale) => {
1685
+ const localePath = `/${locale}${rawPath === "/" ? "" : rawPath}`;
1686
+ metadata.push({
1687
+ path: localePath,
1688
+ locale,
1689
+ title: rawPath,
1690
+ filePath: "",
1691
+ headings: []
1692
+ });
1693
+ children.push({
1694
+ path: localePath,
1695
+ element: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EffectiveExternalLayout, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExtComponent, {}) }),
1696
+ loader: async () => ({
1697
+ path: localePath,
1698
+ locale
1699
+ }),
1700
+ getStaticPaths: () => [localePath]
1701
+ });
1702
+ });
1703
+ });
1704
+ return {
1705
+ children,
1706
+ metadata
1707
+ };
1708
+ }
1709
+
1710
+ //#endregion
1711
+ //#region src/client/ssg/create-routes.collection.tsx
1712
+ function DefaultCollectionList() {
1713
+ const data = (0, react_router_dom.useLoaderData)();
1714
+ if (!data || !data.posts) return null;
1715
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1716
+ className: "py-8 max-w-2xl mx-auto px-4",
1717
+ children: [
1718
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
1719
+ className: "text-3xl font-bold mb-6 capitalize",
1720
+ children: data.collection
1721
+ }),
1722
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1723
+ className: "space-y-6",
1724
+ children: data.posts.map((post) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
1725
+ className: "border-b border-subtle pb-4",
1726
+ children: [
1727
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
1728
+ className: "text-xl font-semibold mb-2",
1729
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.Link, {
1730
+ to: post.path,
1731
+ className: "text-primary-600 hover:underline",
1732
+ children: post.title
1733
+ })
1734
+ }),
1735
+ post.date && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", {
1736
+ className: "text-xs text-muted block mb-2",
1737
+ children: new Date(post.date).toLocaleDateString()
1738
+ }),
1739
+ post.excerpt && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1740
+ className: "text-sm text-body",
1741
+ children: post.excerpt
1742
+ })
1743
+ ]
1744
+ }, post.path))
1745
+ }),
1746
+ data.totalPages > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1747
+ className: "mt-8 flex gap-4 text-sm",
1748
+ children: [
1749
+ data.currentPage > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.Link, {
1750
+ to: data.currentPage === 2 ? `/${data.collection}` : `/${data.collection}/page/${data.currentPage - 1}`,
1751
+ className: "text-primary-600 hover:underline",
1752
+ children: "Previous"
1753
+ }),
1754
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
1755
+ "Page ",
1756
+ data.currentPage,
1757
+ " of ",
1758
+ data.totalPages
1759
+ ] }),
1760
+ data.currentPage < data.totalPages && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_router_dom.Link, {
1761
+ to: `/${data.collection}/page/${data.currentPage + 1}`,
1762
+ className: "text-primary-600 hover:underline",
1763
+ children: "Next"
1764
+ })
1765
+ ]
1766
+ })
1767
+ ]
1768
+ });
1769
+ }
1770
+ function buildCollectionRoutes(options) {
1771
+ const { routesData, collectionsData, collectionLayouts, collectionLists, collectionPosts, config, mdxModules, components } = options;
1772
+ const postsPerPage = options.postsPerPage ?? config.collections?.postsPerPage ?? 10;
1773
+ const children = [];
1774
+ const metadata = [];
1775
+ const collectionsMap = /* @__PURE__ */ new Map();
1776
+ for (const r of routesData) if (r.collection) {
1777
+ if (!collectionsMap.has(r.collection)) collectionsMap.set(r.collection, []);
1778
+ collectionsMap.get(r.collection).push(r);
1779
+ }
1780
+ const moduleMap = buildModuleMap(mdxModules);
1781
+ const mdxModuleKeys = Object.keys(mdxModules);
1782
+ const isLazy = mdxModuleKeys.length > 0 && typeof mdxModules[mdxModuleKeys[0]] === "function";
1783
+ for (const [colName, colRoutes] of collectionsMap) {
1784
+ const colBase = `/${colName}`;
1785
+ colRoutes.sort((a, b) => {
1786
+ const da = a.date ? new Date(a.date).getTime() : 0;
1787
+ return (b.date ? new Date(b.date).getTime() : 0) - da;
1788
+ });
1789
+ const colChildren = [];
1790
+ for (const route of colRoutes) {
1791
+ const normalizedFilePath = route.filePath.replace(/\\/g, "/");
1792
+ const moduleKey = moduleMap.get(normalizedFilePath);
1793
+ const moduleLoader = moduleKey ? mdxModules[moduleKey] : null;
1794
+ const subPath = route.path.startsWith(colBase + "/") ? route.path.slice(colBase.length + 1) : route.path.replace(colBase, "") || "";
1795
+ const routeWithCollection = {
1796
+ ...route,
1797
+ collection: colName
1798
+ };
1799
+ const postComponent = collectionPosts?.[colName];
1800
+ const routeRecord = {
1801
+ path: subPath,
1802
+ loader: async () => ({
1803
+ route: routeWithCollection,
1804
+ headings: route.headings || [],
1805
+ collection: colName,
1806
+ path: subPath,
1807
+ frontmatter: {
1808
+ title: route.title,
1809
+ description: route.description || "",
1810
+ ...route.frontmatter || {}
1811
+ },
1812
+ filePath: route.filePath,
1813
+ locale: route.locale,
1814
+ version: route.version,
1815
+ date: route.date,
1816
+ lastUpdated: route.lastUpdated
1817
+ }),
1818
+ getStaticPaths: () => [subPath || "."]
1819
+ };
1820
+ if (isLazy && moduleLoader) routeRecord.lazy = async () => {
1821
+ const mod = await resolveModuleLoader(moduleLoader);
1822
+ return { Component: function LoadedCollectionMdxRoute() {
1823
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EagerMdxElement, {
1824
+ moduleKey,
1825
+ moduleLoader: mod,
1826
+ route,
1827
+ components,
1828
+ collectionPostComponent: postComponent
1829
+ }, moduleKey || subPath);
1830
+ } };
1831
+ };
1832
+ else routeRecord.element = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EagerMdxElement, {
1833
+ moduleKey,
1834
+ moduleLoader,
1835
+ route,
1836
+ components,
1837
+ collectionPostComponent: postComponent
1838
+ }, moduleKey || subPath);
1839
+ colChildren.push(routeRecord);
1840
+ metadata.push(route);
1841
+ }
1842
+ const totalPages = Math.ceil(colRoutes.length / postsPerPage);
1843
+ const paginatedPosts = colRoutes.map((r) => ({
1844
+ path: r.path,
1845
+ title: r.title,
1846
+ date: r.date,
1847
+ excerpt: r.excerpt,
1848
+ tags: r.tags,
1849
+ author: r.author,
1850
+ coverImage: r.coverImage,
1851
+ filePath: r.filePath,
1852
+ frontmatter: r.frontmatter
1853
+ }));
1854
+ const ListElement = collectionLists?.[colName] || DefaultCollectionList;
1855
+ colChildren.unshift({
1856
+ index: true,
1857
+ element: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ListElement, {}),
1858
+ loader: async () => ({
1859
+ posts: paginatedPosts.slice(0, postsPerPage),
1860
+ totalPages,
1861
+ currentPage: 1,
1862
+ collection: colName
1863
+ }),
1864
+ getStaticPaths: () => []
1865
+ });
1866
+ for (let p = 2; p <= totalPages; p++) colChildren.push({
1867
+ path: `page/${p}`,
1868
+ element: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ListElement, {}),
1869
+ loader: async () => ({
1870
+ posts: paginatedPosts.slice((p - 1) * postsPerPage, p * postsPerPage),
1871
+ totalPages,
1872
+ currentPage: p,
1873
+ collection: colName
1874
+ }),
1875
+ getStaticPaths: () => [`page/${p}`]
1876
+ });
1877
+ const blogLayoutRoute = {
1878
+ path: colBase,
1879
+ element: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(collectionLayouts?.[colName] || DocsLayout, { collectionsData: collectionsData || {} }),
1880
+ children: colChildren
1881
+ };
1882
+ children.push(blogLayoutRoute);
1883
+ }
1884
+ return {
1885
+ children,
1886
+ metadata
1887
+ };
1888
+ }
1889
+
1890
+ //#endregion
1891
+ //#region src/client/ssg/create-routes.tsx
1892
+ function createRoutes(options) {
1893
+ const { config, components, externalLayout } = options;
1894
+ const EffectiveExternalLayout = externalLayout || (({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children }));
1895
+ const baseDocsPath = (config.base || "/docs").replace(/\/$/, "") || "/";
1896
+ const { routes: docRoutes, metadata: docMetadata } = buildDocRoutes(options);
1897
+ const externalRoutes = buildExternalRoutes(options);
1898
+ const collectionRoutes = buildCollectionRoutes(options);
1899
+ const children = [
1900
+ {
1901
+ path: baseDocsPath,
1902
+ element: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DocsLayout, {}),
1903
+ children: docRoutes
1904
+ },
1905
+ ...externalRoutes.children,
1906
+ ...collectionRoutes.children,
1907
+ {
1908
+ path: "*",
1909
+ element: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EffectiveExternalLayout, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NotFoundWrapper, {}) })
1910
+ }
1911
+ ];
1912
+ return [{
1913
+ element: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BoltdocsShell, {
1914
+ config,
1915
+ routes: [
1916
+ ...docMetadata,
1917
+ ...externalRoutes.metadata,
1918
+ ...collectionRoutes.metadata
1919
+ ],
1920
+ components
1921
+ }),
1922
+ children
1923
+ }];
1924
+ }
1925
+
1926
+ //#endregion
1927
+ //#region src/client/hooks/use-analytics.ts
1928
+ function createAnalyticsInstance(config) {
1929
+ if (typeof window === "undefined") return createDisabledAnalytics();
1930
+ if (typeof window.gtag === "function") return createGtagAnalytics(config);
1931
+ if (window.dataLayer) return createDataLayerAnalytics(config);
1932
+ return createDisabledAnalytics();
1933
+ }
1934
+ function createGtagAnalytics(config) {
1935
+ return {
1936
+ trackPageView: (path, title) => {
1937
+ window.gtag?.("event", "page_view", {
1938
+ page_path: path,
1939
+ page_title: title || document.title,
1940
+ send_to: config?.ga4?.measurementId
1941
+ });
1942
+ },
1943
+ trackEvent: ({ action, category, label, value, params }) => {
1944
+ window.gtag?.("event", action, {
1945
+ event_category: category,
1946
+ event_label: label,
1947
+ value,
1948
+ send_to: config?.ga4?.measurementId,
1949
+ ...params
1950
+ });
1951
+ },
1952
+ trackSearch: (query, resultsCount) => {
1953
+ window.gtag?.("event", "search", {
1954
+ search_term: query,
1955
+ results_count: resultsCount,
1956
+ send_to: config?.ga4?.measurementId
1957
+ });
1958
+ },
1959
+ trackDownload: (file, type) => {
1960
+ window.gtag?.("event", "file_download", {
1961
+ file_name: file,
1962
+ file_type: type || file.split(".").pop(),
1963
+ send_to: config?.ga4?.measurementId
1964
+ });
1965
+ },
1966
+ trackExternalLink: (url) => {
1967
+ window.gtag?.("event", "external_link", {
1968
+ link_url: url,
1969
+ send_to: config?.ga4?.measurementId
1970
+ });
1971
+ },
1972
+ isEnabled: true
1973
+ };
1974
+ }
1975
+ function createDataLayerAnalytics(config) {
1976
+ return {
1977
+ trackPageView: (path, title) => {
1978
+ window.dataLayer?.push({
1979
+ event: "page_view",
1980
+ page_path: path,
1981
+ page_title: title || document.title,
1982
+ send_to: config?.gtm?.tagId
1983
+ });
1984
+ },
1985
+ trackEvent: ({ action, category, label, value, params }) => {
1986
+ window.dataLayer?.push({
1987
+ event: action,
1988
+ event_category: category,
1989
+ event_label: label,
1990
+ value,
1991
+ send_to: config?.gtm?.tagId,
1992
+ ...params
1993
+ });
1994
+ },
1995
+ trackSearch: (query, resultsCount) => {
1996
+ window.dataLayer?.push({
1997
+ event: "search",
1998
+ search_term: query,
1999
+ results_count: resultsCount,
2000
+ send_to: config?.gtm?.tagId
2001
+ });
2002
+ },
2003
+ trackDownload: (file, type) => {
2004
+ window.dataLayer?.push({
2005
+ event: "file_download",
2006
+ file_name: file,
2007
+ file_type: type || file.split(".").pop(),
2008
+ send_to: config?.gtm?.tagId
2009
+ });
2010
+ },
2011
+ trackExternalLink: (url) => {
2012
+ window.dataLayer?.push({
2013
+ event: "external_link",
2014
+ link_url: url,
2015
+ send_to: config?.gtm?.tagId
2016
+ });
2017
+ },
2018
+ isEnabled: true
2019
+ };
2020
+ }
2021
+ function createDisabledAnalytics() {
2022
+ return {
2023
+ trackPageView: () => {},
2024
+ trackEvent: () => {},
2025
+ trackSearch: () => {},
2026
+ trackDownload: () => {},
2027
+ trackExternalLink: () => {},
2028
+ isEnabled: false
2029
+ };
2030
+ }
2031
+ const CONFIG_INSTANCE_SYMBOL = Symbol.for("__BDOCS_CONFIG_INSTANCE__");
2032
+ function useAnalytics(options = {}) {
2033
+ const { config: optionsConfig, autoTrackPageViews = true, autoTrackDownloads = true, autoTrackExternalLinks = true, excludePatterns = [] } = options;
2034
+ const globalConfig = typeof globalThis !== "undefined" ? globalThis[CONFIG_INSTANCE_SYMBOL] : void 0;
2035
+ const config = optionsConfig ?? globalConfig?.integrations;
2036
+ const analytics = (0, react.useMemo)(() => createAnalyticsInstance(config), [config]);
2037
+ const previousPath = (0, react.useRef)("");
2038
+ const location = require_docs_layout.useLocation();
2039
+ (0, react.useEffect)(() => {
2040
+ if (!autoTrackPageViews || !analytics.isEnabled) return;
2041
+ const path = location.pathname + location.search;
2042
+ if (path !== previousPath.current) {
2043
+ previousPath.current = path;
2044
+ analytics.trackPageView(path, document.title);
2045
+ }
2046
+ }, [
2047
+ location.pathname,
2048
+ autoTrackPageViews,
2049
+ analytics
2050
+ ]);
2051
+ (0, react.useEffect)(() => {
2052
+ if (!autoTrackDownloads || !analytics.isEnabled) return;
2053
+ const handleClick = (event) => {
2054
+ const target = event.target?.closest("a");
2055
+ if (!target) return;
2056
+ const href = target.getAttribute("href");
2057
+ if (!href) return;
2058
+ if (excludePatterns.some((pattern) => pattern.test(href))) return;
2059
+ if (target.hasAttribute("download") || /\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(href)) {
2060
+ const fileName = href.split("/").pop() || href;
2061
+ analytics.trackDownload(fileName, fileName.split(".").pop());
2062
+ }
2063
+ };
2064
+ document.addEventListener("click", handleClick);
2065
+ return () => document.removeEventListener("click", handleClick);
2066
+ }, [
2067
+ autoTrackDownloads,
2068
+ autoTrackExternalLinks,
2069
+ analytics,
2070
+ excludePatterns
2071
+ ]);
2072
+ (0, react.useEffect)(() => {
2073
+ if (!autoTrackExternalLinks || !analytics.isEnabled) return;
2074
+ const handleClick = (event) => {
2075
+ const target = event.target?.closest("a");
2076
+ if (!target) return;
2077
+ const href = target.getAttribute("href");
2078
+ if (!href) return;
2079
+ if (excludePatterns.some((pattern) => pattern.test(href))) return;
2080
+ if ((href.startsWith("http://") || href.startsWith("https://") || href.startsWith("//")) && !href.includes(window.location.hostname)) analytics.trackExternalLink(href);
2081
+ };
2082
+ document.addEventListener("click", handleClick);
2083
+ return () => document.removeEventListener("click", handleClick);
2084
+ }, [
2085
+ autoTrackExternalLinks,
2086
+ analytics,
2087
+ excludePatterns
2088
+ ]);
2089
+ return analytics;
2090
+ }
2091
+ function useTrackPageView() {
2092
+ const analytics = (0, react.useMemo)(() => createAnalyticsInstance(), []);
2093
+ return (0, react.useCallback)((path, title) => {
2094
+ analytics.trackPageView(path, title);
2095
+ }, [analytics]);
2096
+ }
2097
+ function useTrackEvent() {
2098
+ const analytics = (0, react.useMemo)(() => createAnalyticsInstance(), []);
2099
+ return (0, react.useCallback)((event) => {
2100
+ analytics.trackEvent(event);
2101
+ }, [analytics]);
2102
+ }
2103
+
2104
+ //#endregion
2105
+ //#region src/client/hooks/use-headings.ts
2106
+ /**
2107
+ * Returns the headings of the current page, extracted from the route loader data.
2108
+ * Useful for building custom Tables of Contents or jumping to sections.
2109
+ *
2110
+ * @returns An array of heading objects with level, text, and id.
2111
+ */
2112
+ function useHeadings() {
2113
+ const matches = (0, react_router_dom.useMatches)();
2114
+ return (0, react.useMemo)(() => {
2115
+ return (matches[matches.length - 1]?.data)?.headings || [];
2116
+ }, [matches]);
2117
+ }
2118
+
2119
+ //#endregion
2120
+ //#region src/client/components/docs-layout-default.tsx
2121
+ function DocsLayoutComponent({ children }) {
2122
+ const { routes: filteredRoutes, currentRoute, isCollectionPage } = require_icons_dev.useRoutes();
2123
+ const config = require_icons_dev.useConfig();
2124
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.DocsLayout, {
2125
+ className: "selection:bg-primary-500/10 selection:text-primary-500",
2126
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Navbar, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.DocsLayout.Body, {
2127
+ className: "bg-main",
2128
+ children: [
2129
+ !isCollectionPage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sidebar, {
2130
+ routes: filteredRoutes || [],
2131
+ config
2132
+ }),
2133
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.DocsLayout.Content, {
2134
+ className: "animate-in fade-in duration-500 scroll-smooth",
2135
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.DocsLayout.ContentMdx, {
2136
+ className: "max-w-3xl sm:max-w-4xl lg:max-w-5xl px-4 sm:px-6 pt-8 pb-24",
2137
+ children: [
2138
+ !isCollectionPage && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_docs_layout.DocsLayout.Header, { children: [
2139
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2140
+ className: "mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3",
2141
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Breadcrumbs, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopyMarkdown, {
2142
+ mdxRaw: currentRoute?._rawContent,
2143
+ route: currentRoute
2144
+ })]
2145
+ }),
2146
+ currentRoute?.title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
2147
+ className: "text-4xl font-bold tracking-tight text-default mb-3",
2148
+ children: currentRoute.title
2149
+ }),
2150
+ currentRoute?.description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2151
+ className: "text-lg text-muted-foreground mb-6 leading-relaxed",
2152
+ children: currentRoute.description
2153
+ })
2154
+ ] }),
2155
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2156
+ className: "prose prose-neutral dark:prose-invert max-w-none",
2157
+ children
2158
+ }) }),
2159
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_docs_layout.DocsLayout.Footer, { children: !isCollectionPage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PageNav, {}) })
2160
+ ]
2161
+ })
2162
+ }),
2163
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OnThisPage, {
2164
+ headings: currentRoute?.headings,
2165
+ editLink: config.theme?.editLink,
2166
+ communityHelp: config.theme?.communityHelp,
2167
+ filePath: currentRoute?.filePath
2168
+ })
2169
+ ]
2170
+ })]
2171
+ });
2172
+ }
2173
+
2174
+ //#endregion
2175
+ //#region src/client/collections/hooks.ts
2176
+ /**
2177
+ * Returns the posts of a collection.
2178
+ * @param collection - The name of the collection.
2179
+ * @returns The posts of the collection.
2180
+ */
2181
+ function usePosts(collection) {
2182
+ return useCollectionsData()[collection] || [];
2183
+ }
2184
+ /**
2185
+ * Returns a post by its slug.
2186
+ * @param collection - The name of the collection.
2187
+ * @param slug - The slug of the post.
2188
+ * @returns The post with the given slug.
2189
+ */
2190
+ function usePost(collection, slug) {
2191
+ const posts = usePosts(collection);
2192
+ return (0, react.useMemo)(() => posts.find((p) => p.path === `/${collection}/${slug}` || p.path.endsWith(`/${slug}`) || p.path === slug), [
2193
+ posts,
2194
+ collection,
2195
+ slug
2196
+ ]);
2197
+ }
2198
+ /**
2199
+ * Returns the recent posts of a collection.
2200
+ * @param collection - The name of the collection.
2201
+ * @param count - The number of recent posts to return.
2202
+ * @returns The recent posts of the collection.
2203
+ */
2204
+ function useRecentPosts(collection, count = 5) {
2205
+ const posts = usePosts(collection);
2206
+ return (0, react.useMemo)(() => posts.slice(0, count), [posts, count]);
2207
+ }
2208
+
2209
+ //#endregion
2210
+ //#region src/client/utils/react-to-text.ts
2211
+ const reactToText = (node, resolvers) => {
2212
+ if (node == null || typeof node === "boolean") return "";
2213
+ if (typeof node === "string" || typeof node === "number") return String(node);
2214
+ if (Array.isArray(node)) return node.map((n) => reactToText(n, resolvers)).join("");
2215
+ if ((0, react.isValidElement)(node)) {
2216
+ const resolver = resolvers?.get(node.type);
2217
+ if (resolver) return resolver(node.props);
2218
+ return reactToText(node.props.children, resolvers);
2219
+ }
2220
+ return "";
2221
+ };
2222
+
2223
+ //#endregion
2224
+ exports.Banner = Banner;
2225
+ exports.BoltdocsShell = BoltdocsShell;
2226
+ exports.Breadcrumbs = Breadcrumbs;
2227
+ exports.CollectionsContext = CollectionsContext;
2228
+ exports.CopyMarkdown = CopyMarkdown;
2229
+ exports.DocsLayout = DocsLayoutComponent;
2230
+ exports.ErrorBoundary = ErrorBoundary;
2231
+ exports.MdxPage = MdxPage;
2232
+ exports.Navbar = Navbar;
2233
+ exports.NotFound = NotFound;
2234
+ exports.OnThisPage = OnThisPage;
2235
+ exports.PageNav = PageNav;
2236
+ exports.SearchDialog = require_search_dialog$1.SearchDialog;
2237
+ exports.Sidebar = Sidebar;
2238
+ Object.defineProperty(exports, 'ViteReactSSG', {
2239
+ enumerable: true,
2240
+ get: function () {
2241
+ return _bdocs_ssg.ViteReactSSG;
2242
+ }
2243
+ });
2244
+ exports.cn = require_icons_dev.cn;
2245
+ exports.copyToClipboard = require_mdx.copyToClipboard;
2246
+ exports.createRoutes = createRoutes;
2247
+ exports.getStarsRepo = getStarsRepo;
2248
+ exports.getTranslated = getTranslated;
2249
+ exports.reactToText = reactToText;
2250
+ exports.useAnalytics = useAnalytics;
2251
+ exports.useBreadcrumbs = useBreadcrumbs;
2252
+ exports.useConfig = require_icons_dev.useConfig;
2253
+ exports.useHeadings = useHeadings;
2254
+ exports.useI18n = useI18n;
2255
+ exports.useLocalizedTo = require_icons_dev.useLocalizedTo;
2256
+ exports.useLocation = require_docs_layout.useLocation;
2257
+ exports.useMdxComponents = useMdxComponents;
2258
+ exports.useMergedComponents = useMergedComponents;
2259
+ exports.useNavbar = useNavbar;
2260
+ exports.usePageNav = usePageNav;
2261
+ exports.usePost = usePost;
2262
+ exports.usePosts = usePosts;
2263
+ exports.useRecentPosts = useRecentPosts;
2264
+ exports.useRoutes = require_icons_dev.useRoutes;
2265
+ exports.useSearch = require_search_dialog$1.useSearch;
2266
+ exports.useSearchHighlight = require_docs_layout.useSearchHighlight;
2267
+ exports.useSidebar = require_docs_layout.useSidebar;
2268
+ exports.useTabs = useTabs;
2269
+ exports.useTheme = require_image.useTheme;
2270
+ exports.useTrackEvent = useTrackEvent;
2271
+ exports.useTrackPageView = useTrackPageView;
2272
+ exports.useUI = require_docs_layout.useUI;
2273
+ exports.useVersion = useVersion;