boltdocs 3.2.1 → 3.3.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 (155) hide show
  1. package/bin/boltdocs.js +20 -1
  2. package/bin/preloader.mjs +28 -0
  3. package/dist/{adapters-ByYY44Zy.mjs → adapters-BmB4TKCc.mjs} +1 -1
  4. package/dist/{adapters-DvmtpdSF.cjs → adapters-Cp1Maurn.cjs} +1 -1
  5. package/dist/audit-CLXjMzwQ.mjs +11 -0
  6. package/dist/audit-COgjnQ5n.cjs +11 -0
  7. package/dist/build-BS2hefiL.cjs +6 -0
  8. package/dist/build-C5mNh9D-.mjs +6 -0
  9. package/dist/cache-CJE9nWLE.cjs +6 -0
  10. package/dist/cache-OY4HzIXl.mjs +6 -0
  11. package/dist/callout-oI_LCbxS.d.ts +71 -0
  12. package/dist/callout-plqx9Dw-.d.cts +71 -0
  13. package/dist/client/index.cjs +1265 -569
  14. package/dist/client/index.d.cts +3 -542
  15. package/dist/client/index.d.ts +3 -542
  16. package/dist/client/index.js +1167 -521
  17. package/dist/client/mdx.cjs +1 -1
  18. package/dist/client/mdx.d.cts +24 -2
  19. package/dist/client/mdx.d.ts +24 -2
  20. package/dist/client/mdx.js +1 -1
  21. package/dist/client/primitives.cjs +14 -4
  22. package/dist/client/primitives.d.cts +281 -38
  23. package/dist/client/primitives.d.ts +281 -38
  24. package/dist/client/primitives.js +5 -5
  25. package/dist/client/router.cjs +49 -0
  26. package/dist/client/router.d.cts +3 -0
  27. package/dist/client/router.d.ts +3 -0
  28. package/dist/client/router.js +8 -0
  29. package/dist/client/theme/reset.css +40 -4
  30. package/dist/{config-BpzaPsJj.d.cts → config-BoRlz0Ca.d.mts} +157 -14
  31. package/dist/{config-xtS0ZkMm.d.mts → config-CTsX_tGM.d.cts} +157 -14
  32. package/dist/config-Ceib-AOH.cjs +7 -0
  33. package/dist/config-DGLQsy7y.mjs +7 -0
  34. package/dist/{package-BcISI5-P.cjs → config-files-BYHDOrKn.mjs} +1 -1
  35. package/dist/config-files-D9cdBMl2.cjs +6 -0
  36. package/dist/config-jJh8WYJI.cjs +6 -0
  37. package/dist/csp-C4LmN1ko.cjs +6 -0
  38. package/dist/csp-D6JEOqKh.mjs +6 -0
  39. package/dist/dev-Ch3hEe5Y.cjs +6 -0
  40. package/dist/dev-QPNxysrd.mjs +6 -0
  41. package/dist/{docs-layout-BdtZ9z6s.js → docs-layout-CbZ7LDRe.js} +504 -249
  42. package/dist/{docs-layout-CFWI15Id.cjs → docs-layout-vzfXed1Q.cjs} +516 -254
  43. package/dist/{doctor-BBtmNJE0.cjs → doctor-B1_YL0Wt.cjs} +1 -1
  44. package/dist/doctor-C7whl4ED.cjs +6 -0
  45. package/dist/doctor-DmQnml2k.mjs +6 -0
  46. package/dist/{generator-COepVWGi.cjs → generator-BlW45ST7.cjs} +5 -3
  47. package/dist/{generator-CcOBN5vI.mjs → generator-BwknNejd.mjs} +5 -3
  48. package/dist/{handler-XX7cLTqe.cjs → handler-CDEoKARD.cjs} +2 -2
  49. package/dist/{handler-DzQae4eA.mjs → handler-D7UyZlPm.mjs} +2 -2
  50. package/dist/{image-Bz87fCla.js → image-B-NDSDuY.js} +129 -11
  51. package/dist/{image-C4TlpMHn.cjs → image-Hnaa2bJd.cjs} +175 -9
  52. package/dist/index-C56bL-A-.d.cts +1344 -0
  53. package/dist/{sidebar-COTaMHR-.d.ts → index-CPUUKzxD.d.cts} +344 -327
  54. package/dist/{sidebar-CrEdJuHX.d.cts → index-Ci4kfOHF.d.ts} +344 -327
  55. package/dist/index-Cu9H6CRa.d.ts +1344 -0
  56. package/dist/link-CgdI6O2o.js +872 -0
  57. package/dist/{link-D1Gjkb-2.cjs → link-vZjmD-es.cjs} +406 -223
  58. package/dist/{mdx-BuO6a1f7.js → mdx-BRT71V5Q.js} +211 -168
  59. package/dist/{mdx-CD-tSjRG.cjs → mdx-D0Absdq5.cjs} +225 -169
  60. package/dist/native-BNCY7PRF.cjs +6 -0
  61. package/dist/native-Di9Fnfrv.mjs +6 -0
  62. package/dist/native-Kre2T5eS.cjs +6 -0
  63. package/dist/node/cache.cjs +1 -1
  64. package/dist/node/cache.d.cts +19 -3
  65. package/dist/node/cache.d.mts +19 -3
  66. package/dist/node/cache.mjs +1 -1
  67. package/dist/node/cli-entry.cjs +1 -9
  68. package/dist/node/cli-entry.mjs +1 -9
  69. package/dist/node/index.cjs +1 -1
  70. package/dist/node/index.d.cts +245 -17
  71. package/dist/node/index.d.mts +246 -18
  72. package/dist/node/index.mjs +1 -1
  73. package/dist/node/mdx/shiki-adapter.cjs +1 -1
  74. package/dist/node/mdx/shiki-adapter.d.cts +24 -3
  75. package/dist/node/mdx/shiki-adapter.d.mts +24 -2
  76. package/dist/node/mdx/shiki-adapter.mjs +1 -1
  77. package/dist/node-Du5UL5wo.mjs +23 -0
  78. package/dist/node-DunuGqyp.cjs +23 -0
  79. package/dist/{package-CCYEAYeA.mjs → package-DA848keM.mjs} +1 -1
  80. package/dist/package-wplzySjz.cjs +6 -0
  81. package/dist/pages-external-BBw8ObVK.mjs +6 -0
  82. package/dist/pages-external-DPiPFxxP.cjs +6 -0
  83. package/dist/parser-BqTOsEUa.cjs +6 -0
  84. package/dist/parser-CGMY2lJ7.mjs +6 -0
  85. package/dist/plugin-BcTzvHAJ.mjs +69 -0
  86. package/dist/plugin-TulVMt1z.cjs +69 -0
  87. package/dist/plugin-context-C-l90hFt.cjs +15 -0
  88. package/dist/plugin-context-wqHNSZum.mjs +15 -0
  89. package/dist/plugin-lifecycle-B1BzSHdn.cjs +6 -0
  90. package/dist/resolve-B7vWOd8R.cjs +6 -0
  91. package/dist/resolve-C2kKnk_5.mjs +6 -0
  92. package/dist/resolve-It1Iug83.cjs +6 -0
  93. package/dist/resolve-YdTrt_FG.mjs +6 -0
  94. package/dist/router-C3kygdRK.cjs +1285 -0
  95. package/dist/router-CZBxMRAH.js +987 -0
  96. package/dist/routes-BL4y79tb.mjs +6 -0
  97. package/dist/routes-C2nPecwu.cjs +6 -0
  98. package/dist/routes-U9L8psZ9.cjs +6 -0
  99. package/dist/{search-dialog-DHqwjJuG.cjs → search-dialog-BCOHQGSt.cjs} +1 -1
  100. package/dist/search-dialog-Bp_P1MPP.js +481 -0
  101. package/dist/{search-dialog-DFnlx8LO.js → search-dialog-BqkzDTq2.js} +107 -57
  102. package/dist/{search-dialog-BRFno7HD.cjs → search-dialog-CIeIUhAn.cjs} +218 -43
  103. package/dist/{search-dialog-D6TvjcuV.js → search-dialog-DtmxmfEu.js} +1 -1
  104. package/dist/{search-dialog-B1NERUNx.cjs → search-dialog-x_qHU8ty.cjs} +107 -58
  105. package/dist/server/index.cjs +1 -1
  106. package/dist/server/index.d.mts +1 -1
  107. package/dist/server/index.mjs +1 -1
  108. package/dist/update-check-BKqmYfwT.cjs +11 -0
  109. package/dist/update-check-QnrVR3q1.mjs +11 -0
  110. package/dist/utils-8lzafE49.mjs +7 -0
  111. package/dist/utils-ej6_SjIZ.cjs +7 -0
  112. package/dist/virtual-modules-Ca5tHk1X.cjs +30 -0
  113. package/dist/virtual-modules-Dlgt1fP0.mjs +30 -0
  114. package/package.json +18 -16
  115. package/src/shared/mdx-path.ts +12 -0
  116. package/src/shared/structured-data.ts +145 -0
  117. package/src/shared/types.ts +220 -16
  118. package/dist/banner-BMop1KLF.d.ts +0 -100
  119. package/dist/banner-CVD0GugR.d.cts +0 -100
  120. package/dist/cache-CO4Dy2uQ.cjs +0 -6
  121. package/dist/cache-Dk53iOo6.mjs +0 -6
  122. package/dist/config-CCXp3aXO.mjs +0 -7
  123. package/dist/config-CMd4XoFq.cjs +0 -6
  124. package/dist/config-DlGoEM9D.cjs +0 -7
  125. package/dist/csp-CRp_3U7a.cjs +0 -6
  126. package/dist/csp-oTC2ygvF.mjs +0 -6
  127. package/dist/doctor-Bv16QSrI.cjs +0 -7
  128. package/dist/doctor-DOAbSaiL.mjs +0 -7
  129. package/dist/headers-Ddwek8K7.mjs +0 -6
  130. package/dist/headers-dg4SDrjY.cjs +0 -6
  131. package/dist/link-2PzgTnaP.js +0 -673
  132. package/dist/meta-loader-C4Hu9RN9.mjs +0 -6
  133. package/dist/meta-loader-Dq1zcFnh.cjs +0 -6
  134. package/dist/node-BXtqM1uH.mjs +0 -6
  135. package/dist/node-BlVk4EVg.cjs +0 -104
  136. package/dist/node-DOf4zhWc.mjs +0 -104
  137. package/dist/node-aD1eisrR.cjs +0 -6
  138. package/dist/pages-external-BYa4JSda.mjs +0 -6
  139. package/dist/pages-external-XkYIs-d5.cjs +0 -6
  140. package/dist/parser-DCiEWkSk.cjs +0 -8
  141. package/dist/parser-qk9FIHJ7.mjs +0 -8
  142. package/dist/plugin-C95kvu6h.mjs +0 -73
  143. package/dist/plugin-DM3u2bVj.cjs +0 -73
  144. package/dist/routes-BW6zsk7Z.mjs +0 -6
  145. package/dist/routes-BgoIB5wb.cjs +0 -6
  146. package/dist/routes-CORVxc02.cjs +0 -6
  147. package/dist/search-dialog-BmxHiKwt.js +0 -312
  148. package/dist/shiki-adapter-CoQ6jyJ4.cjs +0 -6
  149. package/dist/shiki-adapter-D-aKw7PP.mjs +0 -6
  150. package/dist/utils-Crm9oPcV.mjs +0 -7
  151. package/dist/utils-D6Xtj0FZ.cjs +0 -7
  152. /package/dist/{errors-0zGHRLue.mjs → errors-N-b6Sn2G.mjs} +0 -0
  153. /package/dist/{index-1KsTDq4o.d.mts → index-lFoyzCXy.d.mts} +0 -0
  154. /package/dist/{types-generator-BXhv7Ill.cjs → types-generator-DDSA93P3.cjs} +0 -0
  155. /package/dist/{types-generator-bDPvUztF.mjs → types-generator-DG1GX1EZ.mjs} +0 -0
