docs-i18n 0.7.4 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/admin/dist/server/assets/chunk-CNvmzFzq.js +35 -0
  2. package/admin/dist/server/assets/{init-AJSQ7K_l.js → init-DJr2glb3.js} +5 -38
  3. package/admin/dist/server/assets/{jobs-CwDb0Zyp.js → jobs-FXffC7LH.js} +2 -2
  4. package/admin/dist/server/assets/{misc-CqYhnW23.js → misc-y6t3-UOP.js} +3 -3
  5. package/admin/dist/server/assets/{models-D9Sd95EX.js → models-YNa3F3nn.js} +1 -1
  6. package/admin/dist/server/assets/react-dom-BryASgrS.js +2159 -0
  7. package/admin/dist/server/assets/redirect-BHRifpCK.js +51 -0
  8. package/admin/dist/server/assets/router-CAX08MEI.js +897 -0
  9. package/admin/dist/server/assets/routes-Bk6XCM2I.js +2139 -0
  10. package/admin/dist/server/assets/routes-CMOVc2RM.js +2132 -0
  11. package/admin/dist/server/assets/{status-D48jcwYI.js → status-CM7Azp4n.js} +2 -2
  12. package/admin/dist/server/server.js +15789 -4447
  13. package/admin/vite.config.ts +13 -0
  14. package/dist/cli.js +1 -1
  15. package/dist/{upload-XL6KG6S2.js → upload-KYKJVERO.js} +1 -1
  16. package/package.json +1 -1
  17. package/template/app/components/BlogArticle.tsx +3 -0
  18. package/template/app/components/Doc.tsx +4 -0
  19. package/template/app/components/markdown/MarkdownContent.tsx +6 -2
  20. package/template/app/site.config.ts +2 -0
  21. package/template/app/types/index.ts +4 -0
  22. package/template/app/utils/content-loader.ts +85 -32
  23. package/template/app/utils/docs.server.ts +38 -6
  24. package/template/app/utils/markdown/plugins/index.ts +1 -0
  25. package/template/app/utils/markdown/plugins/mdxJsxToRaw.ts +127 -0
  26. package/template/app/utils/markdown/processor.ts +14 -1
  27. package/template/app/utils/sidebar-generator.ts +185 -0
  28. package/template/app/utils/url-mapper.ts +22 -0
  29. package/template/package.json +2 -1
  30. package/admin/dist/server/assets/router-D00bP5CU.js +0 -67
  31. package/admin/dist/server/assets/routes-C2UFxDWZ.js +0 -24
  32. package/admin/dist/server/assets/routes-vEKXnl0r.js +0 -1574
  33. /package/admin/dist/server/assets/{_tanstack-start-manifest_v-sC90W3ET.js → _tanstack-start-manifest_v-mK4S3Lga.js} +0 -0
  34. /package/admin/dist/server/assets/{createServerRpc-CMjjCE8A.js → createServerRpc-C3JHS5ky.js} +0 -0
  35. /package/admin/dist/server/assets/{start-BrsoKfWS.js → start-3avuCbOL.js} +0 -0
