@unterberg/nivel 0.0.1 → 0.0.3

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 (55) hide show
  1. package/README.md +115 -0
  2. package/bin/nivel.mjs +3 -0
  3. package/dist/{chunk-73NPVCDQ.js → chunk-D7IAGT53.js} +56 -26
  4. package/dist/chunk-D7IAGT53.js.map +1 -0
  5. package/dist/chunk-DNCQR5NH.js +231 -0
  6. package/dist/chunk-DNCQR5NH.js.map +1 -0
  7. package/dist/{chunk-3JJ6TYWL.js → chunk-FARXFRHG.js} +120 -83
  8. package/dist/chunk-FARXFRHG.js.map +1 -0
  9. package/dist/chunk-K5ZYRA3G.js +198 -0
  10. package/dist/chunk-K5ZYRA3G.js.map +1 -0
  11. package/dist/{chunk-4WTEOEV2.js → chunk-L6ZVB6XH.js} +3 -3
  12. package/dist/chunk-L6ZVB6XH.js.map +1 -0
  13. package/dist/{chunk-FLO5CJZH.js → chunk-PYYPYIBD.js} +10 -3
  14. package/dist/chunk-PYYPYIBD.js.map +1 -0
  15. package/dist/{chunk-45CLUNJW.js → chunk-Q7JU4J6A.js} +69 -33
  16. package/dist/chunk-Q7JU4J6A.js.map +1 -0
  17. package/dist/chunk-UDOIFPCZ.js +1538 -0
  18. package/dist/chunk-UDOIFPCZ.js.map +1 -0
  19. package/dist/cli.d.ts +3 -0
  20. package/dist/cli.js +78 -0
  21. package/dist/cli.js.map +1 -0
  22. package/dist/client.d.ts +4 -8
  23. package/dist/client.js +4 -4
  24. package/dist/index.d.ts +8 -12
  25. package/dist/index.js +4 -8
  26. package/dist/{code-blocks.d.ts → mdx/code-blocks.d.ts} +3 -1
  27. package/dist/{code-blocks.js → mdx/code-blocks.js} +5 -3
  28. package/dist/mdx.js +4 -4
  29. package/dist/mdx.js.map +1 -1
  30. package/dist/runtime/client.d.ts +1 -1
  31. package/dist/runtime/client.js +4 -4
  32. package/dist/runtime/node.d.ts +23 -0
  33. package/dist/runtime/node.js +24 -0
  34. package/dist/{types-mvLNHHrf.d.ts → types-j0kEkMA4.d.ts} +47 -24
  35. package/dist/{config.js → vike.js} +9 -8
  36. package/dist/vike.js.map +1 -0
  37. package/package.json +25 -16
  38. package/tailwind-sources.css +1 -0
  39. package/assets/nivel/decorators/pattern-light.png +0 -0
  40. package/assets/nivel/decorators/pattern.png +0 -0
  41. package/dist/chunk-3JJ6TYWL.js.map +0 -1
  42. package/dist/chunk-45CLUNJW.js.map +0 -1
  43. package/dist/chunk-4WTEOEV2.js.map +0 -1
  44. package/dist/chunk-62MBEYU7.js +0 -1091
  45. package/dist/chunk-62MBEYU7.js.map +0 -1
  46. package/dist/chunk-73NPVCDQ.js.map +0 -1
  47. package/dist/chunk-FLO5CJZH.js.map +0 -1
  48. package/dist/chunk-PHHK2BAF.js +0 -350
  49. package/dist/chunk-PHHK2BAF.js.map +0 -1
  50. package/dist/config.js.map +0 -1
  51. package/dist/runtime/index.d.ts +0 -15
  52. package/dist/runtime/index.js +0 -18
  53. /package/dist/{code-blocks.js.map → mdx/code-blocks.js.map} +0 -0
  54. /package/dist/runtime/{index.js.map → node.js.map} +0 -0
  55. /package/dist/{config.d.ts → vike.d.ts} +0 -0