@@ -0,0 +1,872 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ import { E as useLocation, O as useNavigate, c as hasUriScheme, h as resolveUrlReference, k as usePrefetch, l as hasUrlBase, m as parseUrlReference } from "./router-CZBxMRAH.js";
7
+ import { createContext, use, useCallback, useEffect, useMemo, useState } from "react";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
+ import { clsx } from "clsx";
10
+ import { twMerge } from "tailwind-merge";
11
+
12
+ //#region \0rolldown/runtime.js
13
+ var __defProp = Object.defineProperty;
14
+ var __exportAll = (all, no_symbols) => {
15
+ let target = {};
16
+ for (var name in all) {
17
+ __defProp(target, name, {
18
+ get: all[name],
19
+ enumerable: true
20
+ });
21
+ }
22
+ if (!no_symbols) {
23
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
24
+ }
25
+ return target;
26
+ };
27
+
28
+ //#endregion
29
+ //#region src/client/store/boltdocs-context.tsx
30
+ const PREFERENCES_KEY = "boltdocs-user-preferences";
31
+ const BOLTDOCS_CONTEXT_SYMBOL = Symbol.for("__BDOCS_BOLTDOCS_CONTEXT__");
32
+ const BOLTDOCS_INSTANCE_SYMBOL = Symbol.for("__BDOCS_BOLTDOCS_INSTANCE__");
33
+ function getSavedPrefs() {
34
+ if (typeof window === "undefined") return {};
35
+ try {
36
+ const raw = window.localStorage.getItem(PREFERENCES_KEY);
37
+ return raw ? JSON.parse(raw) : {};
38
+ } catch {
39
+ return {};
40
+ }
41
+ }
42
+ const globalRegistry$1 = globalThis;
43
+ const existingContext = globalRegistry$1[BOLTDOCS_CONTEXT_SYMBOL];
44
+ const BoltdocsContext = existingContext || createContext(void 0);
45
+ if (!existingContext) Reflect.set(globalRegistry$1, BOLTDOCS_CONTEXT_SYMBOL, BoltdocsContext);
46
+ function BoltdocsProvider({ children, initialLocale = "", initialVersion = "" }) {
47
+ const [locale, setLocaleState] = useState(() => {
48
+ if (initialLocale) return initialLocale;
49
+ return getSavedPrefs().locale || "";
50
+ });
51
+ const [version, setVersionState] = useState(() => {
52
+ if (initialVersion) return initialVersion;
53
+ return getSavedPrefs().version || "";
54
+ });
55
+ const [hasHydrated, setHasHydrated] = useState(() => {
56
+ return typeof window !== "undefined";
57
+ });
58
+ useEffect(() => {
59
+ setHasHydrated(true);
60
+ }, []);
61
+ const updateLocale = useCallback((l) => {
62
+ const newL = l || "";
63
+ setLocaleState((current) => {
64
+ if (current === newL) return current;
65
+ return newL;
66
+ });
67
+ if (typeof globalThis !== "undefined") Reflect.set(globalThis, BOLTDOCS_INSTANCE_SYMBOL, {
68
+ ...globalThis[BOLTDOCS_INSTANCE_SYMBOL],
69
+ currentLocale: newL
70
+ });
71
+ if (typeof window !== "undefined") try {
72
+ const prefs = getSavedPrefs();
73
+ if (prefs.locale !== newL) window.localStorage.setItem(PREFERENCES_KEY, JSON.stringify({
74
+ ...prefs,
75
+ locale: newL
76
+ }));
77
+ } catch {}
78
+ }, []);
79
+ const updateVersion = useCallback((v) => {
80
+ const newV = v || "";
81
+ setVersionState((current) => {
82
+ if (current === newV) return current;
83
+ return newV;
84
+ });
85
+ if (typeof globalThis !== "undefined") Reflect.set(globalThis, BOLTDOCS_INSTANCE_SYMBOL, {
86
+ ...globalThis[BOLTDOCS_INSTANCE_SYMBOL],
87
+ currentVersion: newV
88
+ });
89
+ if (typeof window !== "undefined") try {
90
+ const prefs = getSavedPrefs();
91
+ if (prefs.version !== newV) window.localStorage.setItem(PREFERENCES_KEY, JSON.stringify({
92
+ ...prefs,
93
+ version: newV
94
+ }));
95
+ } catch {}
96
+ }, []);
97
+ const value = useMemo(() => ({
98
+ currentLocale: locale,
99
+ currentVersion: version,
100
+ setLocale: updateLocale,
101
+ setVersion: updateVersion,
102
+ hasHydrated,
103
+ setHasHydrated
104
+ }), [
105
+ locale,
106
+ version,
107
+ hasHydrated,
108
+ updateLocale,
109
+ updateVersion
110
+ ]);
111
+ if (typeof globalThis !== "undefined") Reflect.set(globalThis, BOLTDOCS_INSTANCE_SYMBOL, value);
112
+ return /* @__PURE__ */ jsx(BoltdocsContext.Provider, {
113
+ value,
114
+ children
115
+ });
116
+ }
117
+ function useBoltdocsContext() {
118
+ const context = use(BoltdocsContext);
119
+ const globalInstance = typeof globalThis !== "undefined" ? globalThis[BOLTDOCS_INSTANCE_SYMBOL] : void 0;
120
+ if (!context && globalInstance) return globalInstance;
121
+ if (!context) throw new Error("useBoltdocsContext must be used within a BoltdocsProvider");
122
+ return context;
123
+ }
124
+
125
+ //#endregion
126
+ //#region src/client/app/config-context.tsx
127
+ /**
128
+ * Context for the global documentation configuration.
129
+ * Using a global singleton pattern to survive dual-package or duplicated-code hazards.
130
+ */
131
+ const CONFIG_CONTEXT_SYMBOL = Symbol.for("__BDOCS_CONFIG_CONTEXT__");
132
+ const CONFIG_INSTANCE_SYMBOL = Symbol.for("__BDOCS_CONFIG_INSTANCE__");
133
+ const globalRegistry = globalThis;
134
+ const existingConfigContext = globalRegistry[CONFIG_CONTEXT_SYMBOL];
135
+ const ConfigContext = existingConfigContext || createContext(null);
136
+ if (!existingConfigContext) globalRegistry[CONFIG_CONTEXT_SYMBOL] = ConfigContext;
137
+ /**
138
+ * Hook to access the Boltdocs configuration when one is available.
139
+ *
140
+ * Low-level primitives such as icons can also be rendered standalone (for
141
+ * example in a component preview or a unit test), so they must not be forced
142
+ * to mount the full application provider just to render an inline SVG.
143
+ */
144
+ function useOptionalConfig() {
145
+ const context = use(ConfigContext);
146
+ if (context) return context;
147
+ const globalConfig = globalRegistry[CONFIG_INSTANCE_SYMBOL];
148
+ if (globalConfig) return globalConfig;
149
+ return null;
150
+ }
151
+ /**
152
+ * Hook to access the Boltdocs configuration.
153
+ */
154
+ function useConfig() {
155
+ const config = useOptionalConfig();
156
+ if (!config) throw new Error("useConfig must be used within a ConfigProvider");
157
+ return config;
158
+ }
159
+
160
+ //#endregion
161
+ //#region src/client/components/ui-base/icons.tsx
162
+ var icons_exports = /* @__PURE__ */ __exportAll({
163
+ AlertCircle: () => AlertCircle,
164
+ AlertTriangle: () => AlertTriangle,
165
+ ArrowLeft: () => ArrowLeft,
166
+ BookOpen: () => BookOpen,
167
+ Check: () => Check,
168
+ ChevronDown: () => ChevronDown,
169
+ ChevronLeft: () => ChevronLeft,
170
+ ChevronRight: () => ChevronRight,
171
+ CircleHelp: () => CircleHelp,
172
+ Code2: () => Code2,
173
+ Copy: () => Copy,
174
+ CornerDownLeft: () => CornerDownLeft,
175
+ ExternalLink: () => ExternalLink,
176
+ FaceBad: () => FaceBad,
177
+ FaceGood: () => FaceGood,
178
+ FaceRegular: () => FaceRegular,
179
+ File: () => File,
180
+ FileCode2: () => FileCode2,
181
+ FileText: () => FileText,
182
+ FlaskConical: () => FlaskConical,
183
+ Gauge: () => Gauge,
184
+ Hash: () => Hash,
185
+ Home: () => Home,
186
+ Info: () => Info,
187
+ Languages: () => Languages,
188
+ LifeBuoy: () => LifeBuoy,
189
+ Lightbulb: () => Lightbulb,
190
+ Link: () => Link$1,
191
+ Menu: () => Menu,
192
+ Monitor: () => Monitor,
193
+ Moon: () => Moon,
194
+ MoreVertical: () => MoreVertical,
195
+ Paintbrush: () => Paintbrush,
196
+ Pencil: () => Pencil,
197
+ Rocket: () => Rocket,
198
+ Search: () => Search,
199
+ Sun: () => Sun,
200
+ TextAlignStart: () => TextAlignStart,
201
+ X: () => X
202
+ });
203
+ function createIcon(displayName, paths, viewBox = "0 0 24 24") {
204
+ const Component = ({ size = 24, className, ...props }) => {
205
+ return /* @__PURE__ */ jsxs("svg", {
206
+ xmlns: "http://www.w3.org/2000/svg",
207
+ width: size,
208
+ height: size,
209
+ viewBox,
210
+ fill: "none",
211
+ stroke: "currentColor",
212
+ strokeWidth: "2",
213
+ strokeLinecap: "round",
214
+ strokeLinejoin: "round",
215
+ className,
216
+ ...props,
217
+ children: [/* @__PURE__ */ jsx("title", { children: displayName }), paths]
218
+ });
219
+ };
220
+ Component.displayName = displayName;
221
+ return Component;
222
+ }
223
+ const Info = createIcon("Info", /* @__PURE__ */ jsxs(Fragment$1, { children: [
224
+ /* @__PURE__ */ jsx("circle", {
225
+ cx: "12",
226
+ cy: "12",
227
+ r: "10"
228
+ }),
229
+ /* @__PURE__ */ jsx("path", { d: "M12 16v-4" }),
230
+ /* @__PURE__ */ jsx("path", { d: "M12 8h.01" })
231
+ ] }));
232
+ const Lightbulb = createIcon("Lightbulb", /* @__PURE__ */ jsxs(Fragment$1, { children: [
233
+ /* @__PURE__ */ jsx("path", { d: "M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A5 5 0 0 0 8 8c0 1 .3 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5" }),
234
+ /* @__PURE__ */ jsx("path", { d: "M9 18h6" }),
235
+ /* @__PURE__ */ jsx("path", { d: "M10 22h4" })
236
+ ] }));
237
+ const BookOpen = createIcon("BookOpen", /* @__PURE__ */ jsxs(Fragment$1, { children: [
238
+ /* @__PURE__ */ jsx("path", { d: "M2 4v16a2 2 0 0 0 2 2h16" }),
239
+ /* @__PURE__ */ jsx("path", { d: "M22 18V4a2 2 0 0 0-2-2H6a4 4 0 0 0-4 4" }),
240
+ /* @__PURE__ */ jsx("path", { d: "M6 2v16" }),
241
+ /* @__PURE__ */ jsx("path", { d: "M6 18h16" })
242
+ ] }));
243
+ const Rocket = createIcon("Rocket", /* @__PURE__ */ jsxs(Fragment$1, { children: [
244
+ /* @__PURE__ */ jsx("path", { d: "M4.5 16.5c-1.5 1.5-2 4-2 4s2.5-.5 4-2c.7-.7.7-1.8 0-2.5s-1.3-.2-2 0Z" }),
245
+ /* @__PURE__ */ jsx("path", { d: "m12 15-3-3a22 22 0 0 1 3-5c2-2.5 5-4 9-4 0 4-1.5 7-4 9a22 22 0 0 1-5 3Z" }),
246
+ /* @__PURE__ */ jsx("path", { d: "M9 12H4l-2 2 5 1" }),
247
+ /* @__PURE__ */ jsx("path", { d: "M12 15v5l2-2 1-5" }),
248
+ /* @__PURE__ */ jsx("circle", {
249
+ cx: "16",
250
+ cy: "8",
251
+ r: "1"
252
+ })
253
+ ] }));
254
+ const Code2 = createIcon("Code2", /* @__PURE__ */ jsxs(Fragment$1, { children: [
255
+ /* @__PURE__ */ jsx("path", { d: "m18 16 4-4-4-4" }),
256
+ /* @__PURE__ */ jsx("path", { d: "m6 8-4 4 4 4" }),
257
+ /* @__PURE__ */ jsx("path", { d: "m14.5 4-5 16" })
258
+ ] }));
259
+ const FlaskConical = createIcon("FlaskConical", /* @__PURE__ */ jsxs(Fragment$1, { children: [
260
+ /* @__PURE__ */ jsx("path", { d: "M9 3h6" }),
261
+ /* @__PURE__ */ jsx("path", { d: "M10 3v7.5L4.5 19a2 2 0 0 0 1.7 3h11.6a2 2 0 0 0 1.7-3L14 10.5V3" }),
262
+ /* @__PURE__ */ jsx("path", { d: "M7 16h10" })
263
+ ] }));
264
+ const FileCode2 = createIcon("FileCode2", /* @__PURE__ */ jsxs(Fragment$1, { children: [
265
+ /* @__PURE__ */ jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z" }),
266
+ /* @__PURE__ */ jsx("path", { d: "M14 2v6h6" }),
267
+ /* @__PURE__ */ jsx("path", { d: "m10 13-2 2 2 2" }),
268
+ /* @__PURE__ */ jsx("path", { d: "m14 13 2 2-2 2" })
269
+ ] }));
270
+ const Paintbrush = createIcon("Paintbrush", /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("path", { d: "m14 6 4 4" }), /* @__PURE__ */ jsx("path", { d: "M3 21c3 0 5-1 6-4l8-8a2.8 2.8 0 1 0-4-4l-8 8c-3 1-4 4-2 8Z" })] }));
271
+ const Gauge = createIcon("Gauge", /* @__PURE__ */ jsxs(Fragment$1, { children: [
272
+ /* @__PURE__ */ jsx("path", { d: "m12 14 4-4" }),
273
+ /* @__PURE__ */ jsx("path", { d: "M3.3 17a9 9 0 1 1 17.4 0" }),
274
+ /* @__PURE__ */ jsx("path", { d: "M5 19h14" })
275
+ ] }));
276
+ const LifeBuoy = createIcon("LifeBuoy", /* @__PURE__ */ jsxs(Fragment$1, { children: [
277
+ /* @__PURE__ */ jsx("circle", {
278
+ cx: "12",
279
+ cy: "12",
280
+ r: "10"
281
+ }),
282
+ /* @__PURE__ */ jsx("circle", {
283
+ cx: "12",
284
+ cy: "12",
285
+ r: "4"
286
+ }),
287
+ /* @__PURE__ */ jsx("path", { d: "m4.9 4.9 4.3 4.3M14.8 14.8l4.3 4.3M19.1 4.9l-4.3 4.3M9.2 14.8l-4.3 4.3" })
288
+ ] }));
289
+ const AlertTriangle = createIcon("AlertTriangle", /* @__PURE__ */ jsxs(Fragment$1, { children: [
290
+ /* @__PURE__ */ jsx("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" }),
291
+ /* @__PURE__ */ jsx("line", {
292
+ x1: "12",
293
+ y1: "9",
294
+ x2: "12",
295
+ y2: "13"
296
+ }),
297
+ /* @__PURE__ */ jsx("line", {
298
+ x1: "12",
299
+ y1: "17",
300
+ x2: "12.01",
301
+ y2: "17"
302
+ })
303
+ ] }));
304
+ const AlertCircle = createIcon("AlertCircle", /* @__PURE__ */ jsxs(Fragment$1, { children: [
305
+ /* @__PURE__ */ jsx("circle", {
306
+ cx: "12",
307
+ cy: "12",
308
+ r: "10"
309
+ }),
310
+ /* @__PURE__ */ jsx("line", {
311
+ x1: "12",
312
+ y1: "8",
313
+ x2: "12",
314
+ y2: "12"
315
+ }),
316
+ /* @__PURE__ */ jsx("line", {
317
+ x1: "12",
318
+ y1: "16",
319
+ x2: "12.01",
320
+ y2: "16"
321
+ })
322
+ ] }));
323
+ const Copy = createIcon("Copy", /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("rect", {
324
+ width: "14",
325
+ height: "14",
326
+ x: "8",
327
+ y: "8",
328
+ rx: "2",
329
+ ry: "2"
330
+ }), /* @__PURE__ */ jsx("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })] }));
331
+ const Check = createIcon("Check", /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }));
332
+ const File = createIcon("File", /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }), /* @__PURE__ */ jsx("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" })] }));
333
+ const ArrowLeft = createIcon("ArrowLeft", /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("path", { d: "m12 19-7-7 7-7" }), /* @__PURE__ */ jsx("path", { d: "M19 12H5" })] }));
334
+ const Pencil = createIcon("Pencil", /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("path", { d: "M12 20h9" }), /* @__PURE__ */ jsx("path", { d: "M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z" })] }));
335
+ const CircleHelp = createIcon("CircleHelp", /* @__PURE__ */ jsxs(Fragment$1, { children: [
336
+ /* @__PURE__ */ jsx("circle", {
337
+ cx: "12",
338
+ cy: "12",
339
+ r: "10"
340
+ }),
341
+ /* @__PURE__ */ jsx("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
342
+ /* @__PURE__ */ jsx("path", { d: "M12 17h.01" })
343
+ ] }));
344
+ const TextAlignStart = createIcon("TextAlignStart", /* @__PURE__ */ jsxs(Fragment$1, { children: [
345
+ /* @__PURE__ */ jsx("line", {
346
+ x1: "21",
347
+ x2: "3",
348
+ y1: "6",
349
+ y2: "6"
350
+ }),
351
+ /* @__PURE__ */ jsx("line", {
352
+ x1: "15",
353
+ x2: "3",
354
+ y1: "12",
355
+ y2: "12"
356
+ }),
357
+ /* @__PURE__ */ jsx("line", {
358
+ x1: "17",
359
+ x2: "3",
360
+ y1: "18",
361
+ y2: "18"
362
+ })
363
+ ] }));
364
+ const ExternalLink = createIcon("ExternalLink", /* @__PURE__ */ jsxs(Fragment$1, { children: [
365
+ /* @__PURE__ */ jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
366
+ /* @__PURE__ */ jsx("polyline", { points: "15 3 21 3 21 9" }),
367
+ /* @__PURE__ */ jsx("line", {
368
+ x1: "10",
369
+ y1: "14",
370
+ x2: "21",
371
+ y2: "3"
372
+ })
373
+ ] }));
374
+ const ChevronDown = createIcon("ChevronDown", /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" }));
375
+ const Home = createIcon("Home", /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }), /* @__PURE__ */ jsx("polyline", { points: "9 22 9 12 15 12 15 22" })] }));
376
+ const Search = createIcon("Search", /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("circle", {
377
+ cx: "11",
378
+ cy: "11",
379
+ r: "8"
380
+ }), /* @__PURE__ */ jsx("path", { d: "m21 21-4.3-4.3" })] }));
381
+ const Sun = createIcon("Sun", /* @__PURE__ */ jsxs(Fragment$1, { children: [
382
+ /* @__PURE__ */ jsx("circle", {
383
+ cx: "12",
384
+ cy: "12",
385
+ r: "4"
386
+ }),
387
+ /* @__PURE__ */ jsx("path", { d: "M12 2v2" }),
388
+ /* @__PURE__ */ jsx("path", { d: "M12 20v2" }),
389
+ /* @__PURE__ */ jsx("path", { d: "m4.93 4.93 1.41 1.41" }),
390
+ /* @__PURE__ */ jsx("path", { d: "m17.66 17.66 1.41 1.41" }),
391
+ /* @__PURE__ */ jsx("path", { d: "M2 12h2" }),
392
+ /* @__PURE__ */ jsx("path", { d: "M20 12h2" }),
393
+ /* @__PURE__ */ jsx("path", { d: "m6.34 17.66-1.41 1.41" }),
394
+ /* @__PURE__ */ jsx("path", { d: "m19.07 4.93-1.41 1.41" })
395
+ ] }));
396
+ const Moon = createIcon("Moon", /* @__PURE__ */ jsx("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }));
397
+ const Monitor = createIcon("Monitor", /* @__PURE__ */ jsxs(Fragment$1, { children: [
398
+ /* @__PURE__ */ jsx("rect", {
399
+ width: "20",
400
+ height: "14",
401
+ x: "2",
402
+ y: "3",
403
+ rx: "2"
404
+ }),
405
+ /* @__PURE__ */ jsx("line", {
406
+ x1: "8",
407
+ x2: "16",
408
+ y1: "21",
409
+ y2: "21"
410
+ }),
411
+ /* @__PURE__ */ jsx("line", {
412
+ x1: "12",
413
+ x2: "12",
414
+ y1: "17",
415
+ y2: "21"
416
+ })
417
+ ] }));
418
+ const Languages = createIcon("Languages", /* @__PURE__ */ jsxs(Fragment$1, { children: [
419
+ /* @__PURE__ */ jsx("path", { d: "m5 8 6 6" }),
420
+ /* @__PURE__ */ jsx("path", { d: "m4 14 6-6 2-3" }),
421
+ /* @__PURE__ */ jsx("path", { d: "M2 5h12" }),
422
+ /* @__PURE__ */ jsx("path", { d: "M7 2h1" }),
423
+ /* @__PURE__ */ jsx("path", { d: "m22 22-5-10-5 10" }),
424
+ /* @__PURE__ */ jsx("path", { d: "M14 18h6" })
425
+ ] }));
426
+ const Menu = createIcon("Menu", /* @__PURE__ */ jsxs(Fragment$1, { children: [
427
+ /* @__PURE__ */ jsx("line", {
428
+ x1: "4",
429
+ x2: "20",
430
+ y1: "12",
431
+ y2: "12"
432
+ }),
433
+ /* @__PURE__ */ jsx("line", {
434
+ x1: "4",
435
+ x2: "20",
436
+ y1: "6",
437
+ y2: "6"
438
+ }),
439
+ /* @__PURE__ */ jsx("line", {
440
+ x1: "4",
441
+ x2: "20",
442
+ y1: "18",
443
+ y2: "18"
444
+ })
445
+ ] }));
446
+ const X = createIcon("X", /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }), /* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })] }));
447
+ const Link$1 = createIcon("Link", /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }), /* @__PURE__ */ jsx("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" })] }));
448
+ const ChevronRight = createIcon("ChevronRight", /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" }));
449
+ const MoreVertical = createIcon("MoreVertical", /* @__PURE__ */ jsxs(Fragment$1, { children: [
450
+ /* @__PURE__ */ jsx("circle", {
451
+ cx: "12",
452
+ cy: "12",
453
+ r: "1"
454
+ }),
455
+ /* @__PURE__ */ jsx("circle", {
456
+ cx: "12",
457
+ cy: "5",
458
+ r: "1"
459
+ }),
460
+ /* @__PURE__ */ jsx("circle", {
461
+ cx: "12",
462
+ cy: "19",
463
+ r: "1"
464
+ })
465
+ ] }));
466
+ const ChevronLeft = createIcon("ChevronLeft", /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" }));
467
+ const Hash = createIcon("Hash", /* @__PURE__ */ jsxs(Fragment$1, { children: [
468
+ /* @__PURE__ */ jsx("line", {
469
+ x1: "4",
470
+ x2: "20",
471
+ y1: "9",
472
+ y2: "9"
473
+ }),
474
+ /* @__PURE__ */ jsx("line", {
475
+ x1: "4",
476
+ x2: "20",
477
+ y1: "15",
478
+ y2: "15"
479
+ }),
480
+ /* @__PURE__ */ jsx("line", {
481
+ x1: "10",
482
+ x2: "8",
483
+ y1: "3",
484
+ y2: "21"
485
+ }),
486
+ /* @__PURE__ */ jsx("line", {
487
+ x1: "16",
488
+ x2: "14",
489
+ y1: "3",
490
+ y2: "21"
491
+ })
492
+ ] }));
493
+ const FileText = createIcon("FileText", /* @__PURE__ */ jsxs(Fragment$1, { children: [
494
+ /* @__PURE__ */ jsx("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
495
+ /* @__PURE__ */ jsx("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
496
+ /* @__PURE__ */ jsx("path", { d: "M10 9H8" }),
497
+ /* @__PURE__ */ jsx("path", { d: "M16 13H8" }),
498
+ /* @__PURE__ */ jsx("path", { d: "M16 17H8" })
499
+ ] }));
500
+ const CornerDownLeft = createIcon("CornerDownLeft", /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("polyline", { points: "9 10 4 15 9 20" }), /* @__PURE__ */ jsx("path", { d: "M20 4v7a4 4 0 0 1-4 4H4" })] }));
501
+ const FaceGood = createIcon("FaceGood", /* @__PURE__ */ jsxs(Fragment$1, { children: [
502
+ /* @__PURE__ */ jsx("circle", {
503
+ cx: "12",
504
+ cy: "12",
505
+ r: "10"
506
+ }),
507
+ /* @__PURE__ */ jsx("path", { d: "M8 14s1.5 2 4 2 4-2 4-2" }),
508
+ /* @__PURE__ */ jsx("line", {
509
+ x1: "9",
510
+ y1: "9",
511
+ x2: "9.01",
512
+ y2: "9"
513
+ }),
514
+ /* @__PURE__ */ jsx("line", {
515
+ x1: "15",
516
+ y1: "9",
517
+ x2: "15.01",
518
+ y2: "9"
519
+ })
520
+ ] }));
521
+ const FaceRegular = createIcon("FaceRegular", /* @__PURE__ */ jsxs(Fragment$1, { children: [
522
+ /* @__PURE__ */ jsx("circle", {
523
+ cx: "12",
524
+ cy: "12",
525
+ r: "10"
526
+ }),
527
+ /* @__PURE__ */ jsx("line", {
528
+ x1: "8",
529
+ y1: "15",
530
+ x2: "16",
531
+ y2: "15"
532
+ }),
533
+ /* @__PURE__ */ jsx("line", {
534
+ x1: "9",
535
+ y1: "9",
536
+ x2: "9.01",
537
+ y2: "9"
538
+ }),
539
+ /* @__PURE__ */ jsx("line", {
540
+ x1: "15",
541
+ y1: "9",
542
+ x2: "15.01",
543
+ y2: "9"
544
+ })
545
+ ] }));
546
+ const FaceBad = createIcon("FaceBad", /* @__PURE__ */ jsxs(Fragment$1, { children: [
547
+ /* @__PURE__ */ jsx("circle", {
548
+ cx: "12",
549
+ cy: "12",
550
+ r: "10"
551
+ }),
552
+ /* @__PURE__ */ jsx("path", { d: "M16 16s-1.5-2-4-2-4 2-4 2" }),
553
+ /* @__PURE__ */ jsx("line", {
554
+ x1: "9",
555
+ y1: "9",
556
+ x2: "9.01",
557
+ y2: "9"
558
+ }),
559
+ /* @__PURE__ */ jsx("line", {
560
+ x1: "15",
561
+ y1: "9",
562
+ x2: "15.01",
563
+ y2: "9"
564
+ })
565
+ ] }));
566
+
567
+ //#endregion
568
+ //#region src/client/utils/path.ts
569
+ /**
570
+ * Normalizes a URL path by stripping any trailing slash unless it's the root path.
571
+ *
572
+ * @param p - The path to normalize.
573
+ * @returns The normalized path.
574
+ */
575
+ function normalizePath(p) {
576
+ return p.endsWith("/") && p.length > 1 ? p.slice(0, -1) : p;
577
+ }
578
+ /**
579
+ * Resolves a public asset URL under the configured Vite/base path.
580
+ * Root-relative URLs are otherwise interpreted against the origin root, which
581
+ * breaks sites deployed under a documentation base such as `/docs`.
582
+ */
583
+ function resolvePublicAssetUrl(value, base) {
584
+ if (!value || !value.startsWith("/") || value.startsWith("//") || /^\/(?:https?:|data:)/i.test(value)) return value;
585
+ const normalizedBase = (base || "/").replace(/\/+$/, "");
586
+ if (!normalizedBase || normalizedBase === "/") return value;
587
+ if (value === normalizedBase || value.startsWith(`${normalizedBase}/`)) return value;
588
+ return `${normalizedBase}${value}`;
589
+ }
590
+
591
+ //#endregion
592
+ //#region src/client/app/routes-context.tsx
593
+ const RoutesContext = createContext({
594
+ routes: [],
595
+ index: {
596
+ byPath: /* @__PURE__ */ new Map(),
597
+ hintsByPath: /* @__PURE__ */ new Map(),
598
+ collectionNames: []
599
+ }
600
+ });
601
+ /**
602
+ * Hook to access the processed routes list from the closest provider.
603
+ */
604
+ function useRoutesContext() {
605
+ return use(RoutesContext);
606
+ }
607
+ /**
608
+ * Provider component for the documentation routes.
609
+ */
610
+ function RoutesProvider({ routes: initialRoutes, children }) {
611
+ const [routes, setRoutes] = useState(initialRoutes);
612
+ const index = useMemo(() => {
613
+ const byPath = /* @__PURE__ */ new Map();
614
+ const hintsByPath = /* @__PURE__ */ new Map();
615
+ const collectionNames = /* @__PURE__ */ new Set();
616
+ for (const route of routes) {
617
+ if (!route.path) continue;
618
+ const path = normalizePath(route.path);
619
+ byPath.set(path, route);
620
+ hintsByPath.set(path, {
621
+ path: route.path,
622
+ kind: route.collection ? "collection" : void 0,
623
+ collection: route.collection
624
+ });
625
+ if (route.collection) collectionNames.add(route.collection);
626
+ }
627
+ return {
628
+ byPath,
629
+ hintsByPath,
630
+ collectionNames: [...collectionNames]
631
+ };
632
+ }, [routes]);
633
+ useEffect(() => {
634
+ if (!import.meta.hot) return;
635
+ const handler = (payload) => {
636
+ setRoutes((prev) => {
637
+ const deleted = new Set(payload.routes.deleted);
638
+ const next = prev.filter((r) => !deleted.has(r.path));
639
+ for (const updated of payload.routes.updated) {
640
+ const idx = next.findIndex((r) => r.path === updated.path);
641
+ if (idx >= 0) next[idx] = updated;
642
+ else next.push(updated);
643
+ }
644
+ return [...next];
645
+ });
646
+ };
647
+ const hot = import.meta.hot;
648
+ hot.on("boltdocs:frontmatter-update", handler);
649
+ return () => hot.off?.("boltdocs:frontmatter-update", handler);
650
+ }, []);
651
+ return /* @__PURE__ */ jsx(RoutesContext.Provider, {
652
+ value: {
653
+ routes,
654
+ index
655
+ },
656
+ children
657
+ });
658
+ }
659
+
660
+ //#endregion
661
+ //#region src/client/hooks/use-localized-to.ts
662
+ function useLocalizedTo(to) {
663
+ const config = useConfig();
664
+ const routeContext = useRoutesContext();
665
+ const routeIndex = routeContext.index || {
666
+ byPath: new Map(routeContext.routes.map((route) => [route.path, route])),
667
+ hintsByPath: /* @__PURE__ */ new Map(),
668
+ collectionNames: []
669
+ };
670
+ const { currentLocale: activeLocale, currentVersion: activeVersion } = useBoltdocsContext();
671
+ const configuredVersion = (config.versions?.versions || []).some((version) => version.path === activeVersion) ? activeVersion : void 0;
672
+ const configuredLocale = (config.i18n ? Array.isArray(config.i18n.locales) ? config.i18n.locales : Object.keys(config.i18n.locales) : []).includes(activeLocale) ? activeLocale : void 0;
673
+ if (!config || typeof to !== "string") return to;
674
+ if (to.startsWith("http://") || to.startsWith("https://") || to.startsWith("//") || to.startsWith("#") || to.startsWith("?") || hasUriScheme(to.replace(/^site:/, ""))) return to.startsWith("site:") ? to.slice(5) || "/" : to;
675
+ const siteProtocol = to.startsWith("site:");
676
+ const siteValue = siteProtocol ? to.slice(5) || "/" : to;
677
+ const configCollections = config.collections;
678
+ const configuredCollectionNames = Array.isArray(configCollections) ? configCollections : Object.keys(configCollections?.labels || {});
679
+ const collectionNames = [...new Set([...routeIndex.collectionNames, ...configuredCollectionNames])];
680
+ const targetPath = siteValue.split(/[?#]/, 1)[0];
681
+ const normalizedTarget = targetPath.endsWith("/") && targetPath.length > 1 ? targetPath.slice(0, -1) : targetPath;
682
+ const knownRoute = routeIndex.hintsByPath.get(normalizedTarget);
683
+ const knownRouteMeta = routeIndex.byPath.get(normalizedTarget);
684
+ const knownRouteKind = knownRoute ? knownRoute.kind || (hasUrlBase(normalizedTarget, config.base) ? "doc" : "external") : void 0;
685
+ const routeHints = knownRoute ? [{
686
+ ...knownRoute,
687
+ kind: knownRouteKind
688
+ }] : [];
689
+ const kind = knownRouteKind || (siteProtocol ? "external" : "doc");
690
+ const contractConfig = {
691
+ base: config.base,
692
+ i18n: config.i18n ? {
693
+ defaultLocale: config.i18n.defaultLocale,
694
+ locales: config.i18n.locales
695
+ } : void 0,
696
+ versions: config.versions ? {
697
+ defaultVersion: config.versions.defaultVersion,
698
+ prefix: config.versions.prefix,
699
+ versions: config.versions.versions
700
+ } : void 0,
701
+ collections: collectionNames
702
+ };
703
+ const parsedTarget = parseUrlReference(siteValue, contractConfig, {
704
+ kind,
705
+ routes: routeHints
706
+ });
707
+ const resolved = resolveUrlReference(siteValue, contractConfig, {
708
+ kind,
709
+ routes: routeHints,
710
+ locale: configuredLocale,
711
+ version: kind === "collection" || kind === "external" ? knownRouteMeta?.version : parsedTarget.version || configuredVersion
712
+ });
713
+ if (siteValue.endsWith("/") && siteValue.length > 1 && !resolved.split(/[?#]/, 1)[0].endsWith("/")) {
714
+ const suffixIndex = resolved.search(/[?#]/);
715
+ return `${suffixIndex < 0 ? resolved : resolved.slice(0, suffixIndex)}/${suffixIndex < 0 ? "" : resolved.slice(suffixIndex)}`;
716
+ }
717
+ return resolved;
718
+ }
719
+
720
+ //#endregion
721
+ //#region src/client/utils/cn.ts
722
+ function cn(...inputs) {
723
+ return twMerge(clsx(inputs));
724
+ }
725
+
726
+ //#endregion
727
+ //#region src/client/view-transitions.ts
728
+ function resolveOptions(options) {
729
+ if (options?.enabled === false) return void 0;
730
+ return {
731
+ enabled: true,
732
+ ...options?.types?.length ? { types: options.types } : {}
733
+ };
734
+ }
735
+ function isNativeViewTransitionSupported() {
736
+ return typeof document !== "undefined" && typeof document.startViewTransition === "function";
737
+ }
738
+ /**
739
+ * Starts a native document transition when the browser supports it. On older
740
+ * browsers, the update still runs normally and the function returns null.
741
+ */
742
+ function startViewTransition(update, options) {
743
+ const resolved = resolveOptions(options);
744
+ if (typeof document === "undefined" || resolved?.enabled !== true) {
745
+ update();
746
+ return null;
747
+ }
748
+ const start = document.startViewTransition;
749
+ if (!start) {
750
+ update();
751
+ return null;
752
+ }
753
+ const types = options?.types;
754
+ return start.call(document, {
755
+ update,
756
+ ...types?.length ? { types } : {}
757
+ });
758
+ }
759
+ /**
760
+ * Returns a transition-aware runner that follows the project's experimental
761
+ * configuration. It is safe to use in custom layouts and external pages.
762
+ *
763
+ * The returned value is callable for backwards compatibility:
764
+ * `transition(() => setState(...))`. It also exposes `run` and `start` aliases
765
+ * for discoverability in editor autocomplete.
766
+ */
767
+ function useViewTransition() {
768
+ const configured = useOptionalConfig()?.experimental?.viewTransitions;
769
+ const enabled = configured === true || typeof configured === "object" && configured.enabled === true;
770
+ const supported = isNativeViewTransitionSupported();
771
+ const run = useCallback((update, options) => {
772
+ if (!enabled && options?.enabled !== true) {
773
+ update();
774
+ return null;
775
+ }
776
+ const configuredTypes = typeof configured === "object" ? configured.types : void 0;
777
+ return startViewTransition(update, {
778
+ ...options,
779
+ types: options?.types || configuredTypes
780
+ });
781
+ }, [configured, enabled]);
782
+ return useMemo(() => Object.assign(run, {
783
+ run,
784
+ start: run,
785
+ enabled,
786
+ supported
787
+ }), [
788
+ enabled,
789
+ run,
790
+ supported
791
+ ]);
792
+ }
793
+
794
+ //#endregion
795
+ //#region src/client/components/primitives/link.tsx
796
+ /**
797
+ * A primitive Link component that wraps a standard anchor tag
798
+ * and adds framework-specific logic for path localization and preloading.
799
+ */
800
+ function Link(props) {
801
+ const { href, to, ref, prefetch = "hover", onMouseEnter, onFocus, onClick, target: linkTarget, download, transition = false, transitionTypes, ...rest } = props;
802
+ const target = href ?? to ?? "";
803
+ const navigate = useNavigate();
804
+ const prefetchRoute = usePrefetch();
805
+ const runTransition = useViewTransition();
806
+ const localizedHref = useLocalizedTo(target);
807
+ const handleClick = (e) => {
808
+ onClick?.(e);
809
+ if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || download !== void 0 || linkTarget && linkTarget !== "_self") return;
810
+ if (!(localizedHref && (localizedHref.startsWith("http://") || localizedHref.startsWith("https://") || localizedHref.startsWith("//") || hasUriScheme(localizedHref)))) {
811
+ e.preventDefault();
812
+ const navigateTo = () => navigate(localizedHref, transition ? { viewTransition: false } : void 0);
813
+ if (transition) runTransition(navigateTo, {
814
+ enabled: true,
815
+ types: transitionTypes
816
+ });
817
+ else navigateTo();
818
+ }
819
+ };
820
+ const handlePrefetch = () => {
821
+ if (prefetch === "hover" && localizedHref) prefetchRoute(localizedHref);
822
+ };
823
+ const handleMouseEnter = (e) => {
824
+ onMouseEnter?.(e);
825
+ handlePrefetch();
826
+ };
827
+ const handleFocus = (e) => {
828
+ onFocus?.(e);
829
+ handlePrefetch();
830
+ };
831
+ return /* @__PURE__ */ jsx("a", {
832
+ ...rest,
833
+ ref,
834
+ href: localizedHref,
835
+ target: linkTarget,
836
+ download,
837
+ onClick: handleClick,
838
+ onMouseEnter: handleMouseEnter,
839
+ onFocus: handleFocus
840
+ });
841
+ }
842
+ /**
843
+ * A convenience link that opts into the experimental View Transition API.
844
+ * It keeps normal anchor behavior when the feature is disabled or unsupported.
845
+ */
846
+ function TransitionLink(props) {
847
+ return /* @__PURE__ */ jsx(Link, {
848
+ ...props,
849
+ transition: true
850
+ });
851
+ }
852
+ /**
853
+ * A primitive NavLink component that provides active state detection.
854
+ */
855
+ function NavLink(props) {
856
+ const { href, to, end = false, className, children, ...rest } = props;
857
+ const location = useLocation();
858
+ const localizedHref = useLocalizedTo(href ?? to ?? "");
859
+ const isActive = end ? location.pathname === localizedHref : location.pathname.startsWith(localizedHref);
860
+ const resolvedClassName = typeof className === "function" ? className({ isActive }) : cn(className, isActive && "active");
861
+ const resolvedChildren = typeof children === "function" ? children({ isActive }) : children;
862
+ return /* @__PURE__ */ jsx(Link, {
863
+ ...rest,
864
+ href,
865
+ to,
866
+ className: resolvedClassName,
867
+ children: resolvedChildren
868
+ });
869
+ }
870
+
871
+ //#endregion
872
+ export { Languages as A, TextAlignStart as B, FaceBad as C, Hash as D, FileText as E, Moon as F, useOptionalConfig as G, icons_exports as H, MoreVertical as I, BoltdocsProvider as K, Pencil as L, Link$1 as M, Menu as N, Home as O, Monitor as P, Search as R, ExternalLink as S, FaceRegular as T, ConfigContext as U, X as V, useConfig as W, ChevronLeft as _, useViewTransition as a, Copy as b, RoutesProvider as c, resolvePublicAssetUrl as d, AlertCircle as f, ChevronDown as g, Check as h, startViewTransition as i, Lightbulb as j, Info as k, useRoutesContext as l, ArrowLeft as m, NavLink as n, cn as o, AlertTriangle as p, useBoltdocsContext as q, TransitionLink as r, useLocalizedTo as s, Link as t, normalizePath as u, ChevronRight as v, FaceGood as w, CornerDownLeft as x, CircleHelp as y, Sun as z };