@@ -0,0 +1,2132 @@
1
+ import { i as __toESM } from "./chunk-CNvmzFzq.js";
2
+ import { G as useIntersectionObserver, H as replaceEqualDeep$1, I as functionalUpdate$1, J as require_react, L as isDangerousProtocol, N as deepEqual, O as invariant, R as isModuleNotFoundError, U as reactUse, W as useForwardedRef, _ as removeTrailingSlash, a as useRouter, b as trimPathLeft, c as useHydrated, g as joinPaths, i as matchContext, l as require_jsx_runtime, m as exactPathTest, n as useStore, r as dummyMatchContext, t as require_react_dom, u as rootRouteId, x as trimPathRight } from "./react-dom-BryASgrS.js";
3
+ import { i as redirect } from "./redirect-BHRifpCK.js";
4
+ //#region ../../node_modules/.bun/@tanstack+router-core@1.168.2/node_modules/@tanstack/router-core/dist/esm/link.js
5
+ var preloadWarning = "Error preloading route! ☝️";
6
+ //#endregion
7
+ //#region ../../node_modules/.bun/@tanstack+router-core@1.168.2/node_modules/@tanstack/router-core/dist/esm/route.js
8
+ var BaseRoute = class {
9
+ get to() {
10
+ return this._to;
11
+ }
12
+ get id() {
13
+ return this._id;
14
+ }
15
+ get path() {
16
+ return this._path;
17
+ }
18
+ get fullPath() {
19
+ return this._fullPath;
20
+ }
21
+ constructor(options) {
22
+ this.init = (opts) => {
23
+ this.originalIndex = opts.originalIndex;
24
+ const options = this.options;
25
+ const isRoot = !options?.path && !options?.id;
26
+ this.parentRoute = this.options.getParentRoute?.();
27
+ if (isRoot) this._path = rootRouteId;
28
+ else if (!this.parentRoute) invariant();
29
+ let path = isRoot ? rootRouteId : options?.path;
30
+ if (path && path !== "/") path = trimPathLeft(path);
31
+ const customId = options?.id || path;
32
+ let id = isRoot ? rootRouteId : joinPaths([this.parentRoute.id === "__root__" ? "" : this.parentRoute.id, customId]);
33
+ if (path === "__root__") path = "/";
34
+ if (id !== "__root__") id = joinPaths(["/", id]);
35
+ const fullPath = id === "__root__" ? "/" : joinPaths([this.parentRoute.fullPath, path]);
36
+ this._path = path;
37
+ this._id = id;
38
+ this._fullPath = fullPath;
39
+ this._to = trimPathRight(fullPath);
40
+ };
41
+ this.addChildren = (children) => {
42
+ return this._addFileChildren(children);
43
+ };
44
+ this._addFileChildren = (children) => {
45
+ if (Array.isArray(children)) this.children = children;
46
+ if (typeof children === "object" && children !== null) this.children = Object.values(children);
47
+ return this;
48
+ };
49
+ this._addFileTypes = () => {
50
+ return this;
51
+ };
52
+ this.updateLoader = (options) => {
53
+ Object.assign(this.options, options);
54
+ return this;
55
+ };
56
+ this.update = (options) => {
57
+ Object.assign(this.options, options);
58
+ return this;
59
+ };
60
+ this.lazy = (lazyFn) => {
61
+ this.lazyFn = lazyFn;
62
+ return this;
63
+ };
64
+ this.redirect = (opts) => redirect({
65
+ from: this.fullPath,
66
+ ...opts
67
+ });
68
+ this.options = options || {};
69
+ this.isRoot = !options?.getParentRoute;
70
+ if (options?.id && options?.path) throw new Error(`Route cannot have both an 'id' and a 'path' option.`);
71
+ }
72
+ };
73
+ var BaseRootRoute = class extends BaseRoute {
74
+ constructor(options) {
75
+ super(options);
76
+ }
77
+ };
78
+ //#endregion
79
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/useMatch.js
80
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
81
+ var dummyStore = {
82
+ state: void 0,
83
+ get: () => void 0,
84
+ subscribe: () => () => {}
85
+ };
86
+ /**
87
+ * Read and select the nearest or targeted route match.
88
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchHook
89
+ */
90
+ function useMatch(opts) {
91
+ const router = useRouter();
92
+ const nearestMatchId = import_react.useContext(opts.from ? dummyMatchContext : matchContext);
93
+ const key = opts.from ?? nearestMatchId;
94
+ const matchStore = key ? opts.from ? router.stores.getMatchStoreByRouteId(key) : router.stores.activeMatchStoresById.get(key) : void 0;
95
+ {
96
+ const match = matchStore?.state;
97
+ if ((opts.shouldThrow ?? true) && !match) invariant();
98
+ if (match === void 0) return;
99
+ return opts.select ? opts.select(match) : match;
100
+ }
101
+ const previousResult = import_react.useRef(void 0);
102
+ return useStore(matchStore ?? dummyStore, (match) => {
103
+ if ((opts.shouldThrow ?? true) && !match) invariant();
104
+ if (match === void 0) return;
105
+ const selected = opts.select ? opts.select(match) : match;
106
+ if (opts.structuralSharing ?? router.options.defaultStructuralSharing) {
107
+ const shared = replaceEqualDeep$1(previousResult.current, selected);
108
+ previousResult.current = shared;
109
+ return shared;
110
+ }
111
+ return selected;
112
+ });
113
+ }
114
+ //#endregion
115
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/useLoaderData.js
116
+ /**
117
+ * Read and select the current route's loader data with type‑safety.
118
+ *
119
+ * Options:
120
+ * - `from`/`strict`: Choose which route's data to read and strictness
121
+ * - `select`: Map the loader data to a derived value
122
+ * - `structuralSharing`: Enable structural sharing for stable references
123
+ *
124
+ * @returns The loader data (or selected value) for the matched route.
125
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDataHook
126
+ */
127
+ function useLoaderData(opts) {
128
+ return useMatch({
129
+ from: opts.from,
130
+ strict: opts.strict,
131
+ structuralSharing: opts.structuralSharing,
132
+ select: (s) => {
133
+ return opts.select ? opts.select(s.loaderData) : s.loaderData;
134
+ }
135
+ });
136
+ }
137
+ //#endregion
138
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/useLoaderDeps.js
139
+ /**
140
+ * Read and select the current route's loader dependencies object.
141
+ *
142
+ * Options:
143
+ * - `from`: Choose which route's loader deps to read
144
+ * - `select`: Map the deps to a derived value
145
+ * - `structuralSharing`: Enable structural sharing for stable references
146
+ *
147
+ * @returns The loader deps (or selected value) for the matched route.
148
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDepsHook
149
+ */
150
+ function useLoaderDeps(opts) {
151
+ const { select, ...rest } = opts;
152
+ return useMatch({
153
+ ...rest,
154
+ select: (s) => {
155
+ return select ? select(s.loaderDeps) : s.loaderDeps;
156
+ }
157
+ });
158
+ }
159
+ //#endregion
160
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/useParams.js
161
+ /**
162
+ * Access the current route's path parameters with type-safety.
163
+ *
164
+ * Options:
165
+ * - `from`/`strict`: Specify the matched route and whether to enforce strict typing
166
+ * - `select`: Project the params object to a derived value for memoized renders
167
+ * - `structuralSharing`: Enable structural sharing for stable references
168
+ * - `shouldThrow`: Throw if the route is not found in strict contexts
169
+ *
170
+ * @returns The params object (or selected value) for the matched route.
171
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook
172
+ */
173
+ function useParams(opts) {
174
+ return useMatch({
175
+ from: opts.from,
176
+ shouldThrow: opts.shouldThrow,
177
+ structuralSharing: opts.structuralSharing,
178
+ strict: opts.strict,
179
+ select: (match) => {
180
+ const params = opts.strict === false ? match.params : match._strictParams;
181
+ return opts.select ? opts.select(params) : params;
182
+ }
183
+ });
184
+ }
185
+ //#endregion
186
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/useSearch.js
187
+ /**
188
+ * Read and select the current route's search parameters with type-safety.
189
+ *
190
+ * Options:
191
+ * - `from`/`strict`: Control which route's search is read and how strictly it's typed
192
+ * - `select`: Map the search object to a derived value for render optimization
193
+ * - `structuralSharing`: Enable structural sharing for stable references
194
+ * - `shouldThrow`: Throw when the route is not found (strict contexts)
195
+ *
196
+ * @returns The search object (or selected value) for the matched route.
197
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook
198
+ */
199
+ function useSearch(opts) {
200
+ return useMatch({
201
+ from: opts.from,
202
+ strict: opts.strict,
203
+ shouldThrow: opts.shouldThrow,
204
+ structuralSharing: opts.structuralSharing,
205
+ select: (match) => {
206
+ return opts.select ? opts.select(match.search) : match.search;
207
+ }
208
+ });
209
+ }
210
+ //#endregion
211
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/useNavigate.js
212
+ /**
213
+ * Imperative navigation hook.
214
+ *
215
+ * Returns a stable `navigate(options)` function to change the current location
216
+ * programmatically. Prefer the `Link` component for user-initiated navigation,
217
+ * and use this hook from effects, callbacks, or handlers where imperative
218
+ * navigation is required.
219
+ *
220
+ * Options:
221
+ * - `from`: Optional route base used to resolve relative `to` paths.
222
+ *
223
+ * @returns A function that accepts `NavigateOptions`.
224
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useNavigateHook
225
+ */
226
+ function useNavigate(_defaultOpts) {
227
+ const router = useRouter();
228
+ return import_react.useCallback((options) => {
229
+ return router.navigate({
230
+ ...options,
231
+ from: options.from ?? _defaultOpts?.from
232
+ });
233
+ }, [_defaultOpts?.from, router]);
234
+ }
235
+ //#endregion
236
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/useRouteContext.js
237
+ function useRouteContext(opts) {
238
+ return useMatch({
239
+ ...opts,
240
+ select: (match) => opts.select ? opts.select(match.context) : match.context
241
+ });
242
+ }
243
+ //#endregion
244
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/link.js
245
+ var import_jsx_runtime = require_jsx_runtime();
246
+ var import_react_dom = require_react_dom();
247
+ /**
248
+ * Build anchor-like props for declarative navigation and preloading.
249
+ *
250
+ * Returns stable `href`, event handlers and accessibility props derived from
251
+ * router options and active state. Used internally by `Link` and custom links.
252
+ *
253
+ * Options cover `to`, `params`, `search`, `hash`, `state`, `preload`,
254
+ * `activeProps`, `inactiveProps`, and more.
255
+ *
256
+ * @returns React anchor props suitable for `<a>` or custom components.
257
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLinkPropsHook
258
+ */
259
+ function useLinkProps(options, forwardedRef) {
260
+ const router = useRouter();
261
+ const innerRef = useForwardedRef(forwardedRef);
262
+ const { activeProps, inactiveProps, activeOptions, to, preload: userPreload, preloadDelay: userPreloadDelay, hashScrollIntoView, replace, startTransition, resetScroll, viewTransition, children, target, disabled, style, className, onClick, onBlur, onFocus, onMouseEnter, onMouseLeave, onTouchStart, ignoreBlocker, params: _params, search: _search, hash: _hash, state: _state, mask: _mask, reloadDocument: _reloadDocument, unsafeRelative: _unsafeRelative, from: _from, _fromLocation, ...propsSafeToSpread } = options;
263
+ {
264
+ const safeInternal = isSafeInternal(to);
265
+ if (typeof to === "string" && !safeInternal && to.indexOf(":") > -1) try {
266
+ new URL(to);
267
+ if (isDangerousProtocol(to, router.protocolAllowlist)) return {
268
+ ...propsSafeToSpread,
269
+ ref: innerRef,
270
+ href: void 0,
271
+ ...children && { children },
272
+ ...target && { target },
273
+ ...disabled && { disabled },
274
+ ...style && { style },
275
+ ...className && { className }
276
+ };
277
+ return {
278
+ ...propsSafeToSpread,
279
+ ref: innerRef,
280
+ href: to,
281
+ ...children && { children },
282
+ ...target && { target },
283
+ ...disabled && { disabled },
284
+ ...style && { style },
285
+ ...className && { className }
286
+ };
287
+ } catch {}
288
+ const next = router.buildLocation({
289
+ ...options,
290
+ from: options.from
291
+ });
292
+ const hrefOption = getHrefOption(next.maskedLocation ? next.maskedLocation.publicHref : next.publicHref, next.maskedLocation ? next.maskedLocation.external : next.external, router.history, disabled);
293
+ const externalLink = (() => {
294
+ if (hrefOption?.external) {
295
+ if (isDangerousProtocol(hrefOption.href, router.protocolAllowlist)) return;
296
+ return hrefOption.href;
297
+ }
298
+ if (safeInternal) return void 0;
299
+ if (typeof to === "string" && to.indexOf(":") > -1) try {
300
+ new URL(to);
301
+ if (isDangerousProtocol(to, router.protocolAllowlist)) return;
302
+ return to;
303
+ } catch {}
304
+ })();
305
+ const isActive = (() => {
306
+ if (externalLink) return false;
307
+ const currentLocation = router.stores.location.state;
308
+ const exact = activeOptions?.exact ?? false;
309
+ if (exact) {
310
+ if (!exactPathTest(currentLocation.pathname, next.pathname, router.basepath)) return false;
311
+ } else {
312
+ const currentPathSplit = removeTrailingSlash(currentLocation.pathname, router.basepath);
313
+ const nextPathSplit = removeTrailingSlash(next.pathname, router.basepath);
314
+ if (!(currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === "/"))) return false;
315
+ }
316
+ if (activeOptions?.includeSearch ?? true) {
317
+ if (currentLocation.search !== next.search) {
318
+ const currentSearchEmpty = !currentLocation.search || typeof currentLocation.search === "object" && Object.keys(currentLocation.search).length === 0;
319
+ const nextSearchEmpty = !next.search || typeof next.search === "object" && Object.keys(next.search).length === 0;
320
+ if (!(currentSearchEmpty && nextSearchEmpty)) {
321
+ if (!deepEqual(currentLocation.search, next.search, {
322
+ partial: !exact,
323
+ ignoreUndefined: !activeOptions?.explicitUndefined
324
+ })) return false;
325
+ }
326
+ }
327
+ }
328
+ if (activeOptions?.includeHash) return false;
329
+ return true;
330
+ })();
331
+ if (externalLink) return {
332
+ ...propsSafeToSpread,
333
+ ref: innerRef,
334
+ href: externalLink,
335
+ ...children && { children },
336
+ ...target && { target },
337
+ ...disabled && { disabled },
338
+ ...style && { style },
339
+ ...className && { className }
340
+ };
341
+ const resolvedActiveProps = isActive ? functionalUpdate$1(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT;
342
+ const resolvedInactiveProps = isActive ? STATIC_EMPTY_OBJECT : functionalUpdate$1(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT;
343
+ const resolvedStyle = (() => {
344
+ const baseStyle = style;
345
+ const activeStyle = resolvedActiveProps.style;
346
+ const inactiveStyle = resolvedInactiveProps.style;
347
+ if (!baseStyle && !activeStyle && !inactiveStyle) return;
348
+ if (baseStyle && !activeStyle && !inactiveStyle) return baseStyle;
349
+ if (!baseStyle && activeStyle && !inactiveStyle) return activeStyle;
350
+ if (!baseStyle && !activeStyle && inactiveStyle) return inactiveStyle;
351
+ return {
352
+ ...baseStyle,
353
+ ...activeStyle,
354
+ ...inactiveStyle
355
+ };
356
+ })();
357
+ const resolvedClassName = (() => {
358
+ const baseClassName = className;
359
+ const activeClassName = resolvedActiveProps.className;
360
+ const inactiveClassName = resolvedInactiveProps.className;
361
+ if (!baseClassName && !activeClassName && !inactiveClassName) return "";
362
+ let out = "";
363
+ if (baseClassName) out = baseClassName;
364
+ if (activeClassName) out = out ? `${out} ${activeClassName}` : activeClassName;
365
+ if (inactiveClassName) out = out ? `${out} ${inactiveClassName}` : inactiveClassName;
366
+ return out;
367
+ })();
368
+ return {
369
+ ...propsSafeToSpread,
370
+ ...resolvedActiveProps,
371
+ ...resolvedInactiveProps,
372
+ href: hrefOption?.href,
373
+ ref: innerRef,
374
+ disabled: !!disabled,
375
+ target,
376
+ ...resolvedStyle && { style: resolvedStyle },
377
+ ...resolvedClassName && { className: resolvedClassName },
378
+ ...disabled && STATIC_DISABLED_PROPS,
379
+ ...isActive && STATIC_ACTIVE_PROPS
380
+ };
381
+ }
382
+ const isHydrated = useHydrated();
383
+ const _options = import_react.useMemo(() => options, [
384
+ router,
385
+ options.from,
386
+ options._fromLocation,
387
+ options.hash,
388
+ options.to,
389
+ options.search,
390
+ options.params,
391
+ options.state,
392
+ options.mask,
393
+ options.unsafeRelative
394
+ ]);
395
+ const currentLocation = useStore(router.stores.location, (l) => l, (prev, next) => prev.href === next.href);
396
+ const next = import_react.useMemo(() => {
397
+ const opts = {
398
+ _fromLocation: currentLocation,
399
+ ..._options
400
+ };
401
+ return router.buildLocation(opts);
402
+ }, [
403
+ router,
404
+ currentLocation,
405
+ _options
406
+ ]);
407
+ const hrefOptionPublicHref = next.maskedLocation ? next.maskedLocation.publicHref : next.publicHref;
408
+ const hrefOptionExternal = next.maskedLocation ? next.maskedLocation.external : next.external;
409
+ const hrefOption = import_react.useMemo(() => getHrefOption(hrefOptionPublicHref, hrefOptionExternal, router.history, disabled), [
410
+ disabled,
411
+ hrefOptionExternal,
412
+ hrefOptionPublicHref,
413
+ router.history
414
+ ]);
415
+ const externalLink = import_react.useMemo(() => {
416
+ if (hrefOption?.external) {
417
+ if (isDangerousProtocol(hrefOption.href, router.protocolAllowlist)) return;
418
+ return hrefOption.href;
419
+ }
420
+ if (isSafeInternal(to)) return void 0;
421
+ if (typeof to !== "string" || to.indexOf(":") === -1) return void 0;
422
+ try {
423
+ new URL(to);
424
+ if (isDangerousProtocol(to, router.protocolAllowlist)) return;
425
+ return to;
426
+ } catch {}
427
+ }, [
428
+ to,
429
+ hrefOption,
430
+ router.protocolAllowlist
431
+ ]);
432
+ const isActive = import_react.useMemo(() => {
433
+ if (externalLink) return false;
434
+ if (activeOptions?.exact) {
435
+ if (!exactPathTest(currentLocation.pathname, next.pathname, router.basepath)) return false;
436
+ } else {
437
+ const currentPathSplit = removeTrailingSlash(currentLocation.pathname, router.basepath);
438
+ const nextPathSplit = removeTrailingSlash(next.pathname, router.basepath);
439
+ if (!(currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === "/"))) return false;
440
+ }
441
+ if (activeOptions?.includeSearch ?? true) {
442
+ if (!deepEqual(currentLocation.search, next.search, {
443
+ partial: !activeOptions?.exact,
444
+ ignoreUndefined: !activeOptions?.explicitUndefined
445
+ })) return false;
446
+ }
447
+ if (activeOptions?.includeHash) return isHydrated && currentLocation.hash === next.hash;
448
+ return true;
449
+ }, [
450
+ activeOptions?.exact,
451
+ activeOptions?.explicitUndefined,
452
+ activeOptions?.includeHash,
453
+ activeOptions?.includeSearch,
454
+ currentLocation,
455
+ externalLink,
456
+ isHydrated,
457
+ next.hash,
458
+ next.pathname,
459
+ next.search,
460
+ router.basepath
461
+ ]);
462
+ const resolvedActiveProps = isActive ? functionalUpdate$1(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT;
463
+ const resolvedInactiveProps = isActive ? STATIC_EMPTY_OBJECT : functionalUpdate$1(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT;
464
+ const resolvedClassName = [
465
+ className,
466
+ resolvedActiveProps.className,
467
+ resolvedInactiveProps.className
468
+ ].filter(Boolean).join(" ");
469
+ const resolvedStyle = (style || resolvedActiveProps.style || resolvedInactiveProps.style) && {
470
+ ...style,
471
+ ...resolvedActiveProps.style,
472
+ ...resolvedInactiveProps.style
473
+ };
474
+ const [isTransitioning, setIsTransitioning] = import_react.useState(false);
475
+ const hasRenderFetched = import_react.useRef(false);
476
+ const preload = options.reloadDocument || externalLink ? false : userPreload ?? router.options.defaultPreload;
477
+ const preloadDelay = userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0;
478
+ const doPreload = import_react.useCallback(() => {
479
+ router.preloadRoute({
480
+ ..._options,
481
+ _builtLocation: next
482
+ }).catch((err) => {
483
+ console.warn(err);
484
+ console.warn(preloadWarning);
485
+ });
486
+ }, [
487
+ router,
488
+ _options,
489
+ next
490
+ ]);
491
+ useIntersectionObserver(innerRef, import_react.useCallback((entry) => {
492
+ if (entry?.isIntersecting) doPreload();
493
+ }, [doPreload]), intersectionObserverOptions, { disabled: !!disabled || !(preload === "viewport") });
494
+ import_react.useEffect(() => {
495
+ if (hasRenderFetched.current) return;
496
+ if (!disabled && preload === "render") {
497
+ doPreload();
498
+ hasRenderFetched.current = true;
499
+ }
500
+ }, [
501
+ disabled,
502
+ doPreload,
503
+ preload
504
+ ]);
505
+ const handleClick = (e) => {
506
+ const elementTarget = e.currentTarget.getAttribute("target");
507
+ const effectiveTarget = target !== void 0 ? target : elementTarget;
508
+ if (!disabled && !isCtrlEvent(e) && !e.defaultPrevented && (!effectiveTarget || effectiveTarget === "_self") && e.button === 0) {
509
+ e.preventDefault();
510
+ (0, import_react_dom.flushSync)(() => {
511
+ setIsTransitioning(true);
512
+ });
513
+ const unsub = router.subscribe("onResolved", () => {
514
+ unsub();
515
+ setIsTransitioning(false);
516
+ });
517
+ router.navigate({
518
+ ..._options,
519
+ replace,
520
+ resetScroll,
521
+ hashScrollIntoView,
522
+ startTransition,
523
+ viewTransition,
524
+ ignoreBlocker
525
+ });
526
+ }
527
+ };
528
+ if (externalLink) return {
529
+ ...propsSafeToSpread,
530
+ ref: innerRef,
531
+ href: externalLink,
532
+ ...children && { children },
533
+ ...target && { target },
534
+ ...disabled && { disabled },
535
+ ...style && { style },
536
+ ...className && { className },
537
+ ...onClick && { onClick },
538
+ ...onBlur && { onBlur },
539
+ ...onFocus && { onFocus },
540
+ ...onMouseEnter && { onMouseEnter },
541
+ ...onMouseLeave && { onMouseLeave },
542
+ ...onTouchStart && { onTouchStart }
543
+ };
544
+ const enqueueIntentPreload = (e) => {
545
+ if (disabled || preload !== "intent") return;
546
+ if (!preloadDelay) {
547
+ doPreload();
548
+ return;
549
+ }
550
+ const eventTarget = e.currentTarget;
551
+ if (timeoutMap.has(eventTarget)) return;
552
+ const id = setTimeout(() => {
553
+ timeoutMap.delete(eventTarget);
554
+ doPreload();
555
+ }, preloadDelay);
556
+ timeoutMap.set(eventTarget, id);
557
+ };
558
+ const handleTouchStart = (_) => {
559
+ if (disabled || preload !== "intent") return;
560
+ doPreload();
561
+ };
562
+ const handleLeave = (e) => {
563
+ if (disabled || !preload || !preloadDelay) return;
564
+ const eventTarget = e.currentTarget;
565
+ const id = timeoutMap.get(eventTarget);
566
+ if (id) {
567
+ clearTimeout(id);
568
+ timeoutMap.delete(eventTarget);
569
+ }
570
+ };
571
+ return {
572
+ ...propsSafeToSpread,
573
+ ...resolvedActiveProps,
574
+ ...resolvedInactiveProps,
575
+ href: hrefOption?.href,
576
+ ref: innerRef,
577
+ onClick: composeHandlers([onClick, handleClick]),
578
+ onBlur: composeHandlers([onBlur, handleLeave]),
579
+ onFocus: composeHandlers([onFocus, enqueueIntentPreload]),
580
+ onMouseEnter: composeHandlers([onMouseEnter, enqueueIntentPreload]),
581
+ onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),
582
+ onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),
583
+ disabled: !!disabled,
584
+ target,
585
+ ...resolvedStyle && { style: resolvedStyle },
586
+ ...resolvedClassName && { className: resolvedClassName },
587
+ ...disabled && STATIC_DISABLED_PROPS,
588
+ ...isActive && STATIC_ACTIVE_PROPS,
589
+ ...isHydrated && isTransitioning && STATIC_TRANSITIONING_PROPS
590
+ };
591
+ }
592
+ var STATIC_EMPTY_OBJECT = {};
593
+ var STATIC_ACTIVE_OBJECT = { className: "active" };
594
+ var STATIC_DISABLED_PROPS = {
595
+ role: "link",
596
+ "aria-disabled": true
597
+ };
598
+ var STATIC_ACTIVE_PROPS = {
599
+ "data-status": "active",
600
+ "aria-current": "page"
601
+ };
602
+ var STATIC_TRANSITIONING_PROPS = { "data-transitioning": "transitioning" };
603
+ var timeoutMap = /* @__PURE__ */ new WeakMap();
604
+ var intersectionObserverOptions = { rootMargin: "100px" };
605
+ var composeHandlers = (handlers) => (e) => {
606
+ for (const handler of handlers) {
607
+ if (!handler) continue;
608
+ if (e.defaultPrevented) return;
609
+ handler(e);
610
+ }
611
+ };
612
+ function getHrefOption(publicHref, external, history, disabled) {
613
+ if (disabled) return void 0;
614
+ if (external) return {
615
+ href: publicHref,
616
+ external: true
617
+ };
618
+ return {
619
+ href: history.createHref(publicHref) || "/",
620
+ external: false
621
+ };
622
+ }
623
+ function isSafeInternal(to) {
624
+ if (typeof to !== "string") return false;
625
+ const zero = to.charCodeAt(0);
626
+ if (zero === 47) return to.charCodeAt(1) !== 47;
627
+ return zero === 46;
628
+ }
629
+ /**
630
+ * A strongly-typed anchor component for declarative navigation.
631
+ * Handles path, search, hash and state updates with optional route preloading
632
+ * and active-state styling.
633
+ *
634
+ * Props:
635
+ * - `preload`: Controls route preloading (eg. 'intent', 'render', 'viewport', true/false)
636
+ * - `preloadDelay`: Delay in ms before preloading on hover
637
+ * - `activeProps`/`inactiveProps`: Additional props merged when link is active/inactive
638
+ * - `resetScroll`/`hashScrollIntoView`: Control scroll behavior on navigation
639
+ * - `viewTransition`/`startTransition`: Use View Transitions/React transitions for navigation
640
+ * - `ignoreBlocker`: Bypass registered blockers
641
+ *
642
+ * @returns An anchor-like element that navigates without full page reloads.
643
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkComponent
644
+ */
645
+ var Link = import_react.forwardRef((props, ref) => {
646
+ const { _asChild, ...rest } = props;
647
+ const { type: _type, ...linkProps } = useLinkProps(rest, ref);
648
+ const children = typeof rest.children === "function" ? rest.children({ isActive: linkProps["data-status"] === "active" }) : rest.children;
649
+ if (!_asChild) {
650
+ const { disabled: _, ...rest } = linkProps;
651
+ return import_react.createElement("a", rest, children);
652
+ }
653
+ return import_react.createElement(_asChild, linkProps, children);
654
+ });
655
+ function isCtrlEvent(e) {
656
+ return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
657
+ }
658
+ //#endregion
659
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/route.js
660
+ var Route$1 = class extends BaseRoute {
661
+ /**
662
+ * @deprecated Use the `createRoute` function instead.
663
+ */
664
+ constructor(options) {
665
+ super(options);
666
+ this.useMatch = (opts) => {
667
+ return useMatch({
668
+ select: opts?.select,
669
+ from: this.id,
670
+ structuralSharing: opts?.structuralSharing
671
+ });
672
+ };
673
+ this.useRouteContext = (opts) => {
674
+ return useRouteContext({
675
+ ...opts,
676
+ from: this.id
677
+ });
678
+ };
679
+ this.useSearch = (opts) => {
680
+ return useSearch({
681
+ select: opts?.select,
682
+ structuralSharing: opts?.structuralSharing,
683
+ from: this.id
684
+ });
685
+ };
686
+ this.useParams = (opts) => {
687
+ return useParams({
688
+ select: opts?.select,
689
+ structuralSharing: opts?.structuralSharing,
690
+ from: this.id
691
+ });
692
+ };
693
+ this.useLoaderDeps = (opts) => {
694
+ return useLoaderDeps({
695
+ ...opts,
696
+ from: this.id
697
+ });
698
+ };
699
+ this.useLoaderData = (opts) => {
700
+ return useLoaderData({
701
+ ...opts,
702
+ from: this.id
703
+ });
704
+ };
705
+ this.useNavigate = () => {
706
+ return useNavigate({ from: this.fullPath });
707
+ };
708
+ this.Link = import_react.forwardRef((props, ref) => {
709
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
710
+ ref,
711
+ from: this.fullPath,
712
+ ...props
713
+ });
714
+ });
715
+ }
716
+ };
717
+ /**
718
+ * Creates a non-root Route instance for code-based routing.
719
+ *
720
+ * Use this to define a route that will be composed into a route tree
721
+ * (typically via a parent route's `addChildren`). If you're using file-based
722
+ * routing, prefer `createFileRoute`.
723
+ *
724
+ * @param options Route options (path, component, loader, context, etc.).
725
+ * @returns A Route instance to be attached to the route tree.
726
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouteFunction
727
+ */
728
+ function createRoute(options) {
729
+ return new Route$1(options);
730
+ }
731
+ /**
732
+ * Creates a root route factory that requires a router context type.
733
+ *
734
+ * Use when your root route expects `context` to be provided to `createRouter`.
735
+ * The returned function behaves like `createRootRoute` but enforces a context type.
736
+ *
737
+ * @returns A factory function to configure and return a root route.
738
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction
739
+ */
740
+ function createRootRouteWithContext() {
741
+ return (options) => {
742
+ return createRootRoute(options);
743
+ };
744
+ }
745
+ var RootRoute = class extends BaseRootRoute {
746
+ /**
747
+ * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
748
+ */
749
+ constructor(options) {
750
+ super(options);
751
+ this.useMatch = (opts) => {
752
+ return useMatch({
753
+ select: opts?.select,
754
+ from: this.id,
755
+ structuralSharing: opts?.structuralSharing
756
+ });
757
+ };
758
+ this.useRouteContext = (opts) => {
759
+ return useRouteContext({
760
+ ...opts,
761
+ from: this.id
762
+ });
763
+ };
764
+ this.useSearch = (opts) => {
765
+ return useSearch({
766
+ select: opts?.select,
767
+ structuralSharing: opts?.structuralSharing,
768
+ from: this.id
769
+ });
770
+ };
771
+ this.useParams = (opts) => {
772
+ return useParams({
773
+ select: opts?.select,
774
+ structuralSharing: opts?.structuralSharing,
775
+ from: this.id
776
+ });
777
+ };
778
+ this.useLoaderDeps = (opts) => {
779
+ return useLoaderDeps({
780
+ ...opts,
781
+ from: this.id
782
+ });
783
+ };
784
+ this.useLoaderData = (opts) => {
785
+ return useLoaderData({
786
+ ...opts,
787
+ from: this.id
788
+ });
789
+ };
790
+ this.useNavigate = () => {
791
+ return useNavigate({ from: this.fullPath });
792
+ };
793
+ this.Link = import_react.forwardRef((props, ref) => {
794
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
795
+ ref,
796
+ from: this.fullPath,
797
+ ...props
798
+ });
799
+ });
800
+ }
801
+ };
802
+ /**
803
+ * Creates a root Route instance used to build your route tree.
804
+ *
805
+ * Typically paired with `createRouter({ routeTree })`. If you need to require
806
+ * a typed router context, use `createRootRouteWithContext` instead.
807
+ *
808
+ * @param options Root route options (component, error, pending, etc.).
809
+ * @returns A root route instance.
810
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteFunction
811
+ */
812
+ function createRootRoute(options) {
813
+ return new RootRoute(options);
814
+ }
815
+ //#endregion
816
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/fileRoute.js
817
+ /**
818
+ * Creates a file-based Route factory for a given path.
819
+ *
820
+ * Used by TanStack Router's file-based routing to associate a file with a
821
+ * route. The returned function accepts standard route options. In normal usage
822
+ * the `path` string is inserted and maintained by the `tsr` generator.
823
+ *
824
+ * @param path File path literal for the route (usually auto-generated).
825
+ * @returns A function that accepts Route options and returns a Route instance.
826
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction
827
+ */
828
+ function createFileRoute(path) {
829
+ if (typeof path === "object") return new FileRoute(path, { silent: true }).createRoute(path);
830
+ return new FileRoute(path, { silent: true }).createRoute;
831
+ }
832
+ /**
833
+ @deprecated It's no longer recommended to use the `FileRoute` class directly.
834
+ Instead, use `createFileRoute('/path/to/file')(options)` to create a file route.
835
+ */
836
+ var FileRoute = class {
837
+ constructor(path, _opts) {
838
+ this.path = path;
839
+ this.createRoute = (options) => {
840
+ const route = createRoute(options);
841
+ route.isRoot = false;
842
+ return route;
843
+ };
844
+ this.silent = _opts?.silent;
845
+ }
846
+ };
847
+ var LazyRoute = class {
848
+ constructor(opts) {
849
+ this.useMatch = (opts) => {
850
+ return useMatch({
851
+ select: opts?.select,
852
+ from: this.options.id,
853
+ structuralSharing: opts?.structuralSharing
854
+ });
855
+ };
856
+ this.useRouteContext = (opts) => {
857
+ return useRouteContext({
858
+ ...opts,
859
+ from: this.options.id
860
+ });
861
+ };
862
+ this.useSearch = (opts) => {
863
+ return useSearch({
864
+ select: opts?.select,
865
+ structuralSharing: opts?.structuralSharing,
866
+ from: this.options.id
867
+ });
868
+ };
869
+ this.useParams = (opts) => {
870
+ return useParams({
871
+ select: opts?.select,
872
+ structuralSharing: opts?.structuralSharing,
873
+ from: this.options.id
874
+ });
875
+ };
876
+ this.useLoaderDeps = (opts) => {
877
+ return useLoaderDeps({
878
+ ...opts,
879
+ from: this.options.id
880
+ });
881
+ };
882
+ this.useLoaderData = (opts) => {
883
+ return useLoaderData({
884
+ ...opts,
885
+ from: this.options.id
886
+ });
887
+ };
888
+ this.useNavigate = () => {
889
+ return useNavigate({ from: useRouter().routesById[this.options.id].fullPath });
890
+ };
891
+ this.options = opts;
892
+ }
893
+ };
894
+ /**
895
+ * Creates a lazily-configurable file-based route stub by file path.
896
+ *
897
+ * Use this for code-splitting with file-based routes (eg. `.lazy.tsx` files).
898
+ * The returned function accepts only non-critical route options like
899
+ * `component`, `pendingComponent`, `errorComponent`, and `notFoundComponent`.
900
+ *
901
+ * @param id File path literal for the route file.
902
+ * @returns A function that accepts lazy route options and returns a `LazyRoute`.
903
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction
904
+ */
905
+ function createLazyFileRoute(id) {
906
+ if (typeof id === "object") return new LazyRoute(id);
907
+ return (opts) => new LazyRoute({
908
+ id,
909
+ ...opts
910
+ });
911
+ }
912
+ //#endregion
913
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/lazyRouteComponent.js
914
+ /**
915
+ * Wrap a dynamic import to create a route component that supports
916
+ * `.preload()` and friendly reload-on-module-missing behavior.
917
+ *
918
+ * @param importer Function returning a module promise
919
+ * @param exportName Named export to use (default: `default`)
920
+ * @returns A lazy route component compatible with TanStack Router
921
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/lazyRouteComponentFunction
922
+ */
923
+ function lazyRouteComponent(importer, exportName) {
924
+ let loadPromise;
925
+ let comp;
926
+ let error;
927
+ let reload;
928
+ const load = () => {
929
+ if (!loadPromise) loadPromise = importer().then((res) => {
930
+ loadPromise = void 0;
931
+ comp = res[exportName ?? "default"];
932
+ }).catch((err) => {
933
+ error = err;
934
+ if (isModuleNotFoundError(error)) {
935
+ if (error instanceof Error && typeof window !== "undefined" && typeof sessionStorage !== "undefined") {
936
+ const storageKey = `tanstack_router_reload:${error.message}`;
937
+ if (!sessionStorage.getItem(storageKey)) {
938
+ sessionStorage.setItem(storageKey, "1");
939
+ reload = true;
940
+ }
941
+ }
942
+ }
943
+ });
944
+ return loadPromise;
945
+ };
946
+ const lazyComp = function Lazy(props) {
947
+ if (reload) {
948
+ window.location.reload();
949
+ throw new Promise(() => {});
950
+ }
951
+ if (error) throw error;
952
+ if (!comp) if (reactUse) reactUse(load());
953
+ else throw load();
954
+ return import_react.createElement(comp, props);
955
+ };
956
+ lazyComp.preload = load;
957
+ return lazyComp;
958
+ }
959
+ //#endregion
960
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/subscribable.js
961
+ var Subscribable = class {
962
+ constructor() {
963
+ this.listeners = /* @__PURE__ */ new Set();
964
+ this.subscribe = this.subscribe.bind(this);
965
+ }
966
+ subscribe(listener) {
967
+ this.listeners.add(listener);
968
+ this.onSubscribe();
969
+ return () => {
970
+ this.listeners.delete(listener);
971
+ this.onUnsubscribe();
972
+ };
973
+ }
974
+ hasListeners() {
975
+ return this.listeners.size > 0;
976
+ }
977
+ onSubscribe() {}
978
+ onUnsubscribe() {}
979
+ };
980
+ //#endregion
981
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/focusManager.js
982
+ var FocusManager = class extends Subscribable {
983
+ #focused;
984
+ #cleanup;
985
+ #setup;
986
+ constructor() {
987
+ super();
988
+ this.#setup = (onFocus) => {
989
+ if (typeof window !== "undefined" && window.addEventListener) {
990
+ const listener = () => onFocus();
991
+ window.addEventListener("visibilitychange", listener, false);
992
+ return () => {
993
+ window.removeEventListener("visibilitychange", listener);
994
+ };
995
+ }
996
+ };
997
+ }
998
+ onSubscribe() {
999
+ if (!this.#cleanup) this.setEventListener(this.#setup);
1000
+ }
1001
+ onUnsubscribe() {
1002
+ if (!this.hasListeners()) {
1003
+ this.#cleanup?.();
1004
+ this.#cleanup = void 0;
1005
+ }
1006
+ }
1007
+ setEventListener(setup) {
1008
+ this.#setup = setup;
1009
+ this.#cleanup?.();
1010
+ this.#cleanup = setup((focused) => {
1011
+ if (typeof focused === "boolean") this.setFocused(focused);
1012
+ else this.onFocus();
1013
+ });
1014
+ }
1015
+ setFocused(focused) {
1016
+ if (this.#focused !== focused) {
1017
+ this.#focused = focused;
1018
+ this.onFocus();
1019
+ }
1020
+ }
1021
+ onFocus() {
1022
+ const isFocused = this.isFocused();
1023
+ this.listeners.forEach((listener) => {
1024
+ listener(isFocused);
1025
+ });
1026
+ }
1027
+ isFocused() {
1028
+ if (typeof this.#focused === "boolean") return this.#focused;
1029
+ return globalThis.document?.visibilityState !== "hidden";
1030
+ }
1031
+ };
1032
+ var focusManager = new FocusManager();
1033
+ //#endregion
1034
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
1035
+ var defaultTimeoutProvider = {
1036
+ setTimeout: (callback, delay) => setTimeout(callback, delay),
1037
+ clearTimeout: (timeoutId) => clearTimeout(timeoutId),
1038
+ setInterval: (callback, delay) => setInterval(callback, delay),
1039
+ clearInterval: (intervalId) => clearInterval(intervalId)
1040
+ };
1041
+ var TimeoutManager = class {
1042
+ #provider = defaultTimeoutProvider;
1043
+ #providerCalled = false;
1044
+ setTimeoutProvider(provider) {
1045
+ this.#provider = provider;
1046
+ }
1047
+ setTimeout(callback, delay) {
1048
+ return this.#provider.setTimeout(callback, delay);
1049
+ }
1050
+ clearTimeout(timeoutId) {
1051
+ this.#provider.clearTimeout(timeoutId);
1052
+ }
1053
+ setInterval(callback, delay) {
1054
+ return this.#provider.setInterval(callback, delay);
1055
+ }
1056
+ clearInterval(intervalId) {
1057
+ this.#provider.clearInterval(intervalId);
1058
+ }
1059
+ };
1060
+ var timeoutManager = new TimeoutManager();
1061
+ function systemSetTimeoutZero(callback) {
1062
+ setTimeout(callback, 0);
1063
+ }
1064
+ //#endregion
1065
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/utils.js
1066
+ var isServer = typeof window === "undefined" || "Deno" in globalThis;
1067
+ function noop() {}
1068
+ function functionalUpdate(updater, input) {
1069
+ return typeof updater === "function" ? updater(input) : updater;
1070
+ }
1071
+ function isValidTimeout(value) {
1072
+ return typeof value === "number" && value >= 0 && value !== Infinity;
1073
+ }
1074
+ function timeUntilStale(updatedAt, staleTime) {
1075
+ return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
1076
+ }
1077
+ function resolveStaleTime(staleTime, query) {
1078
+ return typeof staleTime === "function" ? staleTime(query) : staleTime;
1079
+ }
1080
+ function resolveEnabled(enabled, query) {
1081
+ return typeof enabled === "function" ? enabled(query) : enabled;
1082
+ }
1083
+ function matchQuery(filters, query) {
1084
+ const { type = "all", exact, fetchStatus, predicate, queryKey, stale } = filters;
1085
+ if (queryKey) {
1086
+ if (exact) {
1087
+ if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) return false;
1088
+ } else if (!partialMatchKey(query.queryKey, queryKey)) return false;
1089
+ }
1090
+ if (type !== "all") {
1091
+ const isActive = query.isActive();
1092
+ if (type === "active" && !isActive) return false;
1093
+ if (type === "inactive" && isActive) return false;
1094
+ }
1095
+ if (typeof stale === "boolean" && query.isStale() !== stale) return false;
1096
+ if (fetchStatus && fetchStatus !== query.state.fetchStatus) return false;
1097
+ if (predicate && !predicate(query)) return false;
1098
+ return true;
1099
+ }
1100
+ function matchMutation(filters, mutation) {
1101
+ const { exact, status, predicate, mutationKey } = filters;
1102
+ if (mutationKey) {
1103
+ if (!mutation.options.mutationKey) return false;
1104
+ if (exact) {
1105
+ if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) return false;
1106
+ } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) return false;
1107
+ }
1108
+ if (status && mutation.state.status !== status) return false;
1109
+ if (predicate && !predicate(mutation)) return false;
1110
+ return true;
1111
+ }
1112
+ function hashQueryKeyByOptions(queryKey, options) {
1113
+ return (options?.queryKeyHashFn || hashKey)(queryKey);
1114
+ }
1115
+ function hashKey(queryKey) {
1116
+ return JSON.stringify(queryKey, (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {
1117
+ result[key] = val[key];
1118
+ return result;
1119
+ }, {}) : val);
1120
+ }
1121
+ function partialMatchKey(a, b) {
1122
+ if (a === b) return true;
1123
+ if (typeof a !== typeof b) return false;
1124
+ if (a && b && typeof a === "object" && typeof b === "object") return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]));
1125
+ return false;
1126
+ }
1127
+ var hasOwn = Object.prototype.hasOwnProperty;
1128
+ function replaceEqualDeep(a, b, depth = 0) {
1129
+ if (a === b) return a;
1130
+ if (depth > 500) return b;
1131
+ const array = isPlainArray(a) && isPlainArray(b);
1132
+ if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;
1133
+ const aSize = (array ? a : Object.keys(a)).length;
1134
+ const bItems = array ? b : Object.keys(b);
1135
+ const bSize = bItems.length;
1136
+ const copy = array ? new Array(bSize) : {};
1137
+ let equalItems = 0;
1138
+ for (let i = 0; i < bSize; i++) {
1139
+ const key = array ? i : bItems[i];
1140
+ const aItem = a[key];
1141
+ const bItem = b[key];
1142
+ if (aItem === bItem) {
1143
+ copy[key] = aItem;
1144
+ if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;
1145
+ continue;
1146
+ }
1147
+ if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") {
1148
+ copy[key] = bItem;
1149
+ continue;
1150
+ }
1151
+ const v = replaceEqualDeep(aItem, bItem, depth + 1);
1152
+ copy[key] = v;
1153
+ if (v === aItem) equalItems++;
1154
+ }
1155
+ return aSize === bSize && equalItems === aSize ? a : copy;
1156
+ }
1157
+ function shallowEqualObjects(a, b) {
1158
+ if (!b || Object.keys(a).length !== Object.keys(b).length) return false;
1159
+ for (const key in a) if (a[key] !== b[key]) return false;
1160
+ return true;
1161
+ }
1162
+ function isPlainArray(value) {
1163
+ return Array.isArray(value) && value.length === Object.keys(value).length;
1164
+ }
1165
+ function isPlainObject(o) {
1166
+ if (!hasObjectPrototype(o)) return false;
1167
+ const ctor = o.constructor;
1168
+ if (ctor === void 0) return true;
1169
+ const prot = ctor.prototype;
1170
+ if (!hasObjectPrototype(prot)) return false;
1171
+ if (!prot.hasOwnProperty("isPrototypeOf")) return false;
1172
+ if (Object.getPrototypeOf(o) !== Object.prototype) return false;
1173
+ return true;
1174
+ }
1175
+ function hasObjectPrototype(o) {
1176
+ return Object.prototype.toString.call(o) === "[object Object]";
1177
+ }
1178
+ function sleep(timeout) {
1179
+ return new Promise((resolve) => {
1180
+ timeoutManager.setTimeout(resolve, timeout);
1181
+ });
1182
+ }
1183
+ function replaceData(prevData, data, options) {
1184
+ if (typeof options.structuralSharing === "function") return options.structuralSharing(prevData, data);
1185
+ else if (options.structuralSharing !== false) return replaceEqualDeep(prevData, data);
1186
+ return data;
1187
+ }
1188
+ function addToEnd(items, item, max = 0) {
1189
+ const newItems = [...items, item];
1190
+ return max && newItems.length > max ? newItems.slice(1) : newItems;
1191
+ }
1192
+ function addToStart(items, item, max = 0) {
1193
+ const newItems = [item, ...items];
1194
+ return max && newItems.length > max ? newItems.slice(0, -1) : newItems;
1195
+ }
1196
+ var skipToken = /* @__PURE__ */ Symbol();
1197
+ function ensureQueryFn(options, fetchOptions) {
1198
+ if (!options.queryFn && fetchOptions?.initialPromise) return () => fetchOptions.initialPromise;
1199
+ if (!options.queryFn || options.queryFn === skipToken) return () => Promise.reject(/* @__PURE__ */ new Error(`Missing queryFn: '${options.queryHash}'`));
1200
+ return options.queryFn;
1201
+ }
1202
+ function shouldThrowError(throwOnError, params) {
1203
+ if (typeof throwOnError === "function") return throwOnError(...params);
1204
+ return !!throwOnError;
1205
+ }
1206
+ function addConsumeAwareSignal(object, getSignal, onCancelled) {
1207
+ let consumed = false;
1208
+ let signal;
1209
+ Object.defineProperty(object, "signal", {
1210
+ enumerable: true,
1211
+ get: () => {
1212
+ signal ??= getSignal();
1213
+ if (consumed) return signal;
1214
+ consumed = true;
1215
+ if (signal.aborted) onCancelled();
1216
+ else signal.addEventListener("abort", onCancelled, { once: true });
1217
+ return signal;
1218
+ }
1219
+ });
1220
+ return object;
1221
+ }
1222
+ //#endregion
1223
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/environmentManager.js
1224
+ var environmentManager = /* @__PURE__ */ (() => {
1225
+ let isServerFn = () => isServer;
1226
+ return {
1227
+ isServer() {
1228
+ return isServerFn();
1229
+ },
1230
+ setIsServer(isServerValue) {
1231
+ isServerFn = isServerValue;
1232
+ }
1233
+ };
1234
+ })();
1235
+ //#endregion
1236
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/thenable.js
1237
+ function pendingThenable() {
1238
+ let resolve;
1239
+ let reject;
1240
+ const thenable = new Promise((_resolve, _reject) => {
1241
+ resolve = _resolve;
1242
+ reject = _reject;
1243
+ });
1244
+ thenable.status = "pending";
1245
+ thenable.catch(() => {});
1246
+ function finalize(data) {
1247
+ Object.assign(thenable, data);
1248
+ delete thenable.resolve;
1249
+ delete thenable.reject;
1250
+ }
1251
+ thenable.resolve = (value) => {
1252
+ finalize({
1253
+ status: "fulfilled",
1254
+ value
1255
+ });
1256
+ resolve(value);
1257
+ };
1258
+ thenable.reject = (reason) => {
1259
+ finalize({
1260
+ status: "rejected",
1261
+ reason
1262
+ });
1263
+ reject(reason);
1264
+ };
1265
+ return thenable;
1266
+ }
1267
+ //#endregion
1268
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/notifyManager.js
1269
+ var defaultScheduler = systemSetTimeoutZero;
1270
+ function createNotifyManager() {
1271
+ let queue = [];
1272
+ let transactions = 0;
1273
+ let notifyFn = (callback) => {
1274
+ callback();
1275
+ };
1276
+ let batchNotifyFn = (callback) => {
1277
+ callback();
1278
+ };
1279
+ let scheduleFn = defaultScheduler;
1280
+ const schedule = (callback) => {
1281
+ if (transactions) queue.push(callback);
1282
+ else scheduleFn(() => {
1283
+ notifyFn(callback);
1284
+ });
1285
+ };
1286
+ const flush = () => {
1287
+ const originalQueue = queue;
1288
+ queue = [];
1289
+ if (originalQueue.length) scheduleFn(() => {
1290
+ batchNotifyFn(() => {
1291
+ originalQueue.forEach((callback) => {
1292
+ notifyFn(callback);
1293
+ });
1294
+ });
1295
+ });
1296
+ };
1297
+ return {
1298
+ batch: (callback) => {
1299
+ let result;
1300
+ transactions++;
1301
+ try {
1302
+ result = callback();
1303
+ } finally {
1304
+ transactions--;
1305
+ if (!transactions) flush();
1306
+ }
1307
+ return result;
1308
+ },
1309
+ batchCalls: (callback) => {
1310
+ return (...args) => {
1311
+ schedule(() => {
1312
+ callback(...args);
1313
+ });
1314
+ };
1315
+ },
1316
+ schedule,
1317
+ setNotifyFunction: (fn) => {
1318
+ notifyFn = fn;
1319
+ },
1320
+ setBatchNotifyFunction: (fn) => {
1321
+ batchNotifyFn = fn;
1322
+ },
1323
+ setScheduler: (fn) => {
1324
+ scheduleFn = fn;
1325
+ }
1326
+ };
1327
+ }
1328
+ var notifyManager = createNotifyManager();
1329
+ //#endregion
1330
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/onlineManager.js
1331
+ var OnlineManager = class extends Subscribable {
1332
+ #online = true;
1333
+ #cleanup;
1334
+ #setup;
1335
+ constructor() {
1336
+ super();
1337
+ this.#setup = (onOnline) => {
1338
+ if (typeof window !== "undefined" && window.addEventListener) {
1339
+ const onlineListener = () => onOnline(true);
1340
+ const offlineListener = () => onOnline(false);
1341
+ window.addEventListener("online", onlineListener, false);
1342
+ window.addEventListener("offline", offlineListener, false);
1343
+ return () => {
1344
+ window.removeEventListener("online", onlineListener);
1345
+ window.removeEventListener("offline", offlineListener);
1346
+ };
1347
+ }
1348
+ };
1349
+ }
1350
+ onSubscribe() {
1351
+ if (!this.#cleanup) this.setEventListener(this.#setup);
1352
+ }
1353
+ onUnsubscribe() {
1354
+ if (!this.hasListeners()) {
1355
+ this.#cleanup?.();
1356
+ this.#cleanup = void 0;
1357
+ }
1358
+ }
1359
+ setEventListener(setup) {
1360
+ this.#setup = setup;
1361
+ this.#cleanup?.();
1362
+ this.#cleanup = setup(this.setOnline.bind(this));
1363
+ }
1364
+ setOnline(online) {
1365
+ if (this.#online !== online) {
1366
+ this.#online = online;
1367
+ this.listeners.forEach((listener) => {
1368
+ listener(online);
1369
+ });
1370
+ }
1371
+ }
1372
+ isOnline() {
1373
+ return this.#online;
1374
+ }
1375
+ };
1376
+ var onlineManager = new OnlineManager();
1377
+ //#endregion
1378
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/retryer.js
1379
+ function defaultRetryDelay(failureCount) {
1380
+ return Math.min(1e3 * 2 ** failureCount, 3e4);
1381
+ }
1382
+ function canFetch(networkMode) {
1383
+ return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true;
1384
+ }
1385
+ var CancelledError = class extends Error {
1386
+ constructor(options) {
1387
+ super("CancelledError");
1388
+ this.revert = options?.revert;
1389
+ this.silent = options?.silent;
1390
+ }
1391
+ };
1392
+ function createRetryer(config) {
1393
+ let isRetryCancelled = false;
1394
+ let failureCount = 0;
1395
+ let continueFn;
1396
+ const thenable = pendingThenable();
1397
+ const isResolved = () => thenable.status !== "pending";
1398
+ const cancel = (cancelOptions) => {
1399
+ if (!isResolved()) {
1400
+ const error = new CancelledError(cancelOptions);
1401
+ reject(error);
1402
+ config.onCancel?.(error);
1403
+ }
1404
+ };
1405
+ const cancelRetry = () => {
1406
+ isRetryCancelled = true;
1407
+ };
1408
+ const continueRetry = () => {
1409
+ isRetryCancelled = false;
1410
+ };
1411
+ const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun();
1412
+ const canStart = () => canFetch(config.networkMode) && config.canRun();
1413
+ const resolve = (value) => {
1414
+ if (!isResolved()) {
1415
+ continueFn?.();
1416
+ thenable.resolve(value);
1417
+ }
1418
+ };
1419
+ const reject = (value) => {
1420
+ if (!isResolved()) {
1421
+ continueFn?.();
1422
+ thenable.reject(value);
1423
+ }
1424
+ };
1425
+ const pause = () => {
1426
+ return new Promise((continueResolve) => {
1427
+ continueFn = (value) => {
1428
+ if (isResolved() || canContinue()) continueResolve(value);
1429
+ };
1430
+ config.onPause?.();
1431
+ }).then(() => {
1432
+ continueFn = void 0;
1433
+ if (!isResolved()) config.onContinue?.();
1434
+ });
1435
+ };
1436
+ const run = () => {
1437
+ if (isResolved()) return;
1438
+ let promiseOrValue;
1439
+ const initialPromise = failureCount === 0 ? config.initialPromise : void 0;
1440
+ try {
1441
+ promiseOrValue = initialPromise ?? config.fn();
1442
+ } catch (error) {
1443
+ promiseOrValue = Promise.reject(error);
1444
+ }
1445
+ Promise.resolve(promiseOrValue).then(resolve).catch((error) => {
1446
+ if (isResolved()) return;
1447
+ const retry = config.retry ?? (environmentManager.isServer() ? 0 : 3);
1448
+ const retryDelay = config.retryDelay ?? defaultRetryDelay;
1449
+ const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay;
1450
+ const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error);
1451
+ if (isRetryCancelled || !shouldRetry) {
1452
+ reject(error);
1453
+ return;
1454
+ }
1455
+ failureCount++;
1456
+ config.onFail?.(failureCount, error);
1457
+ sleep(delay).then(() => {
1458
+ return canContinue() ? void 0 : pause();
1459
+ }).then(() => {
1460
+ if (isRetryCancelled) reject(error);
1461
+ else run();
1462
+ });
1463
+ });
1464
+ };
1465
+ return {
1466
+ promise: thenable,
1467
+ status: () => thenable.status,
1468
+ cancel,
1469
+ continue: () => {
1470
+ continueFn?.();
1471
+ return thenable;
1472
+ },
1473
+ cancelRetry,
1474
+ continueRetry,
1475
+ canStart,
1476
+ start: () => {
1477
+ if (canStart()) run();
1478
+ else pause().then(run);
1479
+ return thenable;
1480
+ }
1481
+ };
1482
+ }
1483
+ //#endregion
1484
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/removable.js
1485
+ var Removable = class {
1486
+ #gcTimeout;
1487
+ destroy() {
1488
+ this.clearGcTimeout();
1489
+ }
1490
+ scheduleGc() {
1491
+ this.clearGcTimeout();
1492
+ if (isValidTimeout(this.gcTime)) this.#gcTimeout = timeoutManager.setTimeout(() => {
1493
+ this.optionalRemove();
1494
+ }, this.gcTime);
1495
+ }
1496
+ updateGcTime(newGcTime) {
1497
+ this.gcTime = Math.max(this.gcTime || 0, newGcTime ?? (environmentManager.isServer() ? Infinity : 300 * 1e3));
1498
+ }
1499
+ clearGcTimeout() {
1500
+ if (this.#gcTimeout) {
1501
+ timeoutManager.clearTimeout(this.#gcTimeout);
1502
+ this.#gcTimeout = void 0;
1503
+ }
1504
+ }
1505
+ };
1506
+ //#endregion
1507
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/query.js
1508
+ var Query = class extends Removable {
1509
+ #initialState;
1510
+ #revertState;
1511
+ #cache;
1512
+ #client;
1513
+ #retryer;
1514
+ #defaultOptions;
1515
+ #abortSignalConsumed;
1516
+ constructor(config) {
1517
+ super();
1518
+ this.#abortSignalConsumed = false;
1519
+ this.#defaultOptions = config.defaultOptions;
1520
+ this.setOptions(config.options);
1521
+ this.observers = [];
1522
+ this.#client = config.client;
1523
+ this.#cache = this.#client.getQueryCache();
1524
+ this.queryKey = config.queryKey;
1525
+ this.queryHash = config.queryHash;
1526
+ this.#initialState = getDefaultState$1(this.options);
1527
+ this.state = config.state ?? this.#initialState;
1528
+ this.scheduleGc();
1529
+ }
1530
+ get meta() {
1531
+ return this.options.meta;
1532
+ }
1533
+ get promise() {
1534
+ return this.#retryer?.promise;
1535
+ }
1536
+ setOptions(options) {
1537
+ this.options = {
1538
+ ...this.#defaultOptions,
1539
+ ...options
1540
+ };
1541
+ this.updateGcTime(this.options.gcTime);
1542
+ if (this.state && this.state.data === void 0) {
1543
+ const defaultState = getDefaultState$1(this.options);
1544
+ if (defaultState.data !== void 0) {
1545
+ this.setState(successState(defaultState.data, defaultState.dataUpdatedAt));
1546
+ this.#initialState = defaultState;
1547
+ }
1548
+ }
1549
+ }
1550
+ optionalRemove() {
1551
+ if (!this.observers.length && this.state.fetchStatus === "idle") this.#cache.remove(this);
1552
+ }
1553
+ setData(newData, options) {
1554
+ const data = replaceData(this.state.data, newData, this.options);
1555
+ this.#dispatch({
1556
+ data,
1557
+ type: "success",
1558
+ dataUpdatedAt: options?.updatedAt,
1559
+ manual: options?.manual
1560
+ });
1561
+ return data;
1562
+ }
1563
+ setState(state, setStateOptions) {
1564
+ this.#dispatch({
1565
+ type: "setState",
1566
+ state,
1567
+ setStateOptions
1568
+ });
1569
+ }
1570
+ cancel(options) {
1571
+ const promise = this.#retryer?.promise;
1572
+ this.#retryer?.cancel(options);
1573
+ return promise ? promise.then(noop).catch(noop) : Promise.resolve();
1574
+ }
1575
+ destroy() {
1576
+ super.destroy();
1577
+ this.cancel({ silent: true });
1578
+ }
1579
+ get resetState() {
1580
+ return this.#initialState;
1581
+ }
1582
+ reset() {
1583
+ this.destroy();
1584
+ this.setState(this.resetState);
1585
+ }
1586
+ isActive() {
1587
+ return this.observers.some((observer) => resolveEnabled(observer.options.enabled, this) !== false);
1588
+ }
1589
+ isDisabled() {
1590
+ if (this.getObserversCount() > 0) return !this.isActive();
1591
+ return this.options.queryFn === skipToken || !this.isFetched();
1592
+ }
1593
+ isFetched() {
1594
+ return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
1595
+ }
1596
+ isStatic() {
1597
+ if (this.getObserversCount() > 0) return this.observers.some((observer) => resolveStaleTime(observer.options.staleTime, this) === "static");
1598
+ return false;
1599
+ }
1600
+ isStale() {
1601
+ if (this.getObserversCount() > 0) return this.observers.some((observer) => observer.getCurrentResult().isStale);
1602
+ return this.state.data === void 0 || this.state.isInvalidated;
1603
+ }
1604
+ isStaleByTime(staleTime = 0) {
1605
+ if (this.state.data === void 0) return true;
1606
+ if (staleTime === "static") return false;
1607
+ if (this.state.isInvalidated) return true;
1608
+ return !timeUntilStale(this.state.dataUpdatedAt, staleTime);
1609
+ }
1610
+ onFocus() {
1611
+ this.observers.find((x) => x.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: false });
1612
+ this.#retryer?.continue();
1613
+ }
1614
+ onOnline() {
1615
+ this.observers.find((x) => x.shouldFetchOnReconnect())?.refetch({ cancelRefetch: false });
1616
+ this.#retryer?.continue();
1617
+ }
1618
+ addObserver(observer) {
1619
+ if (!this.observers.includes(observer)) {
1620
+ this.observers.push(observer);
1621
+ this.clearGcTimeout();
1622
+ this.#cache.notify({
1623
+ type: "observerAdded",
1624
+ query: this,
1625
+ observer
1626
+ });
1627
+ }
1628
+ }
1629
+ removeObserver(observer) {
1630
+ if (this.observers.includes(observer)) {
1631
+ this.observers = this.observers.filter((x) => x !== observer);
1632
+ if (!this.observers.length) {
1633
+ if (this.#retryer) if (this.#abortSignalConsumed || this.#isInitialPausedFetch()) this.#retryer.cancel({ revert: true });
1634
+ else this.#retryer.cancelRetry();
1635
+ this.scheduleGc();
1636
+ }
1637
+ this.#cache.notify({
1638
+ type: "observerRemoved",
1639
+ query: this,
1640
+ observer
1641
+ });
1642
+ }
1643
+ }
1644
+ getObserversCount() {
1645
+ return this.observers.length;
1646
+ }
1647
+ #isInitialPausedFetch() {
1648
+ return this.state.fetchStatus === "paused" && this.state.status === "pending";
1649
+ }
1650
+ invalidate() {
1651
+ if (!this.state.isInvalidated) this.#dispatch({ type: "invalidate" });
1652
+ }
1653
+ async fetch(options, fetchOptions) {
1654
+ if (this.state.fetchStatus !== "idle" && this.#retryer?.status() !== "rejected") {
1655
+ if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) this.cancel({ silent: true });
1656
+ else if (this.#retryer) {
1657
+ this.#retryer.continueRetry();
1658
+ return this.#retryer.promise;
1659
+ }
1660
+ }
1661
+ if (options) this.setOptions(options);
1662
+ if (!this.options.queryFn) {
1663
+ const observer = this.observers.find((x) => x.options.queryFn);
1664
+ if (observer) this.setOptions(observer.options);
1665
+ }
1666
+ const abortController = new AbortController();
1667
+ const addSignalProperty = (object) => {
1668
+ Object.defineProperty(object, "signal", {
1669
+ enumerable: true,
1670
+ get: () => {
1671
+ this.#abortSignalConsumed = true;
1672
+ return abortController.signal;
1673
+ }
1674
+ });
1675
+ };
1676
+ const fetchFn = () => {
1677
+ const queryFn = ensureQueryFn(this.options, fetchOptions);
1678
+ const createQueryFnContext = () => {
1679
+ const queryFnContext2 = {
1680
+ client: this.#client,
1681
+ queryKey: this.queryKey,
1682
+ meta: this.meta
1683
+ };
1684
+ addSignalProperty(queryFnContext2);
1685
+ return queryFnContext2;
1686
+ };
1687
+ const queryFnContext = createQueryFnContext();
1688
+ this.#abortSignalConsumed = false;
1689
+ if (this.options.persister) return this.options.persister(queryFn, queryFnContext, this);
1690
+ return queryFn(queryFnContext);
1691
+ };
1692
+ const createFetchContext = () => {
1693
+ const context2 = {
1694
+ fetchOptions,
1695
+ options: this.options,
1696
+ queryKey: this.queryKey,
1697
+ client: this.#client,
1698
+ state: this.state,
1699
+ fetchFn
1700
+ };
1701
+ addSignalProperty(context2);
1702
+ return context2;
1703
+ };
1704
+ const context = createFetchContext();
1705
+ this.options.behavior?.onFetch(context, this);
1706
+ this.#revertState = this.state;
1707
+ if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) this.#dispatch({
1708
+ type: "fetch",
1709
+ meta: context.fetchOptions?.meta
1710
+ });
1711
+ this.#retryer = createRetryer({
1712
+ initialPromise: fetchOptions?.initialPromise,
1713
+ fn: context.fetchFn,
1714
+ onCancel: (error) => {
1715
+ if (error instanceof CancelledError && error.revert) this.setState({
1716
+ ...this.#revertState,
1717
+ fetchStatus: "idle"
1718
+ });
1719
+ abortController.abort();
1720
+ },
1721
+ onFail: (failureCount, error) => {
1722
+ this.#dispatch({
1723
+ type: "failed",
1724
+ failureCount,
1725
+ error
1726
+ });
1727
+ },
1728
+ onPause: () => {
1729
+ this.#dispatch({ type: "pause" });
1730
+ },
1731
+ onContinue: () => {
1732
+ this.#dispatch({ type: "continue" });
1733
+ },
1734
+ retry: context.options.retry,
1735
+ retryDelay: context.options.retryDelay,
1736
+ networkMode: context.options.networkMode,
1737
+ canRun: () => true
1738
+ });
1739
+ try {
1740
+ const data = await this.#retryer.start();
1741
+ if (data === void 0) throw new Error(`${this.queryHash} data is undefined`);
1742
+ this.setData(data);
1743
+ this.#cache.config.onSuccess?.(data, this);
1744
+ this.#cache.config.onSettled?.(data, this.state.error, this);
1745
+ return data;
1746
+ } catch (error) {
1747
+ if (error instanceof CancelledError) {
1748
+ if (error.silent) return this.#retryer.promise;
1749
+ else if (error.revert) {
1750
+ if (this.state.data === void 0) throw error;
1751
+ return this.state.data;
1752
+ }
1753
+ }
1754
+ this.#dispatch({
1755
+ type: "error",
1756
+ error
1757
+ });
1758
+ this.#cache.config.onError?.(error, this);
1759
+ this.#cache.config.onSettled?.(this.state.data, error, this);
1760
+ throw error;
1761
+ } finally {
1762
+ this.scheduleGc();
1763
+ }
1764
+ }
1765
+ #dispatch(action) {
1766
+ const reducer = (state) => {
1767
+ switch (action.type) {
1768
+ case "failed": return {
1769
+ ...state,
1770
+ fetchFailureCount: action.failureCount,
1771
+ fetchFailureReason: action.error
1772
+ };
1773
+ case "pause": return {
1774
+ ...state,
1775
+ fetchStatus: "paused"
1776
+ };
1777
+ case "continue": return {
1778
+ ...state,
1779
+ fetchStatus: "fetching"
1780
+ };
1781
+ case "fetch": return {
1782
+ ...state,
1783
+ ...fetchState(state.data, this.options),
1784
+ fetchMeta: action.meta ?? null
1785
+ };
1786
+ case "success":
1787
+ const newState = {
1788
+ ...state,
1789
+ ...successState(action.data, action.dataUpdatedAt),
1790
+ dataUpdateCount: state.dataUpdateCount + 1,
1791
+ ...!action.manual && {
1792
+ fetchStatus: "idle",
1793
+ fetchFailureCount: 0,
1794
+ fetchFailureReason: null
1795
+ }
1796
+ };
1797
+ this.#revertState = action.manual ? newState : void 0;
1798
+ return newState;
1799
+ case "error":
1800
+ const error = action.error;
1801
+ return {
1802
+ ...state,
1803
+ error,
1804
+ errorUpdateCount: state.errorUpdateCount + 1,
1805
+ errorUpdatedAt: Date.now(),
1806
+ fetchFailureCount: state.fetchFailureCount + 1,
1807
+ fetchFailureReason: error,
1808
+ fetchStatus: "idle",
1809
+ status: "error",
1810
+ isInvalidated: true
1811
+ };
1812
+ case "invalidate": return {
1813
+ ...state,
1814
+ isInvalidated: true
1815
+ };
1816
+ case "setState": return {
1817
+ ...state,
1818
+ ...action.state
1819
+ };
1820
+ }
1821
+ };
1822
+ this.state = reducer(this.state);
1823
+ notifyManager.batch(() => {
1824
+ this.observers.forEach((observer) => {
1825
+ observer.onQueryUpdate();
1826
+ });
1827
+ this.#cache.notify({
1828
+ query: this,
1829
+ type: "updated",
1830
+ action
1831
+ });
1832
+ });
1833
+ }
1834
+ };
1835
+ function fetchState(data, options) {
1836
+ return {
1837
+ fetchFailureCount: 0,
1838
+ fetchFailureReason: null,
1839
+ fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused",
1840
+ ...data === void 0 && {
1841
+ error: null,
1842
+ status: "pending"
1843
+ }
1844
+ };
1845
+ }
1846
+ function successState(data, dataUpdatedAt) {
1847
+ return {
1848
+ data,
1849
+ dataUpdatedAt: dataUpdatedAt ?? Date.now(),
1850
+ error: null,
1851
+ isInvalidated: false,
1852
+ status: "success"
1853
+ };
1854
+ }
1855
+ function getDefaultState$1(options) {
1856
+ const data = typeof options.initialData === "function" ? options.initialData() : options.initialData;
1857
+ const hasData = data !== void 0;
1858
+ const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;
1859
+ return {
1860
+ data,
1861
+ dataUpdateCount: 0,
1862
+ dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,
1863
+ error: null,
1864
+ errorUpdateCount: 0,
1865
+ errorUpdatedAt: 0,
1866
+ fetchFailureCount: 0,
1867
+ fetchFailureReason: null,
1868
+ fetchMeta: null,
1869
+ isInvalidated: false,
1870
+ status: hasData ? "success" : "pending",
1871
+ fetchStatus: "idle"
1872
+ };
1873
+ }
1874
+ //#endregion
1875
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/mutation.js
1876
+ var Mutation = class extends Removable {
1877
+ #client;
1878
+ #observers;
1879
+ #mutationCache;
1880
+ #retryer;
1881
+ constructor(config) {
1882
+ super();
1883
+ this.#client = config.client;
1884
+ this.mutationId = config.mutationId;
1885
+ this.#mutationCache = config.mutationCache;
1886
+ this.#observers = [];
1887
+ this.state = config.state || getDefaultState();
1888
+ this.setOptions(config.options);
1889
+ this.scheduleGc();
1890
+ }
1891
+ setOptions(options) {
1892
+ this.options = options;
1893
+ this.updateGcTime(this.options.gcTime);
1894
+ }
1895
+ get meta() {
1896
+ return this.options.meta;
1897
+ }
1898
+ addObserver(observer) {
1899
+ if (!this.#observers.includes(observer)) {
1900
+ this.#observers.push(observer);
1901
+ this.clearGcTimeout();
1902
+ this.#mutationCache.notify({
1903
+ type: "observerAdded",
1904
+ mutation: this,
1905
+ observer
1906
+ });
1907
+ }
1908
+ }
1909
+ removeObserver(observer) {
1910
+ this.#observers = this.#observers.filter((x) => x !== observer);
1911
+ this.scheduleGc();
1912
+ this.#mutationCache.notify({
1913
+ type: "observerRemoved",
1914
+ mutation: this,
1915
+ observer
1916
+ });
1917
+ }
1918
+ optionalRemove() {
1919
+ if (!this.#observers.length) if (this.state.status === "pending") this.scheduleGc();
1920
+ else this.#mutationCache.remove(this);
1921
+ }
1922
+ continue() {
1923
+ return this.#retryer?.continue() ?? this.execute(this.state.variables);
1924
+ }
1925
+ async execute(variables) {
1926
+ const onContinue = () => {
1927
+ this.#dispatch({ type: "continue" });
1928
+ };
1929
+ const mutationFnContext = {
1930
+ client: this.#client,
1931
+ meta: this.options.meta,
1932
+ mutationKey: this.options.mutationKey
1933
+ };
1934
+ this.#retryer = createRetryer({
1935
+ fn: () => {
1936
+ if (!this.options.mutationFn) return Promise.reject(/* @__PURE__ */ new Error("No mutationFn found"));
1937
+ return this.options.mutationFn(variables, mutationFnContext);
1938
+ },
1939
+ onFail: (failureCount, error) => {
1940
+ this.#dispatch({
1941
+ type: "failed",
1942
+ failureCount,
1943
+ error
1944
+ });
1945
+ },
1946
+ onPause: () => {
1947
+ this.#dispatch({ type: "pause" });
1948
+ },
1949
+ onContinue,
1950
+ retry: this.options.retry ?? 0,
1951
+ retryDelay: this.options.retryDelay,
1952
+ networkMode: this.options.networkMode,
1953
+ canRun: () => this.#mutationCache.canRun(this)
1954
+ });
1955
+ const restored = this.state.status === "pending";
1956
+ const isPaused = !this.#retryer.canStart();
1957
+ try {
1958
+ if (restored) onContinue();
1959
+ else {
1960
+ this.#dispatch({
1961
+ type: "pending",
1962
+ variables,
1963
+ isPaused
1964
+ });
1965
+ if (this.#mutationCache.config.onMutate) await this.#mutationCache.config.onMutate(variables, this, mutationFnContext);
1966
+ const context = await this.options.onMutate?.(variables, mutationFnContext);
1967
+ if (context !== this.state.context) this.#dispatch({
1968
+ type: "pending",
1969
+ context,
1970
+ variables,
1971
+ isPaused
1972
+ });
1973
+ }
1974
+ const data = await this.#retryer.start();
1975
+ await this.#mutationCache.config.onSuccess?.(data, variables, this.state.context, this, mutationFnContext);
1976
+ await this.options.onSuccess?.(data, variables, this.state.context, mutationFnContext);
1977
+ await this.#mutationCache.config.onSettled?.(data, null, this.state.variables, this.state.context, this, mutationFnContext);
1978
+ await this.options.onSettled?.(data, null, variables, this.state.context, mutationFnContext);
1979
+ this.#dispatch({
1980
+ type: "success",
1981
+ data
1982
+ });
1983
+ return data;
1984
+ } catch (error) {
1985
+ try {
1986
+ await this.#mutationCache.config.onError?.(error, variables, this.state.context, this, mutationFnContext);
1987
+ } catch (e) {
1988
+ Promise.reject(e);
1989
+ }
1990
+ try {
1991
+ await this.options.onError?.(error, variables, this.state.context, mutationFnContext);
1992
+ } catch (e) {
1993
+ Promise.reject(e);
1994
+ }
1995
+ try {
1996
+ await this.#mutationCache.config.onSettled?.(void 0, error, this.state.variables, this.state.context, this, mutationFnContext);
1997
+ } catch (e) {
1998
+ Promise.reject(e);
1999
+ }
2000
+ try {
2001
+ await this.options.onSettled?.(void 0, error, variables, this.state.context, mutationFnContext);
2002
+ } catch (e) {
2003
+ Promise.reject(e);
2004
+ }
2005
+ this.#dispatch({
2006
+ type: "error",
2007
+ error
2008
+ });
2009
+ throw error;
2010
+ } finally {
2011
+ this.#mutationCache.runNext(this);
2012
+ }
2013
+ }
2014
+ #dispatch(action) {
2015
+ const reducer = (state) => {
2016
+ switch (action.type) {
2017
+ case "failed": return {
2018
+ ...state,
2019
+ failureCount: action.failureCount,
2020
+ failureReason: action.error
2021
+ };
2022
+ case "pause": return {
2023
+ ...state,
2024
+ isPaused: true
2025
+ };
2026
+ case "continue": return {
2027
+ ...state,
2028
+ isPaused: false
2029
+ };
2030
+ case "pending": return {
2031
+ ...state,
2032
+ context: action.context,
2033
+ data: void 0,
2034
+ failureCount: 0,
2035
+ failureReason: null,
2036
+ error: null,
2037
+ isPaused: action.isPaused,
2038
+ status: "pending",
2039
+ variables: action.variables,
2040
+ submittedAt: Date.now()
2041
+ };
2042
+ case "success": return {
2043
+ ...state,
2044
+ data: action.data,
2045
+ failureCount: 0,
2046
+ failureReason: null,
2047
+ error: null,
2048
+ status: "success",
2049
+ isPaused: false
2050
+ };
2051
+ case "error": return {
2052
+ ...state,
2053
+ data: void 0,
2054
+ error: action.error,
2055
+ failureCount: state.failureCount + 1,
2056
+ failureReason: action.error,
2057
+ isPaused: false,
2058
+ status: "error"
2059
+ };
2060
+ }
2061
+ };
2062
+ this.state = reducer(this.state);
2063
+ notifyManager.batch(() => {
2064
+ this.#observers.forEach((observer) => {
2065
+ observer.onMutationUpdate(action);
2066
+ });
2067
+ this.#mutationCache.notify({
2068
+ mutation: this,
2069
+ type: "updated",
2070
+ action
2071
+ });
2072
+ });
2073
+ }
2074
+ };
2075
+ function getDefaultState() {
2076
+ return {
2077
+ context: void 0,
2078
+ data: void 0,
2079
+ error: null,
2080
+ failureCount: 0,
2081
+ failureReason: null,
2082
+ isPaused: false,
2083
+ status: "idle",
2084
+ variables: void 0,
2085
+ submittedAt: 0
2086
+ };
2087
+ }
2088
+ //#endregion
2089
+ //#region ../../node_modules/.bun/@tanstack+react-query@5.95.0+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
2090
+ var QueryClientContext = import_react.createContext(void 0);
2091
+ var useQueryClient = (queryClient) => {
2092
+ const client = import_react.useContext(QueryClientContext);
2093
+ if (queryClient) return queryClient;
2094
+ if (!client) throw new Error("No QueryClient set, use QueryClientProvider to set one");
2095
+ return client;
2096
+ };
2097
+ var QueryClientProvider = ({ client, children }) => {
2098
+ import_react.useEffect(() => {
2099
+ client.mount();
2100
+ return () => {
2101
+ client.unmount();
2102
+ };
2103
+ }, [client]);
2104
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryClientContext.Provider, {
2105
+ value: client,
2106
+ children
2107
+ });
2108
+ };
2109
+ //#endregion
2110
+ //#region app/routes/index.tsx
2111
+ var $$splitComponentImporter = () => import("./routes-Bk6XCM2I.js");
2112
+ /**
2113
+ * Parse version keys into project/version structure.
2114
+ * Multi-project keys look like "query/v5", single-project keys look like "v5".
2115
+ */
2116
+ var Route = createFileRoute("/")({
2117
+ validateSearch: (search) => ({
2118
+ project: search.project || void 0,
2119
+ v: search.v || void 0,
2120
+ lang: search.lang || void 0,
2121
+ file: search.file || void 0,
2122
+ files: search.files || void 0,
2123
+ view: search.view || void 0,
2124
+ toc: search.toc || void 0,
2125
+ nodes: search.nodes || void 0,
2126
+ status: search.status || void 0,
2127
+ section: search.section || void 0
2128
+ }),
2129
+ component: lazyRouteComponent($$splitComponentImporter, "component")
2130
+ });
2131
+ //#endregion
2132
+ export { timeUntilStale as A, partialMatchKey as C, shallowEqualObjects as D, resolveStaleTime as E, createLazyFileRoute as F, createRootRouteWithContext as I, useNavigate as L, focusManager as M, Subscribable as N, shouldThrowError as O, createFileRoute as P, noop as S, resolveEnabled as T, hashKey as _, getDefaultState as a, matchMutation as b, onlineManager as c, environmentManager as d, addConsumeAwareSignal as f, functionalUpdate as g, ensureQueryFn as h, Mutation as i, timeoutManager as j, skipToken as k, notifyManager as l, addToStart as m, QueryClientProvider as n, Query as o, addToEnd as p, useQueryClient as r, fetchState as s, Route as t, pendingThenable as u, hashQueryKeyByOptions as v, replaceData as w, matchQuery as x, isValidTimeout as y };