@@ -0,0 +1,1538 @@
1
+ import {
2
+ UniversalMdxProvider,
3
+ renderInlineMarkdown
4
+ } from "./chunk-L6ZVB6XH.js";
5
+ import {
6
+ createHeadingSlugger,
7
+ getActiveSectionByPathname,
8
+ getResolvedPageByPathname,
9
+ getResolvedSectionById,
10
+ isSamePagePathname,
11
+ normalizeHeadingTitle
12
+ } from "./chunk-D7IAGT53.js";
13
+ import {
14
+ withSiteBaseUrl
15
+ } from "./chunk-PYYPYIBD.js";
16
+
17
+ // src/runtime/client/AppLayout.tsx
18
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
19
+ import { useState as useState5 } from "react";
20
+ import { usePageContext as usePageContext3 } from "vike-react/usePageContext";
21
+
22
+ // src/runtime/client/components/Navbar/index.tsx
23
+ import cm2, { cmMerge as cmMerge4 } from "@classmatejs/react";
24
+ import { ChevronDown } from "lucide-react";
25
+ import { useCallback, useEffect as useEffect4, useMemo, useRef as useRef2, useState as useState4 } from "react";
26
+ import { usePageContext as usePageContext2 } from "vike-react/usePageContext";
27
+
28
+ // src/runtime/client/docsGlobalContext.ts
29
+ import { usePageContext } from "vike-react/usePageContext";
30
+ var getDocsGlobalContext = (pageContext) => {
31
+ const docs = pageContext.globalContext?.docs;
32
+ if (!docs) {
33
+ throw new Error("Missing docs global context data.");
34
+ }
35
+ return docs;
36
+ };
37
+ var useDocsGlobalContext = () => {
38
+ return getDocsGlobalContext(usePageContext());
39
+ };
40
+
41
+ // src/runtime/client/components/Brand.tsx
42
+ import { cmMerge } from "@classmatejs/react";
43
+ import { jsx, jsxs } from "react/jsx-runtime";
44
+ var Brand = ({ brand, noText = false }) => {
45
+ const defaultLogo = brand.logoLight ?? brand.logoDark;
46
+ return /* @__PURE__ */ jsxs("a", { href: brand.href, className: "flex items-center gap-3 text-base-content no-underline", children: [
47
+ defaultLogo && /* @__PURE__ */ jsxs("span", { className: "relative block h-7 w-7 shrink-0", children: [
48
+ brand.logoLight && /* @__PURE__ */ jsx(
49
+ "img",
50
+ {
51
+ src: brand.logoLight,
52
+ alt: brand.logoAlt,
53
+ className: cmMerge("h-7 w-7 object-contain", brand.logoDark ? "block dark:hidden" : "block")
54
+ }
55
+ ),
56
+ brand.logoDark && /* @__PURE__ */ jsx(
57
+ "img",
58
+ {
59
+ src: brand.logoDark,
60
+ alt: brand.logoAlt,
61
+ className: cmMerge("h-7 w-7 object-contain", brand.logoLight ? "hidden dark:block" : "block")
62
+ }
63
+ )
64
+ ] }),
65
+ !noText && /* @__PURE__ */ jsx("span", { className: "text-xl font-semibold tracking-tight", children: brand.text })
66
+ ] });
67
+ };
68
+
69
+ // src/runtime/client/components/LayoutComponent.tsx
70
+ import cm from "@classmatejs/react";
71
+ var LayoutSize = {
72
+ xxs: "xxs",
73
+ xs: "xs",
74
+ sm: "sm",
75
+ md: "md",
76
+ lg: "lg",
77
+ xl: "xl",
78
+ full: "full"
79
+ };
80
+ var layoutComponentSizeMapping = {
81
+ xxs: "max-w-[480px]",
82
+ xs: "max-w-[768px]",
83
+ sm: "max-w-5xl",
84
+ md: "max-w-6xl",
85
+ lg: "max-w-7xl",
86
+ xl: "max-w-[1440px]",
87
+ full: "max-w-full"
88
+ };
89
+ var LayoutComponent = cm.div.variants({
90
+ base: ({ $noGrow }) => `px-4 ${$noGrow ? "" : "mx-auto w-full"} relative`,
91
+ variants: {
92
+ $size: layoutComponentSizeMapping
93
+ },
94
+ defaultVariants: {
95
+ $size: LayoutSize.xl
96
+ }
97
+ });
98
+
99
+ // src/runtime/client/components/Search.tsx
100
+ import { cmMerge as cmMerge2 } from "@classmatejs/react";
101
+ import { useQuery } from "@tanstack/react-query";
102
+ import { ArrowRightFromLine, MessageCircleQuestion, Search as SearchIcon, TriangleAlert } from "lucide-react";
103
+ import { useEffect, useRef, useState } from "react";
104
+ import { createPortal } from "react-dom";
105
+
106
+ // src/runtime/client/search.ts
107
+ var hierarchyLevels = ["lvl0", "lvl1", "lvl2", "lvl3", "lvl4", "lvl5", "lvl6"];
108
+ var stripHtml = (value) => value.replace(/<[^>]+>/g, "");
109
+ var normalizeString = (value) => {
110
+ if (typeof value === "string") {
111
+ const normalized = stripHtml(value).replace(/\s+/g, " ").trim();
112
+ return normalized || void 0;
113
+ }
114
+ if (typeof value === "number" || typeof value === "boolean") {
115
+ return String(value);
116
+ }
117
+ return void 0;
118
+ };
119
+ var getValueAtPath = (value, path) => {
120
+ if (!path) {
121
+ return void 0;
122
+ }
123
+ const segments = path.split(".").filter(Boolean);
124
+ let currentValue = value;
125
+ for (const segment of segments) {
126
+ if (!currentValue || typeof currentValue !== "object" || Array.isArray(currentValue)) {
127
+ return void 0;
128
+ }
129
+ currentValue = currentValue[segment];
130
+ }
131
+ return currentValue;
132
+ };
133
+ var getMappedString = (value, path) => {
134
+ return normalizeString(getValueAtPath(value, path));
135
+ };
136
+ var buildSearchUrl = (appId, indexName) => {
137
+ return `https://${appId}-dsn.algolia.net/1/indexes/${encodeURIComponent(indexName)}/query`;
138
+ };
139
+ var getDocSearchHierarchyValue = (hierarchy, level) => {
140
+ if (!hierarchy || typeof hierarchy !== "object") {
141
+ return void 0;
142
+ }
143
+ return normalizeString(hierarchy[level]);
144
+ };
145
+ var getDocSearchTitleLevel = (hit) => {
146
+ const levelFromType = typeof hit.type === "string" && /^lvl[0-6]$/.test(hit.type) ? hit.type : null;
147
+ if (levelFromType && getDocSearchHierarchyValue(hit.hierarchy, levelFromType)) {
148
+ return levelFromType;
149
+ }
150
+ return [...hierarchyLevels].reverse().find((level) => level !== "lvl0" && getDocSearchHierarchyValue(hit.hierarchy, level));
151
+ };
152
+ var getDocSearchFallbackResult = (hit) => {
153
+ const docSearchHit = hit;
154
+ const titleLevel = getDocSearchTitleLevel(docSearchHit);
155
+ const title = titleLevel ? getDocSearchHierarchyValue(docSearchHit.hierarchy, titleLevel) : void 0;
156
+ const titleLevelIndex = titleLevel ? hierarchyLevels.indexOf(titleLevel) : -1;
157
+ const sectionTitle = hierarchyLevels.slice(0, Math.max(titleLevelIndex, 0)).reverse().map((level) => getDocSearchHierarchyValue(docSearchHit.hierarchy, level)).find(Boolean) ?? normalizeString(docSearchHit.category);
158
+ return {
159
+ href: normalizeString(docSearchHit.url) ?? normalizeString(docSearchHit.url_without_anchor),
160
+ title: title ?? normalizeString(docSearchHit.category),
161
+ excerpt: normalizeString(docSearchHit._snippetResult?.content?.value) ?? normalizeString(docSearchHit.content) ?? normalizeString(docSearchHit._highlightResult?.content?.value),
162
+ sectionTitle
163
+ };
164
+ };
165
+ var mapHitToSearchResult = (hit, config) => {
166
+ const docSearchFallback = getDocSearchFallbackResult(hit);
167
+ const href = getMappedString(hit, config.fields.href) ?? docSearchFallback.href;
168
+ const title = getMappedString(hit, config.fields.title) ?? docSearchFallback.title;
169
+ if (!href || !title) {
170
+ return null;
171
+ }
172
+ const excerpt = getMappedString(hit, config.fields.excerpt) ?? docSearchFallback.excerpt;
173
+ const sectionTitle = getMappedString(hit, config.fields.sectionTitle) ?? docSearchFallback.sectionTitle;
174
+ return {
175
+ href,
176
+ title,
177
+ excerpt,
178
+ sectionTitle
179
+ };
180
+ };
181
+ var searchAlgoliaIndex = async (options) => {
182
+ const { config, query, signal } = options;
183
+ const response = await fetch(buildSearchUrl(config.appId, config.indexName), {
184
+ method: "POST",
185
+ signal,
186
+ headers: {
187
+ accept: "application/json",
188
+ "content-type": "application/json",
189
+ "x-algolia-api-key": config.apiKey,
190
+ "x-algolia-application-id": config.appId
191
+ },
192
+ body: JSON.stringify({
193
+ query,
194
+ ...config.searchParams
195
+ })
196
+ });
197
+ if (!response.ok) {
198
+ throw new Error(`Algolia search request failed with status ${response.status}.`);
199
+ }
200
+ const data = await response.json();
201
+ return (data.hits ?? []).map((hit) => mapHitToSearchResult(hit, config)).filter((result) => result !== null);
202
+ };
203
+
204
+ // src/runtime/client/components/Search.tsx
205
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
206
+ var MIN_QUERY_LENGTH = 2;
207
+ var QUERY_DEBOUNCE_MS = 150;
208
+ var useDebouncedValue = (value, delayMs) => {
209
+ const [debouncedValue, setDebouncedValue] = useState(value);
210
+ useEffect(() => {
211
+ const timeoutId = window.setTimeout(() => {
212
+ setDebouncedValue(value);
213
+ }, delayMs);
214
+ return () => {
215
+ window.clearTimeout(timeoutId);
216
+ };
217
+ }, [delayMs, value]);
218
+ return debouncedValue;
219
+ };
220
+ var Search = ({ algolia }) => {
221
+ const [isOpen, setIsOpen] = useState(false);
222
+ const [query, setQuery] = useState("");
223
+ const [isSearchHovered, setIsSearchHovered] = useState(false);
224
+ const containerRef = useRef(null);
225
+ const suggestionBoxRef = useRef(null);
226
+ const debouncedQuery = useDebouncedValue(query, QUERY_DEBOUNCE_MS);
227
+ const normalizedQuery = debouncedQuery.trim();
228
+ const canSearch = Boolean(algolia) && normalizedQuery.length >= MIN_QUERY_LENGTH;
229
+ const searchQuery = useQuery({
230
+ queryKey: ["nivel-algolia-search", algolia?.appId, algolia?.indexName, normalizedQuery],
231
+ queryFn: ({ signal }) => searchAlgoliaIndex({ config: algolia, query: normalizedQuery, signal }),
232
+ enabled: isOpen && canSearch,
233
+ retry: false
234
+ });
235
+ useEffect(() => {
236
+ if (!isOpen) {
237
+ return;
238
+ }
239
+ const handlePointerDown = (event) => {
240
+ const target = event.target;
241
+ if (!containerRef.current?.contains(target) && !suggestionBoxRef.current?.contains(target)) {
242
+ setIsOpen(false);
243
+ }
244
+ };
245
+ const handleKeyDown = (event) => {
246
+ if (event.key === "Escape") {
247
+ setIsOpen(false);
248
+ }
249
+ };
250
+ document.addEventListener("pointerdown", handlePointerDown);
251
+ document.addEventListener("keydown", handleKeyDown);
252
+ return () => {
253
+ document.removeEventListener("pointerdown", handlePointerDown);
254
+ document.removeEventListener("keydown", handleKeyDown);
255
+ };
256
+ }, [isOpen]);
257
+ if (!algolia) {
258
+ return null;
259
+ }
260
+ return /* @__PURE__ */ jsxs2("div", { ref: containerRef, className: "relative", children: [
261
+ /* @__PURE__ */ jsx2("div", { className: "hidden md:block", children: /* @__PURE__ */ jsxs2(
262
+ "label",
263
+ {
264
+ className: cmMerge2(
265
+ "input input-sm w-56 transition-all",
266
+ isSearchHovered ? "border-primary-muted shadow-lg shadow-primary-muted-light" : "shadow-transparent"
267
+ ),
268
+ onMouseEnter: () => setIsSearchHovered(true),
269
+ onMouseLeave: () => setIsSearchHovered(false),
270
+ children: [
271
+ /* @__PURE__ */ jsx2("span", { className: "label", children: /* @__PURE__ */ jsx2(SearchIcon, { className: "h-4 w-4 shrink-0" }) }),
272
+ /* @__PURE__ */ jsx2(
273
+ "input",
274
+ {
275
+ type: "text",
276
+ value: query,
277
+ placeholder: "Search docs",
278
+ className: cmMerge2(
279
+ "w-full placeholder:text-base-muted-medium transition-colors",
280
+ isSearchHovered && "placeholder:text-base-muted"
281
+ ),
282
+ onFocus: () => {
283
+ setIsOpen(true);
284
+ },
285
+ onChange: (event) => {
286
+ setQuery(event.target.value);
287
+ setIsOpen(true);
288
+ }
289
+ }
290
+ )
291
+ ]
292
+ }
293
+ ) }),
294
+ /* @__PURE__ */ jsx2(
295
+ "button",
296
+ {
297
+ type: "button",
298
+ className: "btn btn-ghost btn-square md:hidden",
299
+ "aria-label": "Search docs",
300
+ onClick: () => {
301
+ setIsOpen(true);
302
+ },
303
+ children: /* @__PURE__ */ jsx2(SearchIcon, { className: "h-4 w-4" })
304
+ }
305
+ ),
306
+ /* @__PURE__ */ jsx2(
307
+ SearchSuggestionBox,
308
+ {
309
+ contentRef: suggestionBoxRef,
310
+ isError: searchQuery.isError,
311
+ isLoading: searchQuery.isFetching,
312
+ isOpen,
313
+ onClose: () => {
314
+ setIsOpen(false);
315
+ },
316
+ onQueryChange: (nextQuery) => {
317
+ setQuery(nextQuery);
318
+ setIsOpen(true);
319
+ },
320
+ query,
321
+ results: searchQuery.data ?? []
322
+ }
323
+ )
324
+ ] });
325
+ };
326
+ var SearchSuggestionBox = ({
327
+ contentRef,
328
+ isError,
329
+ isLoading,
330
+ isOpen,
331
+ onClose,
332
+ onQueryChange,
333
+ query,
334
+ results
335
+ }) => {
336
+ const inputRef = useRef(null);
337
+ const normalizedQuery = query.trim();
338
+ const canSearch = normalizedQuery.length >= MIN_QUERY_LENGTH;
339
+ useEffect(() => {
340
+ if (!isOpen) {
341
+ return;
342
+ }
343
+ const frameId = window.requestAnimationFrame(() => {
344
+ inputRef.current?.focus();
345
+ inputRef.current?.setSelectionRange(query.length, query.length);
346
+ });
347
+ return () => {
348
+ window.cancelAnimationFrame(frameId);
349
+ };
350
+ }, [isOpen, query.length]);
351
+ if (!isOpen || typeof document === "undefined") {
352
+ return null;
353
+ }
354
+ return createPortal(
355
+ /* @__PURE__ */ jsxs2("div", { className: "fixed inset-0 z-30 h-full w-full bg-base-100/50 backdrop-blur-lg", children: [
356
+ /* @__PURE__ */ jsx2("div", { className: "absolute inset-0 z-1 bg-linear-to-b from-base-100 via-base-100 via-25% to-primary-muted-superlight dark:bg-linear-to-t" }),
357
+ /* @__PURE__ */ jsxs2(
358
+ LayoutComponent,
359
+ {
360
+ ref: contentRef,
361
+ $size: "sm",
362
+ className: "mt-5 relative z-2 pt-6 p-6 bg-base-100/70 rounded-box shadow-lg shadow-primary-muted-light",
363
+ children: [
364
+ /* @__PURE__ */ jsx2(
365
+ "input",
366
+ {
367
+ placeholder: "Search docs",
368
+ ref: inputRef,
369
+ type: "text",
370
+ className: "input input-primary input-xl w-full",
371
+ value: query,
372
+ onChange: (event) => onQueryChange(event.target.value)
373
+ }
374
+ ),
375
+ /* @__PURE__ */ jsx2("div", { className: "flex h-7 items-center px-4 text-xs text-base-muted", children: isLoading ? /* @__PURE__ */ jsxs2("span", { className: "flex items-center gap-1", children: [
376
+ /* @__PURE__ */ jsx2("span", { className: "loading loading-dots loading-xs" }),
377
+ "Searching..."
378
+ ] }) : normalizedQuery ? null : /* @__PURE__ */ jsxs2("span", { className: "flex items-center gap-1", children: [
379
+ /* @__PURE__ */ jsx2(MessageCircleQuestion, { className: "h-3 w-3 shrink-0" }),
380
+ "Type at least ",
381
+ MIN_QUERY_LENGTH,
382
+ " characters."
383
+ ] }) }),
384
+ normalizedQuery ? isError ? /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 rounded-box border border-warning/40 bg-base-100 p-4 text-sm text-base-muted shadow-md shadow-primary-muted-light", children: [
385
+ /* @__PURE__ */ jsx2(TriangleAlert, { className: "h-4 w-4 shrink-0 text-warning" }),
386
+ "Search is temporarily unavailable."
387
+ ] }) : !canSearch ? /* @__PURE__ */ jsx2("div", { className: "text-sm text-base-muted", children: "Keep typing to search." }) : !isLoading && results.length === 0 ? /* @__PURE__ */ jsx2("div", { className: "text-sm text-base-muted", children: "No results found." }) : /* @__PURE__ */ jsx2("div", { className: "max-h-80 overflow-y-auto -mx-2 p-2", children: /* @__PURE__ */ jsx2("ul", { className: "flex flex-col gap-2", children: results.map((result) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsxs2(
388
+ "a",
389
+ {
390
+ href: withSiteBaseUrl(result.href),
391
+ className: "block rounded-box border border-base-muted-medium bg-base-100 p-4 hover:border-primary-muted hover:bg-base-200 shadow-md",
392
+ onClick: onClose,
393
+ children: [
394
+ /* @__PURE__ */ jsxs2("div", { className: "mb-2 flex items-center justify-start gap-2", children: [
395
+ /* @__PURE__ */ jsx2("div", { className: "text-base-content font-bold", children: result.title }),
396
+ result.sectionTitle ? /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1 text-sm text-base-muted-medium", children: [
397
+ /* @__PURE__ */ jsx2(ArrowRightFromLine, { className: "h-3 w-3" }),
398
+ " ",
399
+ result.sectionTitle
400
+ ] }) : null
401
+ ] }),
402
+ result.excerpt ? /* @__PURE__ */ jsx2("p", { className: "text-xs leading-5 text-base-muted", children: result.excerpt }) : null
403
+ ]
404
+ }
405
+ ) }, result.href)) }) }) : null
406
+ ]
407
+ }
408
+ )
409
+ ] }),
410
+ document.body
411
+ );
412
+ };
413
+
414
+ // src/runtime/client/components/ThemeSwitch.tsx
415
+ import { Moon, Sun } from "lucide-react";
416
+
417
+ // src/runtime/client/store/settings-store.ts
418
+ import { create } from "zustand";
419
+ import { createJSONStorage, persist } from "zustand/middleware";
420
+
421
+ // src/runtime/client/store/settings-storage.ts
422
+ var USER_SETTINGS_STORAGE_KEY = "nivel-user-settings";
423
+ var LEGACY_CODE_BLOCK_CHOICE_STORAGE_KEY_PREFIX = "vike-docpress:choice:";
424
+ var readLegacyCodeBlockChoice = (choiceGroupName) => {
425
+ if (typeof window === "undefined") {
426
+ return null;
427
+ }
428
+ try {
429
+ const value = window.localStorage.getItem(`${LEGACY_CODE_BLOCK_CHOICE_STORAGE_KEY_PREFIX}${choiceGroupName}`);
430
+ return value || null;
431
+ } catch {
432
+ return null;
433
+ }
434
+ };
435
+
436
+ // src/runtime/client/store/settings-store.ts
437
+ var useDocsUserSettingsStore = create()(
438
+ persist(
439
+ (set) => ({
440
+ codeBlockChoices: {},
441
+ themePreference: null,
442
+ setCodeBlockChoice: (choiceGroupName, choice) => set((state) => ({
443
+ codeBlockChoices: {
444
+ ...state.codeBlockChoices,
445
+ [choiceGroupName]: choice
446
+ }
447
+ })),
448
+ setThemePreference: (themePreference) => set({ themePreference })
449
+ }),
450
+ {
451
+ name: USER_SETTINGS_STORAGE_KEY,
452
+ storage: createJSONStorage(() => localStorage),
453
+ partialize: ({ codeBlockChoices, themePreference }) => ({
454
+ codeBlockChoices,
455
+ themePreference
456
+ })
457
+ }
458
+ )
459
+ );
460
+ var docsCodeBlockChoiceStore = {
461
+ subscribe: (listener) => useDocsUserSettingsStore.subscribe(listener),
462
+ getChoice: (choiceGroupName) => useDocsUserSettingsStore.getState().codeBlockChoices[choiceGroupName] ?? null,
463
+ setChoice: (choiceGroupName, choice) => useDocsUserSettingsStore.getState().setCodeBlockChoice(choiceGroupName, choice),
464
+ getLegacyChoice: readLegacyCodeBlockChoice
465
+ };
466
+
467
+ // src/runtime/client/theme.ts
468
+ var DEFAULT_THEME_PREFERENCE = "light";
469
+ var DARK_THEME_MEDIA_QUERY = "(prefers-color-scheme: dark)";
470
+ var getDataTheme = (themePreference, themeConfig) => {
471
+ return themePreference === "dark" ? themeConfig.dark : themeConfig.light;
472
+ };
473
+ var isThemePreference = (value) => {
474
+ return value === "light" || value === "dark";
475
+ };
476
+ var getSystemThemePreference = (fallbackThemePreference) => {
477
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
478
+ return fallbackThemePreference;
479
+ }
480
+ return window.matchMedia(DARK_THEME_MEDIA_QUERY).matches ? "dark" : "light";
481
+ };
482
+ var resolveThemePreference = (themePreference, themeConfig) => {
483
+ if (isThemePreference(themePreference)) {
484
+ return themePreference;
485
+ }
486
+ return getSystemThemePreference(themeConfig.defaultPreference);
487
+ };
488
+ var applyThemePreference = (themePreference, themeConfig) => {
489
+ if (typeof document === "undefined") {
490
+ return;
491
+ }
492
+ document.documentElement.setAttribute(
493
+ "data-theme",
494
+ getDataTheme(resolveThemePreference(themePreference, themeConfig), themeConfig)
495
+ );
496
+ };
497
+
498
+ // src/runtime/client/components/ThemeSwitch.tsx
499
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
500
+ var ThemeSwitch = ({ theme }) => {
501
+ const themePreference = useDocsUserSettingsStore((state) => state.themePreference);
502
+ const setThemePreference = useDocsUserSettingsStore((state) => state.setThemePreference);
503
+ const effectiveThemePreference = resolveThemePreference(themePreference, theme);
504
+ return /* @__PURE__ */ jsxs3(
505
+ "button",
506
+ {
507
+ type: "button",
508
+ "aria-label": "Toggle theme",
509
+ onClick: () => setThemePreference(effectiveThemePreference === "light" ? "dark" : "light"),
510
+ className: "relative flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-base-muted-light bg-base-200",
511
+ children: [
512
+ /* @__PURE__ */ jsx3(Sun, { className: "h-4 w-4 dark:hidden" }),
513
+ /* @__PURE__ */ jsx3(Moon, { className: "hidden h-4 w-4 dark:block" })
514
+ ]
515
+ }
516
+ );
517
+ };
518
+
519
+ // src/runtime/client/components/Navbar/MegaMenu/index.tsx
520
+ import { cmMerge as cmMerge3 } from "@classmatejs/react";
521
+ import { useEffect as useEffect2, useState as useState2 } from "react";
522
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
523
+ var MegaMenu = ({
524
+ isActive,
525
+ onOpen,
526
+ onClose,
527
+ sections,
528
+ activeSectionId,
529
+ hoveredSectionId
530
+ }) => {
531
+ const visibleSectionId = hoveredSectionId ?? activeSectionId ?? sections[0]?.id;
532
+ const [visibleSectionElement, setVisibleSectionElement] = useState2(null);
533
+ const [contentHeight, setContentHeight] = useState2(0);
534
+ useEffect2(() => {
535
+ if (!visibleSectionId || visibleSectionElement === null) {
536
+ return;
537
+ }
538
+ const updateContentHeight = () => {
539
+ setContentHeight(visibleSectionElement.offsetHeight);
540
+ };
541
+ updateContentHeight();
542
+ if (typeof ResizeObserver === "undefined") {
543
+ return;
544
+ }
545
+ const resizeObserver = new ResizeObserver(() => {
546
+ updateContentHeight();
547
+ });
548
+ resizeObserver.observe(visibleSectionElement);
549
+ return () => {
550
+ resizeObserver.disconnect();
551
+ };
552
+ }, [visibleSectionElement, visibleSectionId]);
553
+ return (
554
+ // biome-ignore lint/a11y/noStaticElementInteractions: ok
555
+ /* @__PURE__ */ jsxs4(
556
+ "div",
557
+ {
558
+ className: cmMerge3(
559
+ "fixed top-13 left-0 z-3 w-full pt-3",
560
+ isActive ? "pointer-events-auto" : "pointer-events-none"
561
+ ),
562
+ onPointerEnter: () => onOpen(visibleSectionId),
563
+ onPointerLeave: onClose,
564
+ children: [
565
+ /* @__PURE__ */ jsx4(
566
+ "div",
567
+ {
568
+ className: cmMerge3(
569
+ isActive ? "opacity-100" : "opacity-0",
570
+ "pointer-events-none absolute top-0 left-0 h-svh w-full bg-linear-to-t from-base-100/60 to-base-100 transition-opacity duration-200 backdrop-blur-md"
571
+ )
572
+ }
573
+ ),
574
+ /* @__PURE__ */ jsx4(
575
+ "div",
576
+ {
577
+ className: cmMerge3(
578
+ "relative z-4 overflow-hidden bg-base-100 transition-[height] duration-300 ease-out border-b border-base-muted-light"
579
+ ),
580
+ style: { height: isActive ? contentHeight : 0 },
581
+ children: /* @__PURE__ */ jsx4(LayoutComponent, { $size: "sm", children: /* @__PURE__ */ jsx4(
582
+ "div",
583
+ {
584
+ className: cmMerge3(
585
+ isActive ? "translate-y-0 opacity-100" : "-translate-y-10 opacity-0",
586
+ "relative z-4 transition-all duration-300"
587
+ ),
588
+ children: sections.map((section) => /* @__PURE__ */ jsx4(
589
+ "div",
590
+ {
591
+ ref: section.id === visibleSectionId ? setVisibleSectionElement : void 0,
592
+ className: cmMerge3(
593
+ section.id === visibleSectionId ? "opacity-100" : "opacity-0 pointer-events-none",
594
+ "transition-all absolute w-full duration-300"
595
+ ),
596
+ children: section.items.length > 0 && /* @__PURE__ */ jsx4("ul", { className: "mt-2 flex ", children: section.items.map(
597
+ (child) => child.showInNav !== false && /* @__PURE__ */ jsxs4("li", { className: "flex-1 py-3 mb-6 px-4", children: [
598
+ child.href ? /* @__PURE__ */ jsx4(
599
+ "a",
600
+ {
601
+ className: "mb-4 block text-lg font-semibold tracking-tight",
602
+ href: withSiteBaseUrl(child.href),
603
+ children: child.title
604
+ }
605
+ ) : /* @__PURE__ */ jsx4("span", { className: "mb-4 block text-lg font-semibold tracking-tight", children: child.title }),
606
+ child.kind === "group" && child.items.length > 0 && /* @__PURE__ */ jsx4("ul", { className: "menu border-l border-base-muted-light py-0 w-full", children: child.items.map((subChild) => /* @__PURE__ */ jsx4("li", { children: subChild.href ? /* @__PURE__ */ jsx4("a", { href: withSiteBaseUrl(subChild.href), onClick: onClose, children: renderInlineMarkdown(subChild.title) }) : /* @__PURE__ */ jsx4("span", { children: renderInlineMarkdown(subChild.title) }) }, subChild.id)) })
607
+ ] }, child.id)
608
+ ) })
609
+ },
610
+ section.id
611
+ ))
612
+ }
613
+ ) })
614
+ }
615
+ )
616
+ ]
617
+ }
618
+ )
619
+ );
620
+ };
621
+
622
+ // src/runtime/client/components/Navbar/useNavbarScroll.ts
623
+ import { useEffect as useEffect3, useState as useState3 } from "react";
624
+ var useNavbarScroll = (isLandingPage) => {
625
+ const [isLandingPageScrolled, setIsLandingPageScrolled] = useState3(false);
626
+ useEffect3(() => {
627
+ if (!isLandingPage) {
628
+ setIsLandingPageScrolled(false);
629
+ return;
630
+ }
631
+ const handleScroll = () => {
632
+ setIsLandingPageScrolled(window.scrollY > 20);
633
+ };
634
+ handleScroll();
635
+ window.addEventListener("scroll", handleScroll, { passive: true });
636
+ return () => {
637
+ window.removeEventListener("scroll", handleScroll);
638
+ };
639
+ }, [isLandingPage]);
640
+ return {
641
+ isLandingPageScrolled
642
+ };
643
+ };
644
+
645
+ // src/runtime/client/components/Navbar/index.tsx
646
+ import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
647
+ var Navbar = ({ brand, algolia, navbarItems, theme, sections }) => {
648
+ const { urlPathname } = usePageContext2();
649
+ const isLandingPage = urlPathname === "/";
650
+ const { isLandingPageScrolled } = useNavbarScroll(isLandingPage);
651
+ const [isMegaMenuOpen, setIsMegaMenuOpen] = useState4(false);
652
+ const megaMenuCloseTimeoutRef = useRef2(null);
653
+ const pageContext = usePageContext2();
654
+ const docs = getDocsGlobalContext(pageContext);
655
+ const activeSection = getActiveSectionByPathname(docs, pageContext.urlPathname);
656
+ const [hoveredSectionId, setHoveredSectionId] = useState4(activeSection?.id ?? sections[0]?.id);
657
+ const showChrome = useMemo(
658
+ () => !isLandingPage || isLandingPageScrolled || !isMegaMenuOpen,
659
+ [isLandingPage, isLandingPageScrolled, isMegaMenuOpen]
660
+ );
661
+ const clearMegaMenuCloseTimeout = useCallback(() => {
662
+ if (megaMenuCloseTimeoutRef.current === null) {
663
+ return;
664
+ }
665
+ window.clearTimeout(megaMenuCloseTimeoutRef.current);
666
+ megaMenuCloseTimeoutRef.current = null;
667
+ }, []);
668
+ const openMegaMenu = (currentSectionId) => {
669
+ if (currentSectionId !== void 0) {
670
+ setHoveredSectionId(currentSectionId);
671
+ }
672
+ clearMegaMenuCloseTimeout();
673
+ setIsMegaMenuOpen(true);
674
+ };
675
+ const closeMegaMenu = () => {
676
+ clearMegaMenuCloseTimeout();
677
+ setIsMegaMenuOpen(false);
678
+ };
679
+ const scheduleMegaMenuClose = () => {
680
+ clearMegaMenuCloseTimeout();
681
+ megaMenuCloseTimeoutRef.current = window.setTimeout(() => {
682
+ setIsMegaMenuOpen(false);
683
+ megaMenuCloseTimeoutRef.current = null;
684
+ }, 120);
685
+ };
686
+ useEffect4(() => {
687
+ return () => {
688
+ clearMegaMenuCloseTimeout();
689
+ };
690
+ }, [clearMegaMenuCloseTimeout]);
691
+ return /* @__PURE__ */ jsxs5(Fragment, { children: [
692
+ /* @__PURE__ */ jsx5(StyledNavbar, { $border: showChrome, children: /* @__PURE__ */ jsx5(LayoutComponent, { className: "h-full", children: isLandingPage ? /* @__PURE__ */ jsxs5("div", { className: "relative z-3 flex h-full items-center justify-between py-4", children: [
693
+ /* @__PURE__ */ jsx5("div", { className: "flex flex-1 items-center gap-4", children: /* @__PURE__ */ jsx5(Brand, { brand }) }),
694
+ /* @__PURE__ */ jsx5(
695
+ "nav",
696
+ {
697
+ "aria-label": "Primary",
698
+ className: "top-0 left-0 flex min-w-0 flex-1 items-center justify-center gap-4 overflow-x-auto",
699
+ children: /* @__PURE__ */ jsx5("ul", { className: "flex items-center font-semibold", children: navbarItems.map((item) => /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
700
+ "a",
701
+ {
702
+ href: withSiteBaseUrl(item.href),
703
+ className: "h-full block py-3.25",
704
+ onPointerEnter: () => openMegaMenu(item.id),
705
+ onPointerLeave: scheduleMegaMenuClose,
706
+ onFocus: () => openMegaMenu(item.id),
707
+ onBlur: scheduleMegaMenuClose,
708
+ onClick: closeMegaMenu,
709
+ children: /* @__PURE__ */ jsxs5(
710
+ "span",
711
+ {
712
+ className: cmMerge4("btn text-lg btn-ghost min-w-30 px-2 whitespace-nowrap tracking-tight"),
713
+ children: [
714
+ renderInlineMarkdown(item.title),
715
+ /* @__PURE__ */ jsx5(ChevronDown, { className: "h-4 w-4 shrink-0" })
716
+ ]
717
+ }
718
+ )
719
+ }
720
+ ) }, item.id)) })
721
+ }
722
+ ),
723
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-1 items-center justify-end gap-2", children: [
724
+ /* @__PURE__ */ jsx5(Search, { algolia }),
725
+ /* @__PURE__ */ jsx5(ThemeSwitch, { theme })
726
+ ] })
727
+ ] }) : /* @__PURE__ */ jsxs5("div", { className: "relative z-3 flex h-full items-center justify-between py-4", children: [
728
+ /* @__PURE__ */ jsx5("div", { className: "flex w-80 flex-1 items-center justify-between gap-2 lg:flex-none", children: /* @__PURE__ */ jsx5(Brand, { brand }) }),
729
+ /* @__PURE__ */ jsxs5(
730
+ "nav",
731
+ {
732
+ "aria-label": "Primary",
733
+ className: "top-0 left-0 flex flex-1 items-center justify-start gap-4 overflow-x-auto lg:pl-6 xl:pl-10",
734
+ children: [
735
+ /* @__PURE__ */ jsx5("ul", { className: "flex items-center gap-2 font-semibold", children: navbarItems.map((item) => /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
736
+ "a",
737
+ {
738
+ href: withSiteBaseUrl(item.href),
739
+ onPointerEnter: () => openMegaMenu(item.id),
740
+ onPointerLeave: scheduleMegaMenuClose,
741
+ onFocus: () => openMegaMenu(item.id),
742
+ onBlur: scheduleMegaMenuClose,
743
+ onClick: closeMegaMenu,
744
+ className: cmMerge4(
745
+ "btn btn-sm px-2 whitespace-nowrap text-base tracking-tight",
746
+ item.id === activeSection?.id ? "btn-primary btn-soft" : "btn-ghost"
747
+ ),
748
+ children: renderInlineMarkdown(item.title)
749
+ }
750
+ ) }, item.id)) }),
751
+ /* @__PURE__ */ jsx5(Search, { algolia })
752
+ ]
753
+ }
754
+ ),
755
+ /* @__PURE__ */ jsx5("div", { className: "flex w-78 flex-1 items-center justify-end gap-2 lg:flex-none", children: /* @__PURE__ */ jsx5(ThemeSwitch, { theme }) })
756
+ ] }) }) }),
757
+ /* @__PURE__ */ jsx5(
758
+ MegaMenu,
759
+ {
760
+ sections,
761
+ activeSectionId: activeSection?.id,
762
+ hoveredSectionId,
763
+ isActive: isMegaMenuOpen,
764
+ onOpen: openMegaMenu,
765
+ onClose: scheduleMegaMenuClose
766
+ }
767
+ )
768
+ ] });
769
+ };
770
+ var StyledNavbar = cm2.header`
771
+ fixed top-0 left-0 z-20 h-16 w-full bg-base-100
772
+ `;
773
+
774
+ // src/runtime/client/components/UserSettingsSync.tsx
775
+ import { useEffect as useEffect5 } from "react";
776
+ var UserSettingsSync = ({ theme }) => {
777
+ const themePreference = useDocsUserSettingsStore((state) => state.themePreference);
778
+ const lightTheme = theme?.light ?? "consumer-light";
779
+ const darkTheme = theme?.dark ?? "consumer-dark";
780
+ const defaultThemePreference = theme?.defaultPreference ?? "light";
781
+ const resolvedTheme = { light: lightTheme, dark: darkTheme, defaultPreference: defaultThemePreference };
782
+ const effectiveThemePreference = resolveThemePreference(themePreference, resolvedTheme);
783
+ useEffect5(() => {
784
+ applyThemePreference(effectiveThemePreference, resolvedTheme);
785
+ }, [darkTheme, defaultThemePreference, effectiveThemePreference, lightTheme]);
786
+ return null;
787
+ };
788
+
789
+ // src/runtime/client/AppLayout.tsx
790
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
791
+ var AppLayout = ({ children }) => {
792
+ const pageContext = usePageContext3();
793
+ const docs = getDocsGlobalContext(pageContext);
794
+ const [queryClient] = useState5(() => new QueryClient());
795
+ return (
796
+ // todo: we should try vike-react-query instead
797
+ /* @__PURE__ */ jsxs6(QueryClientProvider, { client: queryClient, children: [
798
+ /* @__PURE__ */ jsx6(UserSettingsSync, { theme: docs.theme }),
799
+ /* @__PURE__ */ jsxs6("div", { className: "min-h-screen bg-base-100 text-base-content", children: [
800
+ /* @__PURE__ */ jsx6(
801
+ Navbar,
802
+ {
803
+ brand: docs.brand,
804
+ algolia: docs.algolia,
805
+ navbarItems: docs.navbarItems,
806
+ sections: docs.sidebarSections,
807
+ theme: docs.theme
808
+ }
809
+ ),
810
+ /* @__PURE__ */ jsx6("div", { className: "pt-16", children })
811
+ ] })
812
+ ] })
813
+ );
814
+ };
815
+
816
+ // src/runtime/client/components/MetaHead/FaviconLinks.tsx
817
+ import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
818
+ var FaviconLinks = ({ head }) => {
819
+ const { appleTouchIcon, faviconIco, faviconSvg } = head;
820
+ return /* @__PURE__ */ jsxs7(Fragment2, { children: [
821
+ appleTouchIcon && /* @__PURE__ */ jsx7("link", { rel: "apple-touch-icon", href: appleTouchIcon }),
822
+ faviconSvg && /* @__PURE__ */ jsx7("link", { rel: "icon", type: "image/svg+xml", href: faviconSvg }),
823
+ faviconIco && /* @__PURE__ */ jsxs7(Fragment2, { children: [
824
+ /* @__PURE__ */ jsx7("link", { rel: "shortcut icon", type: "image/x-icon", href: faviconIco }),
825
+ /* @__PURE__ */ jsx7("link", { rel: "icon", type: "image/x-icon", href: faviconIco })
826
+ ] })
827
+ ] });
828
+ };
829
+
830
+ // src/runtime/client/components/MetaHead/FontLinks.tsx
831
+ import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
832
+ var FontLinks = ({ head }) => {
833
+ const { fontStylesheetHref, fontPreloadHrefs } = head;
834
+ const effectivePreloadHrefs = fontPreloadHrefs ?? [];
835
+ return /* @__PURE__ */ jsxs8(Fragment3, { children: [
836
+ effectivePreloadHrefs.map((href) => /* @__PURE__ */ jsx8("link", { rel: "preload", href, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, href)),
837
+ fontStylesheetHref && /* @__PURE__ */ jsx8("link", { rel: "stylesheet", href: fontStylesheetHref })
838
+ ] });
839
+ };
840
+
841
+ // src/runtime/client/components/MetaHead/ThemeBootstrap.tsx
842
+ import { jsx as jsx9 } from "react/jsx-runtime";
843
+ var getThemeBootstrapScript = (theme) => {
844
+ return `(() => {
845
+ const storageKey = ${JSON.stringify(USER_SETTINGS_STORAGE_KEY)};
846
+ const darkThemeMediaQuery = ${JSON.stringify(DARK_THEME_MEDIA_QUERY)};
847
+ const defaultThemePreference = ${JSON.stringify(theme.defaultPreference)};
848
+ const themes = {
849
+ light: ${JSON.stringify(theme.light)},
850
+ dark: ${JSON.stringify(theme.dark)}
851
+ };
852
+
853
+ try {
854
+ const persistedValue = window.localStorage.getItem(storageKey);
855
+ const parsedValue = persistedValue ? JSON.parse(persistedValue) : null;
856
+ const storedThemePreference = parsedValue?.state?.themePreference;
857
+ const themePreference =
858
+ storedThemePreference === 'light' || storedThemePreference === 'dark'
859
+ ? storedThemePreference
860
+ : typeof window.matchMedia === 'function'
861
+ ? window.matchMedia(darkThemeMediaQuery).matches
862
+ ? 'dark'
863
+ : 'light'
864
+ : defaultThemePreference;
865
+
866
+ document.documentElement.setAttribute('data-theme', themes[themePreference]);
867
+ } catch {
868
+ const themePreference =
869
+ typeof window.matchMedia === 'function'
870
+ ? window.matchMedia(darkThemeMediaQuery).matches
871
+ ? 'dark'
872
+ : 'light'
873
+ : defaultThemePreference;
874
+
875
+ document.documentElement.setAttribute('data-theme', themes[themePreference]);
876
+ }
877
+ })();`;
878
+ };
879
+ var ThemeBootstrap = ({ theme }) => {
880
+ return /* @__PURE__ */ jsx9(
881
+ "script",
882
+ {
883
+ dangerouslySetInnerHTML: {
884
+ __html: getThemeBootstrapScript(theme)
885
+ }
886
+ }
887
+ );
888
+ };
889
+
890
+ // src/runtime/client/components/MetaHead/index.tsx
891
+ import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
892
+ var MetaHead = () => {
893
+ const docs = useDocsGlobalContext();
894
+ return /* @__PURE__ */ jsxs9(Fragment4, { children: [
895
+ /* @__PURE__ */ jsx10(ThemeBootstrap, { theme: docs.theme }),
896
+ /* @__PURE__ */ jsx10(FaviconLinks, { head: docs.head }),
897
+ /* @__PURE__ */ jsx10(FontLinks, { head: docs.head })
898
+ ] });
899
+ };
900
+
901
+ // src/runtime/client/components/ProseContainer.tsx
902
+ import cm3 from "@classmatejs/react";
903
+ var ProseContainer = cm3.section`
904
+ prose-container
905
+ `;
906
+
907
+ // src/runtime/client/DocsPage.tsx
908
+ import { useData as useData2 } from "vike-react/useData";
909
+ import { usePageContext as usePageContext4 } from "vike-react/usePageContext";
910
+
911
+ // src/runtime/client/components/DocsPagination.tsx
912
+ import { cmMerge as cmMerge5 } from "@classmatejs/react";
913
+ import { ChevronLeft, ChevronRight } from "lucide-react";
914
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
915
+ var PaginationCard = ({ item, direction, isOffset }) => {
916
+ const isPrevious = direction === "previous";
917
+ return /* @__PURE__ */ jsx11(
918
+ "a",
919
+ {
920
+ href: withSiteBaseUrl(item.href),
921
+ className: cmMerge5(
922
+ "group rounded-box border border-base-muted-light bg-base-100 p-5 no-underline hover:border-primary-muted-medium hover:bg-base-200",
923
+ isPrevious ? "text-left" : "text-right",
924
+ isOffset && "sm:col-start-2"
925
+ ),
926
+ "aria-label": `${isPrevious ? "Previous" : "Next"}: ${item.title}`,
927
+ children: /* @__PURE__ */ jsxs10("div", { className: "flex flex-col justify-between gap-2", children: [
928
+ /* @__PURE__ */ jsx11("p", { className: "text-lg font-semibold text-base-content", children: renderInlineMarkdown(item.title) }),
929
+ /* @__PURE__ */ jsxs10(
930
+ "div",
931
+ {
932
+ className: cmMerge5(
933
+ "flex items-center gap-1 text-base-muted group-hover:text-base-content",
934
+ isPrevious ? "justify-start" : "justify-end"
935
+ ),
936
+ children: [
937
+ isPrevious && /* @__PURE__ */ jsx11(ChevronLeft, { className: "h-4 w-4" }),
938
+ /* @__PURE__ */ jsx11("span", { children: isPrevious ? "Previous" : "Next" }),
939
+ !isPrevious && /* @__PURE__ */ jsx11(ChevronRight, { className: "h-4 w-4" })
940
+ ]
941
+ }
942
+ )
943
+ ] })
944
+ }
945
+ );
946
+ };
947
+ var DocsPagination = ({ previousPage, nextPage }) => {
948
+ if (!previousPage && !nextPage) {
949
+ return null;
950
+ }
951
+ return /* @__PURE__ */ jsx11("nav", { className: "mb-10 mt-16", "aria-label": "Previous Next", children: /* @__PURE__ */ jsxs10("div", { className: "grid gap-4 sm:grid-cols-2", children: [
952
+ previousPage && /* @__PURE__ */ jsx11(PaginationCard, { item: previousPage, direction: "previous" }),
953
+ nextPage && /* @__PURE__ */ jsx11(PaginationCard, { isOffset: !previousPage, item: nextPage, direction: "next" })
954
+ ] }) });
955
+ };
956
+
957
+ // src/runtime/client/components/Footer.tsx
958
+ import { Bug, Pencil } from "lucide-react";
959
+ import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
960
+ var DocsFooter = ({ brand }) => {
961
+ return /* @__PURE__ */ jsxs11("footer", { className: "mb-8 mt-12 text-sm border-t border-base-muted-light pt-10", children: [
962
+ /* @__PURE__ */ jsxs11("div", { className: "mb-16 flex items-center gap-2", children: [
963
+ /* @__PURE__ */ jsxs11("a", { href: "edit", className: "btn btn-sm btn-primary btn-soft", children: [
964
+ /* @__PURE__ */ jsx12(Pencil, { className: "w-3 h-3" }),
965
+ " Edit this page"
966
+ ] }),
967
+ /* @__PURE__ */ jsxs11("a", { href: "edit", className: "btn btn-sm btn-primary btn-soft", children: [
968
+ /* @__PURE__ */ jsx12(Bug, { className: "w-3 h-3" }),
969
+ " Report Issue"
970
+ ] })
971
+ ] }),
972
+ /* @__PURE__ */ jsx12("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ jsx12("div", { className: "flex gap-2 items-center", children: brand && /* @__PURE__ */ jsx12(Brand, { brand, noText: true }) }) })
973
+ ] });
974
+ };
975
+
976
+ // src/runtime/client/components/Sidebar.tsx
977
+ import { cmMerge as cmMerge6 } from "@classmatejs/react";
978
+ import { useEffect as useEffect6 } from "react";
979
+ import { create as create2 } from "zustand";
980
+
981
+ // src/runtime/client/components/docsNavigation.ts
982
+ var containsActiveHref = (items, currentHref) => {
983
+ return items.some((item) => {
984
+ if (item.kind === "page") {
985
+ return item.href === currentHref;
986
+ }
987
+ return item.href === currentHref || containsActiveHref(item.items, currentHref);
988
+ });
989
+ };
990
+ var hasActiveItem = (items, activeHref) => containsActiveHref(items, activeHref);
991
+ var getVisibleNavItems = (items) => items.filter((item) => item.showInNav);
992
+ var getVisibleGroupItems = (group) => {
993
+ const visibleItems = getVisibleNavItems(group.items);
994
+ if (!group.href) {
995
+ return visibleItems;
996
+ }
997
+ return visibleItems.filter((item) => {
998
+ if (item.kind !== "page") {
999
+ return true;
1000
+ }
1001
+ return item.href !== group.href;
1002
+ });
1003
+ };
1004
+ var getGroupHref = (group) => group.href ?? null;
1005
+
1006
+ // src/runtime/client/components/Sidebar.tsx
1007
+ import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1008
+ var useSidebarDisclosureStore = create2()((set) => ({
1009
+ openNodes: {},
1010
+ setNodeOpen: (nodeId, isOpen) => set((state) => {
1011
+ if (state.openNodes[nodeId] === isOpen) {
1012
+ return state;
1013
+ }
1014
+ return {
1015
+ openNodes: {
1016
+ ...state.openNodes,
1017
+ [nodeId]: isOpen
1018
+ }
1019
+ };
1020
+ })
1021
+ }));
1022
+ var useAutoOpenDetails = (nodeId, isOpenByDefault, hasActiveDescendant) => {
1023
+ const storedOpen = useSidebarDisclosureStore((state) => state.openNodes[nodeId]);
1024
+ const setNodeOpen = useSidebarDisclosureStore((state) => state.setNodeOpen);
1025
+ const isOpen = storedOpen === void 0 ? isOpenByDefault || hasActiveDescendant : storedOpen || hasActiveDescendant;
1026
+ useEffect6(() => {
1027
+ if (hasActiveDescendant) {
1028
+ setNodeOpen(nodeId, true);
1029
+ return;
1030
+ }
1031
+ if (storedOpen === void 0 && isOpenByDefault) {
1032
+ setNodeOpen(nodeId, true);
1033
+ }
1034
+ }, [hasActiveDescendant, isOpenByDefault, nodeId, setNodeOpen, storedOpen]);
1035
+ return {
1036
+ isOpen,
1037
+ setIsOpen: (nextOpen) => setNodeOpen(nodeId, nextOpen)
1038
+ };
1039
+ };
1040
+ var SidebarPageLink = ({ title, href, currentHref }) => {
1041
+ return /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsx13(
1042
+ "a",
1043
+ {
1044
+ href: withSiteBaseUrl(href),
1045
+ className: cmMerge6(
1046
+ "text-base-muted hover:text-base-content justify-start hover:bg-base-200",
1047
+ href === currentHref && "text-primary! font-semibold bg-base-200"
1048
+ ),
1049
+ children: renderInlineMarkdown(title, { codeClassName: "text-sm!" })
1050
+ }
1051
+ ) });
1052
+ };
1053
+ var SidebarGroupDivider = ({ title }) => {
1054
+ return /* @__PURE__ */ jsx13("li", { className: "ml-3 mt-2 mb-2 border-b border-base-muted-light text-xs text-base-muted-medium pointer-events-none font-semibold", children: /* @__PURE__ */ jsx13("span", { className: "-ml-3", children: renderInlineMarkdown(title, { codeClassName: "text-sm!" }) }) });
1055
+ };
1056
+ var SidebarGroupTitle = ({ title, href, isActive, allowNavigation = false }) => {
1057
+ const content = /* @__PURE__ */ jsx13(
1058
+ "span",
1059
+ {
1060
+ className: cmMerge6(
1061
+ allowNavigation ? "font-medium" : "font-semibold",
1062
+ isActive && allowNavigation && "text-primary!"
1063
+ ),
1064
+ children: title ? renderInlineMarkdown(title, { codeClassName: "text-sm!" }) : null
1065
+ }
1066
+ );
1067
+ if (allowNavigation && href) {
1068
+ return /* @__PURE__ */ jsx13(
1069
+ "a",
1070
+ {
1071
+ href: withSiteBaseUrl(href),
1072
+ className: cmMerge6(
1073
+ "flex items-center gap-2 text-base-muted hover:text-base-content no-underline",
1074
+ isActive && "text-primary! font-semibold"
1075
+ ),
1076
+ children: content
1077
+ }
1078
+ );
1079
+ }
1080
+ return /* @__PURE__ */ jsx13("span", { className: "flex items-center gap-2 text-base-content", children: content });
1081
+ };
1082
+ var renderSidebarItems = (items, currentHref) => {
1083
+ return items.map((item) => {
1084
+ if (item.kind === "page") {
1085
+ return /* @__PURE__ */ jsx13(SidebarPageLink, { title: item.navTitle, href: item.href, currentHref }, item.id);
1086
+ }
1087
+ return /* @__PURE__ */ jsx13(SidebarNestedGroup, { group: item, currentHref }, item.id);
1088
+ });
1089
+ };
1090
+ var SidebarItemList = ({ items, currentHref }) => {
1091
+ const visibleItems = getVisibleNavItems(items);
1092
+ return /* @__PURE__ */ jsx13("ul", { className: "menu w-full", children: renderSidebarItems(visibleItems, currentHref) });
1093
+ };
1094
+ var SidebarNestedGroup = ({ group, currentHref }) => {
1095
+ const groupHref = getGroupHref(group);
1096
+ const visibleItems = getVisibleGroupItems(group);
1097
+ const isCollapsible = group.collapsible !== void 0;
1098
+ const isOpenByDefault = group.collapsible?.isDefaultOpen ?? true;
1099
+ const nestedHasActiveItem = groupHref === currentHref || hasActiveItem(group.items, currentHref);
1100
+ const { isOpen, setIsOpen } = useAutoOpenDetails(`group:${group.id}`, isOpenByDefault, nestedHasActiveItem);
1101
+ if (!isCollapsible) {
1102
+ if (!group.title) {
1103
+ return /* @__PURE__ */ jsx13(Fragment5, { children: renderSidebarItems(visibleItems, currentHref) });
1104
+ }
1105
+ return /* @__PURE__ */ jsxs12(Fragment5, { children: [
1106
+ /* @__PURE__ */ jsx13(SidebarGroupDivider, { title: group.title }),
1107
+ renderSidebarItems(visibleItems, currentHref)
1108
+ ] });
1109
+ }
1110
+ return /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsxs12(
1111
+ "details",
1112
+ {
1113
+ open: isOpen,
1114
+ onToggle: (event) => {
1115
+ setIsOpen(event.currentTarget.open);
1116
+ },
1117
+ children: [
1118
+ /* @__PURE__ */ jsx13("summary", { children: /* @__PURE__ */ jsx13(
1119
+ SidebarGroupTitle,
1120
+ {
1121
+ title: group.title,
1122
+ href: groupHref ?? void 0,
1123
+ isActive: nestedHasActiveItem,
1124
+ allowNavigation: Boolean(groupHref)
1125
+ }
1126
+ ) }),
1127
+ visibleItems.length > 0 ? /* @__PURE__ */ jsx13(SidebarItemList, { items: visibleItems, currentHref }) : null
1128
+ ]
1129
+ }
1130
+ ) });
1131
+ };
1132
+ var SidebarSectionGroup = ({ section, currentHref, activeSectionId }) => {
1133
+ const sectionHasActiveItem = section.id === activeSectionId || containsActiveHref(section.items, currentHref);
1134
+ const { isOpen, setIsOpen } = useAutoOpenDetails(
1135
+ `section:${section.id}`,
1136
+ section.id === activeSectionId,
1137
+ sectionHasActiveItem
1138
+ );
1139
+ return /* @__PURE__ */ jsx13("li", { className: "pb-4", children: /* @__PURE__ */ jsxs12(
1140
+ "details",
1141
+ {
1142
+ open: isOpen,
1143
+ onToggle: (event) => {
1144
+ setIsOpen(event.currentTarget.open);
1145
+ },
1146
+ children: [
1147
+ /* @__PURE__ */ jsx13("summary", { children: /* @__PURE__ */ jsx13(SidebarGroupTitle, { title: section.title, isActive: sectionHasActiveItem }) }),
1148
+ /* @__PURE__ */ jsx13(SidebarItemList, { items: section.items, currentHref })
1149
+ ]
1150
+ }
1151
+ ) });
1152
+ };
1153
+ var Sidebar = ({ sections, activeSectionId, currentHref, horizontal }) => {
1154
+ return /* @__PURE__ */ jsx13("aside", { className: "hidden basis-76 shrink-0 lg:block", children: /* @__PURE__ */ jsxs12("div", { className: "-ml-3 sticky top-16", children: [
1155
+ /* @__PURE__ */ jsx13("div", { className: "absolute h-full w-px right-0 top-0 bg-linear-to-t to-base-muted-light via-base-muted-light pointer-events-none z-1" }),
1156
+ /* @__PURE__ */ jsx13("div", { className: "pr-4 h-[calc(100svh-16*var(--spacing))] overflow-y-scroll overflow-x-hidden relative z-10", children: /* @__PURE__ */ jsx13("ul", { className: cmMerge6("menu w-full px-0 py-5 li:last-child:border-0"), children: sections.map((section) => /* @__PURE__ */ jsx13(
1157
+ SidebarSectionGroup,
1158
+ {
1159
+ section,
1160
+ currentHref,
1161
+ activeSectionId
1162
+ },
1163
+ section.id
1164
+ )) }) })
1165
+ ] }) });
1166
+ };
1167
+
1168
+ // src/runtime/client/components/TableOfContents.tsx
1169
+ import cm4, { cmMerge as cmMerge7 } from "@classmatejs/react";
1170
+ import { TableOfContentsIcon } from "lucide-react";
1171
+ import { useEffect as useEffect7, useState as useState6 } from "react";
1172
+ import { useData } from "vike-react/useData";
1173
+ import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1174
+ var getCurrentHash = () => {
1175
+ try {
1176
+ return decodeURIComponent(window.location.hash);
1177
+ } catch {
1178
+ return window.location.hash;
1179
+ }
1180
+ };
1181
+ var getHeadingElements = () => {
1182
+ const root = document.querySelector("[data-doc-content]");
1183
+ if (!(root instanceof HTMLElement)) {
1184
+ return [];
1185
+ }
1186
+ return Array.from(root.querySelectorAll("h2, h3, h4")).filter(
1187
+ (element) => element instanceof HTMLHeadingElement
1188
+ );
1189
+ };
1190
+ var areHeadingsEqual = (left, right) => {
1191
+ if (left.length !== right.length) {
1192
+ return false;
1193
+ }
1194
+ return left.every((heading, index) => {
1195
+ const other = right[index];
1196
+ return other !== void 0 && heading.depth === other.depth && heading.id === other.id && heading.title === other.title;
1197
+ });
1198
+ };
1199
+ var syncHeadingsFromDom = (setDomHeadings) => {
1200
+ const root = document.querySelector("[data-doc-content]");
1201
+ if (!(root instanceof HTMLElement)) {
1202
+ return;
1203
+ }
1204
+ const slugify = createHeadingSlugger();
1205
+ const nextHeadings = Array.from(root.querySelectorAll("h2, h3, h4")).map((element) => {
1206
+ const title = normalizeHeadingTitle(element.textContent ?? "");
1207
+ if (!title) {
1208
+ return null;
1209
+ }
1210
+ element.classList.add("scroll-mt-24");
1211
+ const id = element.id || slugify(title);
1212
+ if (!element.id) {
1213
+ element.id = id;
1214
+ }
1215
+ return {
1216
+ depth: Number(element.tagName.slice(1)),
1217
+ id,
1218
+ title
1219
+ };
1220
+ }).filter((heading) => heading !== null);
1221
+ setDomHeadings((currentHeadings) => {
1222
+ if (areHeadingsEqual(currentHeadings, nextHeadings)) {
1223
+ return currentHeadings;
1224
+ }
1225
+ return nextHeadings;
1226
+ });
1227
+ };
1228
+ var updateActiveHeadingFromScroll = (setActiveHeadingId) => {
1229
+ const headingElements = getHeadingElements();
1230
+ if (headingElements.length === 0) {
1231
+ return;
1232
+ }
1233
+ const activationOffset = 144;
1234
+ let nextActiveHeadingId = headingElements[0]?.id ?? "";
1235
+ for (const heading of headingElements) {
1236
+ if (!heading.id) {
1237
+ continue;
1238
+ }
1239
+ if (heading.getBoundingClientRect().top <= activationOffset) {
1240
+ nextActiveHeadingId = heading.id;
1241
+ continue;
1242
+ }
1243
+ break;
1244
+ }
1245
+ const lastHeading = headingElements.at(-1);
1246
+ if (lastHeading?.id && window.innerHeight + window.scrollY >= document.documentElement.scrollHeight - 8) {
1247
+ nextActiveHeadingId = lastHeading.id;
1248
+ }
1249
+ setActiveHeadingId(nextActiveHeadingId);
1250
+ };
1251
+ var TableOfContents = ({ headings, partners }) => {
1252
+ const [activeHeadingId, setActiveHeadingId] = useState6("");
1253
+ const [domHeadings, setDomHeadings] = useState6(headings);
1254
+ const effectiveHeadings = domHeadings.length > 0 ? domHeadings : headings;
1255
+ const { page } = useData();
1256
+ useEffect7(() => {
1257
+ let scrollFrame = 0;
1258
+ const syncActiveHeading = () => {
1259
+ if (scrollFrame) {
1260
+ return;
1261
+ }
1262
+ scrollFrame = window.requestAnimationFrame(() => {
1263
+ scrollFrame = 0;
1264
+ updateActiveHeadingFromScroll(setActiveHeadingId);
1265
+ });
1266
+ };
1267
+ const updateHash = () => {
1268
+ const currentHash = getCurrentHash().replace(/^#/, "");
1269
+ if (currentHash !== "") {
1270
+ setActiveHeadingId(currentHash);
1271
+ return;
1272
+ }
1273
+ syncActiveHeading();
1274
+ };
1275
+ updateHash();
1276
+ queueMicrotask(() => {
1277
+ syncHeadingsFromDom(setDomHeadings);
1278
+ syncActiveHeading();
1279
+ });
1280
+ window.addEventListener("hashchange", updateHash);
1281
+ window.addEventListener("scroll", syncActiveHeading, { passive: true });
1282
+ window.addEventListener("resize", syncActiveHeading);
1283
+ return () => {
1284
+ if (scrollFrame) {
1285
+ window.cancelAnimationFrame(scrollFrame);
1286
+ }
1287
+ window.removeEventListener("hashchange", updateHash);
1288
+ window.removeEventListener("scroll", syncActiveHeading);
1289
+ window.removeEventListener("resize", syncActiveHeading);
1290
+ };
1291
+ }, []);
1292
+ useEffect7(() => {
1293
+ if (typeof window === "undefined") {
1294
+ return;
1295
+ }
1296
+ setDomHeadings((currentHeadings) => {
1297
+ if (areHeadingsEqual(currentHeadings, headings)) {
1298
+ return currentHeadings;
1299
+ }
1300
+ return headings;
1301
+ });
1302
+ setActiveHeadingId("");
1303
+ queueMicrotask(() => {
1304
+ syncHeadingsFromDom(setDomHeadings);
1305
+ updateActiveHeadingFromScroll(setActiveHeadingId);
1306
+ });
1307
+ }, [headings]);
1308
+ return /* @__PURE__ */ jsx14("aside", { className: cmMerge7(page.tableOfContents ? "w-64" : "w-32", "hidden shrink-0 xl:block"), children: /* @__PURE__ */ jsx14("div", { className: "sticky top-16", children: /* @__PURE__ */ jsxs13("div", { className: "relative h-[calc(100svh-16*var(--spacing))] overflow-y-auto overflow-x-hidden pt-10 pb-8", children: [
1309
+ page.tableOfContents ? effectiveHeadings.length > 0 && /* @__PURE__ */ jsxs13(Fragment6, { children: [
1310
+ /* @__PURE__ */ jsxs13("p", { className: "mb-4 flex items-center gap-2 text-xs font-semibold uppercase tracking-widest text-base-muted", children: [
1311
+ /* @__PURE__ */ jsx14(TableOfContentsIcon, { className: "h-3 w-3" }),
1312
+ "On this page"
1313
+ ] }),
1314
+ /* @__PURE__ */ jsx14("nav", { "aria-label": "On this page", className: "mb-12", children: /* @__PURE__ */ jsx14("ul", { children: effectiveHeadings.map((heading, index) => /* @__PURE__ */ jsx14("li", { children: /* @__PURE__ */ jsx14(
1315
+ "a",
1316
+ {
1317
+ href: `#${heading.id}`,
1318
+ "aria-current": activeHeadingId === heading.id ? "location" : void 0,
1319
+ onClick: () => setActiveHeadingId(heading.id),
1320
+ className: cmMerge7(
1321
+ "cursor-pointer block border-l border-base-muted-light py-1.5 text-sm text-base-muted hover:border-primary-muted hover:text-base-content",
1322
+ heading.depth > 2 ? "pl-6" : "pl-4",
1323
+ activeHeadingId ? activeHeadingId === heading.id ? "border-l-2 border-primary font-semibold text-base-content" : "" : index === 0 ? "border-l-2 border-primary font-semibold text-base-content" : ""
1324
+ ),
1325
+ children: heading.title
1326
+ }
1327
+ ) }, heading.id)) }) })
1328
+ ] }) : null,
1329
+ /* @__PURE__ */ jsx14(Adbar, { partners })
1330
+ ] }) }) });
1331
+ };
1332
+ var Adbar = ({ partners }) => {
1333
+ if (partners.primary.length === 0 && partners.gold.length === 0) {
1334
+ return null;
1335
+ }
1336
+ return /* @__PURE__ */ jsxs13(Fragment6, { children: [
1337
+ /* @__PURE__ */ jsxs13("ul", { className: "grid grid-cols-[repeat(auto-fit,minmax(5.5rem,1fr))] gap-3 opacity-90", children: [
1338
+ partners.primary.map((partner) => /* @__PURE__ */ jsx14(AdbarItem, { className: "col-span-full", children: /* @__PURE__ */ jsx14(AdbarLink, { href: partner.href, title: partner.name, children: /* @__PURE__ */ jsx14(PartnerLogo, { partner }) }) }, partner.name)),
1339
+ partners.gold.map((partner) => /* @__PURE__ */ jsx14(AdbarItem, { children: /* @__PURE__ */ jsx14(AdbarLink, { href: partner.href, title: partner.name, children: /* @__PURE__ */ jsx14(PartnerLogo, { partner }) }) }, partner.name))
1340
+ ] }),
1341
+ /* @__PURE__ */ jsxs13(AdbarItem, { className: "col-span-full p-2 text-left mt-3 block!", children: [
1342
+ /* @__PURE__ */ jsx14("strong", { className: "text-sm tracking-tighter leading-tight mb-1 block", children: "Your company name here! \u{1F48E} " }),
1343
+ /* @__PURE__ */ jsxs13("p", { className: "text-xs text-base-muted", children: [
1344
+ "Hey, this is a classic text ad here!",
1345
+ " ",
1346
+ /* @__PURE__ */ jsx14("a", { href: "#adlink", className: "text-info", children: "link" }),
1347
+ " ",
1348
+ "to some thing"
1349
+ ] })
1350
+ ] })
1351
+ ] });
1352
+ };
1353
+ var PartnerLogo = ({
1354
+ partner
1355
+ }) => {
1356
+ return /* @__PURE__ */ jsxs13(Fragment6, { children: [
1357
+ /* @__PURE__ */ jsx14(
1358
+ Image,
1359
+ {
1360
+ src: partner.logoLight,
1361
+ width: 200,
1362
+ height: 100,
1363
+ alt: partner.logoAlt,
1364
+ className: cmMerge7("block", partner.logoDark ? "dark:hidden" : "dark:invert")
1365
+ }
1366
+ ),
1367
+ partner.logoDark ? /* @__PURE__ */ jsx14(Image, { src: partner.logoDark, width: 200, height: 100, alt: partner.logoAlt, className: "hidden dark:block" }) : null
1368
+ ] });
1369
+ };
1370
+ var AdbarItem = cm4.div`
1371
+ px-5
1372
+ py-5
1373
+ bg-base-200
1374
+ text-center
1375
+ flex
1376
+ items-center
1377
+ justify-center
1378
+ rounded-field
1379
+ `;
1380
+ var AdbarLink = cm4.a`
1381
+ block
1382
+ w-full
1383
+ transition-opacity
1384
+ hover:opacity-100
1385
+ focus-visible:opacity-100
1386
+ `;
1387
+ var Image = cm4.img`
1388
+ mx-auto
1389
+ w-24
1390
+ `;
1391
+
1392
+ // src/runtime/client/getMdxRuntimeValue.tsx
1393
+ var isExternalHref = (href) => {
1394
+ return /^(?:[a-z]+:)?\/\//i.test(href) || href.startsWith("mailto:") || href.startsWith("tel:");
1395
+ };
1396
+ var splitHref = (href) => {
1397
+ const [pathname, hash = ""] = href.split("#");
1398
+ return {
1399
+ pathname,
1400
+ hash: hash ? `#${hash}` : ""
1401
+ };
1402
+ };
1403
+ var toDocsPathname = (basePath, href) => {
1404
+ if (!href.startsWith("/")) {
1405
+ return null;
1406
+ }
1407
+ if (href === basePath || href.startsWith(`${basePath}/`)) {
1408
+ return href;
1409
+ }
1410
+ const normalizedPath = href.replace(/^\/+/, "");
1411
+ if (!normalizedPath) {
1412
+ return null;
1413
+ }
1414
+ return `${basePath}/${normalizedPath}`;
1415
+ };
1416
+ var resolveDocLink = (options) => {
1417
+ const { currentPathname, href } = options;
1418
+ if (href.startsWith("#") || isExternalHref(href)) {
1419
+ return null;
1420
+ }
1421
+ const { pathname, hash } = splitHref(href);
1422
+ const docsPathname = toDocsPathname(options.docs.basePath, pathname);
1423
+ if (!docsPathname) {
1424
+ return null;
1425
+ }
1426
+ const page = getResolvedPageByPathname(options.docs, docsPathname);
1427
+ if (!page) {
1428
+ return null;
1429
+ }
1430
+ const section = getResolvedSectionById(options.docs, page.sectionId);
1431
+ return {
1432
+ href: withSiteBaseUrl(`${page.href}${hash}`),
1433
+ title: page.title,
1434
+ breadcrumb: section ? [section.navTitle] : [],
1435
+ isCurrentPage: isSamePagePathname(page, currentPathname)
1436
+ };
1437
+ };
1438
+ var resolveOverviewItem = (options) => {
1439
+ const page = options.docs.pages.find((candidate) => candidate.id === options.id);
1440
+ if (!page) {
1441
+ return null;
1442
+ }
1443
+ return {
1444
+ title: page.title,
1445
+ href: withSiteBaseUrl(page.href),
1446
+ excerpt: page.description ?? null
1447
+ };
1448
+ };
1449
+ var getMdxRuntimeValue = (options) => {
1450
+ const { currentPathname, docs } = options;
1451
+ const activeSection = getActiveSectionByPathname(docs, currentPathname);
1452
+ const currentPage = getResolvedPageByPathname(docs, currentPathname);
1453
+ return {
1454
+ locale: "en",
1455
+ codeBlockChoices: docsCodeBlockChoiceStore,
1456
+ localizeHref: (href) => {
1457
+ if (href.startsWith("#") || isExternalHref(href)) {
1458
+ return href;
1459
+ }
1460
+ const { pathname, hash } = splitHref(href);
1461
+ const docsPathname = toDocsPathname(docs.basePath, pathname);
1462
+ const page = docsPathname ? getResolvedPageByPathname(docs, docsPathname) : null;
1463
+ if (!page) {
1464
+ return withSiteBaseUrl(href);
1465
+ }
1466
+ return withSiteBaseUrl(`${page.href}${hash}`);
1467
+ },
1468
+ resolveDocLink: ({ href }) => resolveDocLink({
1469
+ docs,
1470
+ currentPathname,
1471
+ href
1472
+ }),
1473
+ resolveOverviewItem: (id) => resolveOverviewItem({
1474
+ docs,
1475
+ id
1476
+ }),
1477
+ t: (group, key) => {
1478
+ if (group === "docs" && key === "onThisPage") {
1479
+ return "On this page";
1480
+ }
1481
+ if (group === "docs" && key === "previous") {
1482
+ return "Previous";
1483
+ }
1484
+ if (group === "docs" && key === "next") {
1485
+ return "Next";
1486
+ }
1487
+ if (group === "docs" && key === "currentSection") {
1488
+ return activeSection?.navTitle ?? currentPage?.title ?? "Docs";
1489
+ }
1490
+ return key;
1491
+ }
1492
+ };
1493
+ };
1494
+
1495
+ // src/runtime/client/DocsPage.tsx
1496
+ import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1497
+ var DocsPage = ({ Content }) => {
1498
+ const pageContext = usePageContext4();
1499
+ const docs = getDocsGlobalContext(pageContext);
1500
+ const { page, headings, previousPage, nextPage } = useData2();
1501
+ return /* @__PURE__ */ jsxs14(
1502
+ UniversalMdxProvider,
1503
+ {
1504
+ value: getMdxRuntimeValue({
1505
+ docs,
1506
+ currentPathname: pageContext.urlPathname
1507
+ }),
1508
+ children: [
1509
+ /* @__PURE__ */ jsx15("div", { className: "absolute top-0 left-0 w-full h-[60svh] bg-radial-[at_65%_-85%] from-primary-muted-light to-65%" }),
1510
+ /* @__PURE__ */ jsx15(LayoutComponent, { children: /* @__PURE__ */ jsxs14("div", { className: "lg:flex lg:gap-10 xl:gap-14", children: [
1511
+ /* @__PURE__ */ jsx15(Sidebar, { sections: docs.sidebarSections, activeSectionId: page.sectionId, currentHref: page.href }),
1512
+ /* @__PURE__ */ jsxs14("main", { className: "mt-10 min-w-0 flex-1 basis-auto shrink", children: [
1513
+ /* @__PURE__ */ jsxs14(ProseContainer, { "data-doc-content": "", children: [
1514
+ /* @__PURE__ */ jsx15("h1", { className: "scroll-mt-24", children: renderInlineMarkdown(page.title) }),
1515
+ /* @__PURE__ */ jsx15(Content, {})
1516
+ ] }),
1517
+ docs.footer.pagination ? /* @__PURE__ */ jsx15(DocsPagination, { previousPage, nextPage }) : null,
1518
+ /* @__PURE__ */ jsx15(DocsFooter, { brand: docs.brand })
1519
+ ] }),
1520
+ /* @__PURE__ */ jsx15(TableOfContents, { headings, partners: docs.partners })
1521
+ ] }) })
1522
+ ]
1523
+ }
1524
+ );
1525
+ };
1526
+
1527
+ export {
1528
+ LayoutComponent,
1529
+ useDocsUserSettingsStore,
1530
+ DEFAULT_THEME_PREFERENCE,
1531
+ applyThemePreference,
1532
+ UserSettingsSync,
1533
+ AppLayout,
1534
+ MetaHead,
1535
+ ProseContainer,
1536
+ DocsPage
1537
+ };
1538
+ //# sourceMappingURL=chunk-UDOIFPCZ.js.map