docs-i18n 0.7.3 → 0.7.5

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.
@@ -0,0 +1,897 @@
1
+ import { i as __toESM } from "./chunk-CNvmzFzq.js";
2
+ import { F as escapeHtml, J as require_react, N as deepEqual, a as useRouter, c as useHydrated, l as require_jsx_runtime, n as useStore } from "./react-dom-BryASgrS.js";
3
+ import { C as partialMatchKey, E as resolveStaleTime, F as createLazyFileRoute, I as createRootRouteWithContext, M as focusManager, N as Subscribable, P as createFileRoute, S as noop, _ as hashKey, b as matchMutation, c as onlineManager, f as addConsumeAwareSignal, g as functionalUpdate, h as ensureQueryFn, i as Mutation, k as skipToken, l as notifyManager, m as addToStart, n as QueryClientProvider, o as Query, p as addToEnd, t as Route$1, v as hashQueryKeyByOptions, x as matchQuery } from "./routes-CMOVc2RM.js";
4
+ import { c as RouterCore, i as Outlet, l as createNonReactiveMutableStore, u as createNonReactiveReadonlyStore } from "../server.js";
5
+ //#endregion
6
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/routerStores.js
7
+ var getStoreFactory = (opts) => {
8
+ return {
9
+ createMutableStore: createNonReactiveMutableStore,
10
+ createReadonlyStore: createNonReactiveReadonlyStore,
11
+ batch: (fn) => fn()
12
+ };
13
+ };
14
+ //#endregion
15
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/router.js
16
+ /**
17
+ * Creates a new Router instance for React.
18
+ *
19
+ * Pass the returned router to `RouterProvider` to enable routing.
20
+ * Notable options: `routeTree` (your route definitions) and `context`
21
+ * (required if the root route was created with `createRootRouteWithContext`).
22
+ *
23
+ * @param options Router options used to configure the router.
24
+ * @returns A Router instance to be provided to `RouterProvider`.
25
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction
26
+ */
27
+ var createRouter = (options) => {
28
+ return new Router(options);
29
+ };
30
+ var Router = class extends RouterCore {
31
+ constructor(options) {
32
+ super(options, getStoreFactory);
33
+ }
34
+ };
35
+ if (typeof globalThis !== "undefined") {
36
+ globalThis.createFileRoute = createFileRoute;
37
+ globalThis.createLazyFileRoute = createLazyFileRoute;
38
+ } else if (typeof window !== "undefined") {
39
+ window.createFileRoute = createFileRoute;
40
+ window.createLazyFileRoute = createLazyFileRoute;
41
+ }
42
+ //#endregion
43
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/Asset.js
44
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
45
+ var import_jsx_runtime = require_jsx_runtime();
46
+ function Asset({ tag, attrs, children, nonce }) {
47
+ switch (tag) {
48
+ case "title": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", {
49
+ ...attrs,
50
+ suppressHydrationWarning: true,
51
+ children
52
+ });
53
+ case "meta": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("meta", {
54
+ ...attrs,
55
+ suppressHydrationWarning: true
56
+ });
57
+ case "link": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("link", {
58
+ ...attrs,
59
+ nonce,
60
+ suppressHydrationWarning: true
61
+ });
62
+ case "style": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
63
+ ...attrs,
64
+ dangerouslySetInnerHTML: { __html: children },
65
+ nonce
66
+ });
67
+ case "script": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Script, {
68
+ attrs,
69
+ children
70
+ });
71
+ default: return null;
72
+ }
73
+ }
74
+ function Script({ attrs, children }) {
75
+ useRouter();
76
+ useHydrated();
77
+ const dataScript = typeof attrs?.type === "string" && attrs.type !== "" && attrs.type !== "text/javascript" && attrs.type !== "module";
78
+ import_react.useEffect(() => {
79
+ if (dataScript) return;
80
+ if (attrs?.src) {
81
+ const normSrc = (() => {
82
+ try {
83
+ const base = document.baseURI || window.location.href;
84
+ return new URL(attrs.src, base).href;
85
+ } catch {
86
+ return attrs.src;
87
+ }
88
+ })();
89
+ if (Array.from(document.querySelectorAll("script[src]")).find((el) => el.src === normSrc)) return;
90
+ const script = document.createElement("script");
91
+ for (const [key, value] of Object.entries(attrs)) if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) script.setAttribute(key, typeof value === "boolean" ? "" : String(value));
92
+ document.head.appendChild(script);
93
+ return () => {
94
+ if (script.parentNode) script.parentNode.removeChild(script);
95
+ };
96
+ }
97
+ if (typeof children === "string") {
98
+ const typeAttr = typeof attrs?.type === "string" ? attrs.type : "text/javascript";
99
+ const nonceAttr = typeof attrs?.nonce === "string" ? attrs.nonce : void 0;
100
+ if (Array.from(document.querySelectorAll("script:not([src])")).find((el) => {
101
+ if (!(el instanceof HTMLScriptElement)) return false;
102
+ const sType = el.getAttribute("type") ?? "text/javascript";
103
+ const sNonce = el.getAttribute("nonce") ?? void 0;
104
+ return el.textContent === children && sType === typeAttr && sNonce === nonceAttr;
105
+ })) return;
106
+ const script = document.createElement("script");
107
+ script.textContent = children;
108
+ if (attrs) {
109
+ for (const [key, value] of Object.entries(attrs)) if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) script.setAttribute(key, typeof value === "boolean" ? "" : String(value));
110
+ }
111
+ document.head.appendChild(script);
112
+ return () => {
113
+ if (script.parentNode) script.parentNode.removeChild(script);
114
+ };
115
+ }
116
+ }, [
117
+ attrs,
118
+ children,
119
+ dataScript
120
+ ]);
121
+ if (attrs?.src) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("script", {
122
+ ...attrs,
123
+ suppressHydrationWarning: true
124
+ });
125
+ if (typeof children === "string") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("script", {
126
+ ...attrs,
127
+ dangerouslySetInnerHTML: { __html: children },
128
+ suppressHydrationWarning: true
129
+ });
130
+ return null;
131
+ }
132
+ //#endregion
133
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/headContentUtils.js
134
+ function buildTagsFromMatches(router, nonce, matches) {
135
+ const routeMeta = matches.map((match) => match.meta).filter(Boolean);
136
+ const resultMeta = [];
137
+ const metaByAttribute = {};
138
+ let title;
139
+ for (let i = routeMeta.length - 1; i >= 0; i--) {
140
+ const metas = routeMeta[i];
141
+ for (let j = metas.length - 1; j >= 0; j--) {
142
+ const m = metas[j];
143
+ if (!m) continue;
144
+ if (m.title) {
145
+ if (!title) title = {
146
+ tag: "title",
147
+ children: m.title
148
+ };
149
+ } else if ("script:ld+json" in m) try {
150
+ const json = JSON.stringify(m["script:ld+json"]);
151
+ resultMeta.push({
152
+ tag: "script",
153
+ attrs: { type: "application/ld+json" },
154
+ children: escapeHtml(json)
155
+ });
156
+ } catch {}
157
+ else {
158
+ const attribute = m.name ?? m.property;
159
+ if (attribute) if (metaByAttribute[attribute]) continue;
160
+ else metaByAttribute[attribute] = true;
161
+ resultMeta.push({
162
+ tag: "meta",
163
+ attrs: {
164
+ ...m,
165
+ nonce
166
+ }
167
+ });
168
+ }
169
+ }
170
+ }
171
+ if (title) resultMeta.push(title);
172
+ if (nonce) resultMeta.push({
173
+ tag: "meta",
174
+ attrs: {
175
+ property: "csp-nonce",
176
+ content: nonce
177
+ }
178
+ });
179
+ resultMeta.reverse();
180
+ const constructedLinks = matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({
181
+ tag: "link",
182
+ attrs: {
183
+ ...link,
184
+ nonce
185
+ }
186
+ }));
187
+ const manifest = router.ssr?.manifest;
188
+ const assetLinks = matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).filter((asset) => asset.tag === "link").map((asset) => ({
189
+ tag: "link",
190
+ attrs: {
191
+ ...asset.attrs,
192
+ suppressHydrationWarning: true,
193
+ nonce
194
+ }
195
+ }));
196
+ const preloadLinks = [];
197
+ matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach((preload) => {
198
+ preloadLinks.push({
199
+ tag: "link",
200
+ attrs: {
201
+ rel: "modulepreload",
202
+ href: preload,
203
+ nonce
204
+ }
205
+ });
206
+ }));
207
+ const styles = matches.map((match) => match.styles).flat(1).filter(Boolean).map(({ children, ...attrs }) => ({
208
+ tag: "style",
209
+ attrs: {
210
+ ...attrs,
211
+ nonce
212
+ },
213
+ children
214
+ }));
215
+ const headScripts = matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({
216
+ tag: "script",
217
+ attrs: {
218
+ ...script,
219
+ nonce
220
+ },
221
+ children
222
+ }));
223
+ return uniqBy([
224
+ ...resultMeta,
225
+ ...preloadLinks,
226
+ ...constructedLinks,
227
+ ...assetLinks,
228
+ ...styles,
229
+ ...headScripts
230
+ ], (d) => JSON.stringify(d));
231
+ }
232
+ /**
233
+ * Build the list of head/link/meta/script tags to render for active matches.
234
+ * Used internally by `HeadContent`.
235
+ */
236
+ var useTags = () => {
237
+ const router = useRouter();
238
+ const nonce = router.options.ssr?.nonce;
239
+ return buildTagsFromMatches(router, nonce, router.stores.activeMatchesSnapshot.state);
240
+ };
241
+ function uniqBy(arr, fn) {
242
+ const seen = /* @__PURE__ */ new Set();
243
+ return arr.filter((item) => {
244
+ const key = fn(item);
245
+ if (seen.has(key)) return false;
246
+ seen.add(key);
247
+ return true;
248
+ });
249
+ }
250
+ //#endregion
251
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/HeadContent.js
252
+ /**
253
+ * Render route-managed head tags (title, meta, links, styles, head scripts).
254
+ * Place inside the document head of your app shell.
255
+ * @link https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management
256
+ */
257
+ function HeadContent() {
258
+ const tags = useTags();
259
+ const nonce = useRouter().options.ssr?.nonce;
260
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: tags.map((tag) => /* @__PURE__ */ (0, import_react.createElement)(Asset, {
261
+ ...tag,
262
+ key: `tsr-meta-${JSON.stringify(tag)}`,
263
+ nonce
264
+ })) });
265
+ }
266
+ //#endregion
267
+ //#region ../../node_modules/.bun/@tanstack+react-router@1.168.2+bf16f8eded5e12ee/node_modules/@tanstack/react-router/dist/esm/Scripts.js
268
+ /**
269
+ * Render body script tags collected from route matches and SSR manifests.
270
+ * Should be placed near the end of the document body.
271
+ */
272
+ var Scripts = () => {
273
+ const router = useRouter();
274
+ const nonce = router.options.ssr?.nonce;
275
+ const getAssetScripts = (matches) => {
276
+ const assetScripts = [];
277
+ const manifest = router.ssr?.manifest;
278
+ if (!manifest) return [];
279
+ matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => manifest.routes[route.id]?.assets?.filter((d) => d.tag === "script").forEach((asset) => {
280
+ assetScripts.push({
281
+ tag: "script",
282
+ attrs: {
283
+ ...asset.attrs,
284
+ nonce
285
+ },
286
+ children: asset.children
287
+ });
288
+ }));
289
+ return assetScripts;
290
+ };
291
+ const getScripts = (matches) => matches.map((match) => match.scripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({
292
+ tag: "script",
293
+ attrs: {
294
+ ...script,
295
+ suppressHydrationWarning: true,
296
+ nonce
297
+ },
298
+ children
299
+ }));
300
+ {
301
+ const assetScripts = getAssetScripts(router.stores.activeMatchesSnapshot.state);
302
+ return renderScripts(router, getScripts(router.stores.activeMatchesSnapshot.state), assetScripts);
303
+ }
304
+ const assetScripts = useStore(router.stores.activeMatchesSnapshot, getAssetScripts, deepEqual);
305
+ return renderScripts(router, useStore(router.stores.activeMatchesSnapshot, getScripts, deepEqual), assetScripts);
306
+ };
307
+ function renderScripts(router, scripts, assetScripts) {
308
+ let serverBufferedScript = void 0;
309
+ if (router.serverSsr) serverBufferedScript = router.serverSsr.takeBufferedScripts();
310
+ const allScripts = [...scripts, ...assetScripts];
311
+ if (serverBufferedScript) allScripts.unshift(serverBufferedScript);
312
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: allScripts.map((asset, i) => /* @__PURE__ */ (0, import_react.createElement)(Asset, {
313
+ ...asset,
314
+ key: `tsr-scripts-${asset.tag}-${i}`
315
+ })) });
316
+ }
317
+ //#endregion
318
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
319
+ function infiniteQueryBehavior(pages) {
320
+ return { onFetch: (context, query) => {
321
+ const options = context.options;
322
+ const direction = context.fetchOptions?.meta?.fetchMore?.direction;
323
+ const oldPages = context.state.data?.pages || [];
324
+ const oldPageParams = context.state.data?.pageParams || [];
325
+ let result = {
326
+ pages: [],
327
+ pageParams: []
328
+ };
329
+ let currentPage = 0;
330
+ const fetchFn = async () => {
331
+ let cancelled = false;
332
+ const addSignalProperty = (object) => {
333
+ addConsumeAwareSignal(object, () => context.signal, () => cancelled = true);
334
+ };
335
+ const queryFn = ensureQueryFn(context.options, context.fetchOptions);
336
+ const fetchPage = async (data, param, previous) => {
337
+ if (cancelled) return Promise.reject();
338
+ if (param == null && data.pages.length) return Promise.resolve(data);
339
+ const createQueryFnContext = () => {
340
+ const queryFnContext2 = {
341
+ client: context.client,
342
+ queryKey: context.queryKey,
343
+ pageParam: param,
344
+ direction: previous ? "backward" : "forward",
345
+ meta: context.options.meta
346
+ };
347
+ addSignalProperty(queryFnContext2);
348
+ return queryFnContext2;
349
+ };
350
+ const page = await queryFn(createQueryFnContext());
351
+ const { maxPages } = context.options;
352
+ const addTo = previous ? addToStart : addToEnd;
353
+ return {
354
+ pages: addTo(data.pages, page, maxPages),
355
+ pageParams: addTo(data.pageParams, param, maxPages)
356
+ };
357
+ };
358
+ if (direction && oldPages.length) {
359
+ const previous = direction === "backward";
360
+ const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;
361
+ const oldData = {
362
+ pages: oldPages,
363
+ pageParams: oldPageParams
364
+ };
365
+ result = await fetchPage(oldData, pageParamFn(options, oldData), previous);
366
+ } else {
367
+ const remainingPages = pages ?? oldPages.length;
368
+ do {
369
+ const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);
370
+ if (currentPage > 0 && param == null) break;
371
+ result = await fetchPage(result, param);
372
+ currentPage++;
373
+ } while (currentPage < remainingPages);
374
+ }
375
+ return result;
376
+ };
377
+ if (context.options.persister) context.fetchFn = () => {
378
+ return context.options.persister?.(fetchFn, {
379
+ client: context.client,
380
+ queryKey: context.queryKey,
381
+ meta: context.options.meta,
382
+ signal: context.signal
383
+ }, query);
384
+ };
385
+ else context.fetchFn = fetchFn;
386
+ } };
387
+ }
388
+ function getNextPageParam(options, { pages, pageParams }) {
389
+ const lastIndex = pages.length - 1;
390
+ return pages.length > 0 ? options.getNextPageParam(pages[lastIndex], pages, pageParams[lastIndex], pageParams) : void 0;
391
+ }
392
+ function getPreviousPageParam(options, { pages, pageParams }) {
393
+ return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;
394
+ }
395
+ //#endregion
396
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/mutationCache.js
397
+ var MutationCache = class extends Subscribable {
398
+ constructor(config = {}) {
399
+ super();
400
+ this.config = config;
401
+ this.#mutations = /* @__PURE__ */ new Set();
402
+ this.#scopes = /* @__PURE__ */ new Map();
403
+ this.#mutationId = 0;
404
+ }
405
+ #mutations;
406
+ #scopes;
407
+ #mutationId;
408
+ build(client, options, state) {
409
+ const mutation = new Mutation({
410
+ client,
411
+ mutationCache: this,
412
+ mutationId: ++this.#mutationId,
413
+ options: client.defaultMutationOptions(options),
414
+ state
415
+ });
416
+ this.add(mutation);
417
+ return mutation;
418
+ }
419
+ add(mutation) {
420
+ this.#mutations.add(mutation);
421
+ const scope = scopeFor(mutation);
422
+ if (typeof scope === "string") {
423
+ const scopedMutations = this.#scopes.get(scope);
424
+ if (scopedMutations) scopedMutations.push(mutation);
425
+ else this.#scopes.set(scope, [mutation]);
426
+ }
427
+ this.notify({
428
+ type: "added",
429
+ mutation
430
+ });
431
+ }
432
+ remove(mutation) {
433
+ if (this.#mutations.delete(mutation)) {
434
+ const scope = scopeFor(mutation);
435
+ if (typeof scope === "string") {
436
+ const scopedMutations = this.#scopes.get(scope);
437
+ if (scopedMutations) {
438
+ if (scopedMutations.length > 1) {
439
+ const index = scopedMutations.indexOf(mutation);
440
+ if (index !== -1) scopedMutations.splice(index, 1);
441
+ } else if (scopedMutations[0] === mutation) this.#scopes.delete(scope);
442
+ }
443
+ }
444
+ }
445
+ this.notify({
446
+ type: "removed",
447
+ mutation
448
+ });
449
+ }
450
+ canRun(mutation) {
451
+ const scope = scopeFor(mutation);
452
+ if (typeof scope === "string") {
453
+ const firstPendingMutation = this.#scopes.get(scope)?.find((m) => m.state.status === "pending");
454
+ return !firstPendingMutation || firstPendingMutation === mutation;
455
+ } else return true;
456
+ }
457
+ runNext(mutation) {
458
+ const scope = scopeFor(mutation);
459
+ if (typeof scope === "string") return (this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused))?.continue() ?? Promise.resolve();
460
+ else return Promise.resolve();
461
+ }
462
+ clear() {
463
+ notifyManager.batch(() => {
464
+ this.#mutations.forEach((mutation) => {
465
+ this.notify({
466
+ type: "removed",
467
+ mutation
468
+ });
469
+ });
470
+ this.#mutations.clear();
471
+ this.#scopes.clear();
472
+ });
473
+ }
474
+ getAll() {
475
+ return Array.from(this.#mutations);
476
+ }
477
+ find(filters) {
478
+ const defaultedFilters = {
479
+ exact: true,
480
+ ...filters
481
+ };
482
+ return this.getAll().find((mutation) => matchMutation(defaultedFilters, mutation));
483
+ }
484
+ findAll(filters = {}) {
485
+ return this.getAll().filter((mutation) => matchMutation(filters, mutation));
486
+ }
487
+ notify(event) {
488
+ notifyManager.batch(() => {
489
+ this.listeners.forEach((listener) => {
490
+ listener(event);
491
+ });
492
+ });
493
+ }
494
+ resumePausedMutations() {
495
+ const pausedMutations = this.getAll().filter((x) => x.state.isPaused);
496
+ return notifyManager.batch(() => Promise.all(pausedMutations.map((mutation) => mutation.continue().catch(noop))));
497
+ }
498
+ };
499
+ function scopeFor(mutation) {
500
+ return mutation.options.scope?.id;
501
+ }
502
+ //#endregion
503
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/queryCache.js
504
+ var QueryCache = class extends Subscribable {
505
+ constructor(config = {}) {
506
+ super();
507
+ this.config = config;
508
+ this.#queries = /* @__PURE__ */ new Map();
509
+ }
510
+ #queries;
511
+ build(client, options, state) {
512
+ const queryKey = options.queryKey;
513
+ const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);
514
+ let query = this.get(queryHash);
515
+ if (!query) {
516
+ query = new Query({
517
+ client,
518
+ queryKey,
519
+ queryHash,
520
+ options: client.defaultQueryOptions(options),
521
+ state,
522
+ defaultOptions: client.getQueryDefaults(queryKey)
523
+ });
524
+ this.add(query);
525
+ }
526
+ return query;
527
+ }
528
+ add(query) {
529
+ if (!this.#queries.has(query.queryHash)) {
530
+ this.#queries.set(query.queryHash, query);
531
+ this.notify({
532
+ type: "added",
533
+ query
534
+ });
535
+ }
536
+ }
537
+ remove(query) {
538
+ const queryInMap = this.#queries.get(query.queryHash);
539
+ if (queryInMap) {
540
+ query.destroy();
541
+ if (queryInMap === query) this.#queries.delete(query.queryHash);
542
+ this.notify({
543
+ type: "removed",
544
+ query
545
+ });
546
+ }
547
+ }
548
+ clear() {
549
+ notifyManager.batch(() => {
550
+ this.getAll().forEach((query) => {
551
+ this.remove(query);
552
+ });
553
+ });
554
+ }
555
+ get(queryHash) {
556
+ return this.#queries.get(queryHash);
557
+ }
558
+ getAll() {
559
+ return [...this.#queries.values()];
560
+ }
561
+ find(filters) {
562
+ const defaultedFilters = {
563
+ exact: true,
564
+ ...filters
565
+ };
566
+ return this.getAll().find((query) => matchQuery(defaultedFilters, query));
567
+ }
568
+ findAll(filters = {}) {
569
+ const queries = this.getAll();
570
+ return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;
571
+ }
572
+ notify(event) {
573
+ notifyManager.batch(() => {
574
+ this.listeners.forEach((listener) => {
575
+ listener(event);
576
+ });
577
+ });
578
+ }
579
+ onFocus() {
580
+ notifyManager.batch(() => {
581
+ this.getAll().forEach((query) => {
582
+ query.onFocus();
583
+ });
584
+ });
585
+ }
586
+ onOnline() {
587
+ notifyManager.batch(() => {
588
+ this.getAll().forEach((query) => {
589
+ query.onOnline();
590
+ });
591
+ });
592
+ }
593
+ };
594
+ //#endregion
595
+ //#region ../../node_modules/.bun/@tanstack+query-core@5.95.0/node_modules/@tanstack/query-core/build/modern/queryClient.js
596
+ var QueryClient = class {
597
+ #queryCache;
598
+ #mutationCache;
599
+ #defaultOptions;
600
+ #queryDefaults;
601
+ #mutationDefaults;
602
+ #mountCount;
603
+ #unsubscribeFocus;
604
+ #unsubscribeOnline;
605
+ constructor(config = {}) {
606
+ this.#queryCache = config.queryCache || new QueryCache();
607
+ this.#mutationCache = config.mutationCache || new MutationCache();
608
+ this.#defaultOptions = config.defaultOptions || {};
609
+ this.#queryDefaults = /* @__PURE__ */ new Map();
610
+ this.#mutationDefaults = /* @__PURE__ */ new Map();
611
+ this.#mountCount = 0;
612
+ }
613
+ mount() {
614
+ this.#mountCount++;
615
+ if (this.#mountCount !== 1) return;
616
+ this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {
617
+ if (focused) {
618
+ await this.resumePausedMutations();
619
+ this.#queryCache.onFocus();
620
+ }
621
+ });
622
+ this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {
623
+ if (online) {
624
+ await this.resumePausedMutations();
625
+ this.#queryCache.onOnline();
626
+ }
627
+ });
628
+ }
629
+ unmount() {
630
+ this.#mountCount--;
631
+ if (this.#mountCount !== 0) return;
632
+ this.#unsubscribeFocus?.();
633
+ this.#unsubscribeFocus = void 0;
634
+ this.#unsubscribeOnline?.();
635
+ this.#unsubscribeOnline = void 0;
636
+ }
637
+ isFetching(filters) {
638
+ return this.#queryCache.findAll({
639
+ ...filters,
640
+ fetchStatus: "fetching"
641
+ }).length;
642
+ }
643
+ isMutating(filters) {
644
+ return this.#mutationCache.findAll({
645
+ ...filters,
646
+ status: "pending"
647
+ }).length;
648
+ }
649
+ /**
650
+ * Imperative (non-reactive) way to retrieve data for a QueryKey.
651
+ * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
652
+ *
653
+ * Hint: Do not use this function inside a component, because it won't receive updates.
654
+ * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
655
+ */
656
+ getQueryData(queryKey) {
657
+ const options = this.defaultQueryOptions({ queryKey });
658
+ return this.#queryCache.get(options.queryHash)?.state.data;
659
+ }
660
+ ensureQueryData(options) {
661
+ const defaultedOptions = this.defaultQueryOptions(options);
662
+ const query = this.#queryCache.build(this, defaultedOptions);
663
+ const cachedData = query.state.data;
664
+ if (cachedData === void 0) return this.fetchQuery(options);
665
+ if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) this.prefetchQuery(defaultedOptions);
666
+ return Promise.resolve(cachedData);
667
+ }
668
+ getQueriesData(filters) {
669
+ return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {
670
+ return [queryKey, state.data];
671
+ });
672
+ }
673
+ setQueryData(queryKey, updater, options) {
674
+ const defaultedOptions = this.defaultQueryOptions({ queryKey });
675
+ const prevData = this.#queryCache.get(defaultedOptions.queryHash)?.state.data;
676
+ const data = functionalUpdate(updater, prevData);
677
+ if (data === void 0) return;
678
+ return this.#queryCache.build(this, defaultedOptions).setData(data, {
679
+ ...options,
680
+ manual: true
681
+ });
682
+ }
683
+ setQueriesData(filters, updater, options) {
684
+ return notifyManager.batch(() => this.#queryCache.findAll(filters).map(({ queryKey }) => [queryKey, this.setQueryData(queryKey, updater, options)]));
685
+ }
686
+ getQueryState(queryKey) {
687
+ const options = this.defaultQueryOptions({ queryKey });
688
+ return this.#queryCache.get(options.queryHash)?.state;
689
+ }
690
+ removeQueries(filters) {
691
+ const queryCache = this.#queryCache;
692
+ notifyManager.batch(() => {
693
+ queryCache.findAll(filters).forEach((query) => {
694
+ queryCache.remove(query);
695
+ });
696
+ });
697
+ }
698
+ resetQueries(filters, options) {
699
+ const queryCache = this.#queryCache;
700
+ return notifyManager.batch(() => {
701
+ queryCache.findAll(filters).forEach((query) => {
702
+ query.reset();
703
+ });
704
+ return this.refetchQueries({
705
+ type: "active",
706
+ ...filters
707
+ }, options);
708
+ });
709
+ }
710
+ cancelQueries(filters, cancelOptions = {}) {
711
+ const defaultedCancelOptions = {
712
+ revert: true,
713
+ ...cancelOptions
714
+ };
715
+ const promises = notifyManager.batch(() => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)));
716
+ return Promise.all(promises).then(noop).catch(noop);
717
+ }
718
+ invalidateQueries(filters, options = {}) {
719
+ return notifyManager.batch(() => {
720
+ this.#queryCache.findAll(filters).forEach((query) => {
721
+ query.invalidate();
722
+ });
723
+ if (filters?.refetchType === "none") return Promise.resolve();
724
+ return this.refetchQueries({
725
+ ...filters,
726
+ type: filters?.refetchType ?? filters?.type ?? "active"
727
+ }, options);
728
+ });
729
+ }
730
+ refetchQueries(filters, options = {}) {
731
+ const fetchOptions = {
732
+ ...options,
733
+ cancelRefetch: options.cancelRefetch ?? true
734
+ };
735
+ const promises = notifyManager.batch(() => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {
736
+ let promise = query.fetch(void 0, fetchOptions);
737
+ if (!fetchOptions.throwOnError) promise = promise.catch(noop);
738
+ return query.state.fetchStatus === "paused" ? Promise.resolve() : promise;
739
+ }));
740
+ return Promise.all(promises).then(noop);
741
+ }
742
+ fetchQuery(options) {
743
+ const defaultedOptions = this.defaultQueryOptions(options);
744
+ if (defaultedOptions.retry === void 0) defaultedOptions.retry = false;
745
+ const query = this.#queryCache.build(this, defaultedOptions);
746
+ return query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query)) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);
747
+ }
748
+ prefetchQuery(options) {
749
+ return this.fetchQuery(options).then(noop).catch(noop);
750
+ }
751
+ fetchInfiniteQuery(options) {
752
+ options.behavior = infiniteQueryBehavior(options.pages);
753
+ return this.fetchQuery(options);
754
+ }
755
+ prefetchInfiniteQuery(options) {
756
+ return this.fetchInfiniteQuery(options).then(noop).catch(noop);
757
+ }
758
+ ensureInfiniteQueryData(options) {
759
+ options.behavior = infiniteQueryBehavior(options.pages);
760
+ return this.ensureQueryData(options);
761
+ }
762
+ resumePausedMutations() {
763
+ if (onlineManager.isOnline()) return this.#mutationCache.resumePausedMutations();
764
+ return Promise.resolve();
765
+ }
766
+ getQueryCache() {
767
+ return this.#queryCache;
768
+ }
769
+ getMutationCache() {
770
+ return this.#mutationCache;
771
+ }
772
+ getDefaultOptions() {
773
+ return this.#defaultOptions;
774
+ }
775
+ setDefaultOptions(options) {
776
+ this.#defaultOptions = options;
777
+ }
778
+ setQueryDefaults(queryKey, options) {
779
+ this.#queryDefaults.set(hashKey(queryKey), {
780
+ queryKey,
781
+ defaultOptions: options
782
+ });
783
+ }
784
+ getQueryDefaults(queryKey) {
785
+ const defaults = [...this.#queryDefaults.values()];
786
+ const result = {};
787
+ defaults.forEach((queryDefault) => {
788
+ if (partialMatchKey(queryKey, queryDefault.queryKey)) Object.assign(result, queryDefault.defaultOptions);
789
+ });
790
+ return result;
791
+ }
792
+ setMutationDefaults(mutationKey, options) {
793
+ this.#mutationDefaults.set(hashKey(mutationKey), {
794
+ mutationKey,
795
+ defaultOptions: options
796
+ });
797
+ }
798
+ getMutationDefaults(mutationKey) {
799
+ const defaults = [...this.#mutationDefaults.values()];
800
+ const result = {};
801
+ defaults.forEach((queryDefault) => {
802
+ if (partialMatchKey(mutationKey, queryDefault.mutationKey)) Object.assign(result, queryDefault.defaultOptions);
803
+ });
804
+ return result;
805
+ }
806
+ defaultQueryOptions(options) {
807
+ if (options._defaulted) return options;
808
+ const defaultedOptions = {
809
+ ...this.#defaultOptions.queries,
810
+ ...this.getQueryDefaults(options.queryKey),
811
+ ...options,
812
+ _defaulted: true
813
+ };
814
+ if (!defaultedOptions.queryHash) defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);
815
+ if (defaultedOptions.refetchOnReconnect === void 0) defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always";
816
+ if (defaultedOptions.throwOnError === void 0) defaultedOptions.throwOnError = !!defaultedOptions.suspense;
817
+ if (!defaultedOptions.networkMode && defaultedOptions.persister) defaultedOptions.networkMode = "offlineFirst";
818
+ if (defaultedOptions.queryFn === skipToken) defaultedOptions.enabled = false;
819
+ return defaultedOptions;
820
+ }
821
+ defaultMutationOptions(options) {
822
+ if (options?._defaulted) return options;
823
+ return {
824
+ ...this.#defaultOptions.mutations,
825
+ ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),
826
+ ...options,
827
+ _defaulted: true
828
+ };
829
+ }
830
+ clear() {
831
+ this.#queryCache.clear();
832
+ this.#mutationCache.clear();
833
+ }
834
+ };
835
+ //#endregion
836
+ //#region app/styles.css?url
837
+ var styles_default = "/assets/styles-DJ6QEJmN.css";
838
+ //#endregion
839
+ //#region app/routes/__root.tsx
840
+ var Route = createRootRouteWithContext()({
841
+ head: () => ({
842
+ meta: [{ charSet: "utf-8" }, {
843
+ name: "viewport",
844
+ content: "width=device-width, initial-scale=1"
845
+ }],
846
+ links: [{
847
+ rel: "stylesheet",
848
+ href: styles_default
849
+ }]
850
+ }),
851
+ component: RootComponent,
852
+ notFoundComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
853
+ style: { padding: 20 },
854
+ children: "Page not found"
855
+ })
856
+ });
857
+ function RootComponent() {
858
+ const { queryClient } = Route.useRouteContext();
859
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RootDocument, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QueryClientProvider, {
860
+ client: queryClient,
861
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Outlet, {})
862
+ }) });
863
+ }
864
+ function RootDocument({ children }) {
865
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("html", {
866
+ lang: "en",
867
+ "data-theme": "dark",
868
+ suppressHydrationWarning: true,
869
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("head", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeadContent, {}) }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("body", { children: [
870
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("script", { dangerouslySetInnerHTML: { __html: `document.documentElement.dataset.theme=localStorage.getItem('theme')||'dark'` } }),
871
+ children,
872
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Scripts, {})
873
+ ] })]
874
+ });
875
+ }
876
+ //#endregion
877
+ //#region app/routeTree.gen.ts
878
+ var rootRouteChildren = { IndexRoute: Route$1.update({
879
+ id: "/",
880
+ path: "/",
881
+ getParentRoute: () => Route
882
+ }) };
883
+ var routeTree = Route._addFileChildren(rootRouteChildren)._addFileTypes();
884
+ //#endregion
885
+ //#region app/router.tsx
886
+ function getRouter() {
887
+ return createRouter({
888
+ routeTree,
889
+ context: { queryClient: new QueryClient({ defaultOptions: { queries: {
890
+ refetchOnWindowFocus: false,
891
+ retry: 1
892
+ } } }) },
893
+ scrollRestoration: true
894
+ });
895
+ }
896
+ //#endregion
897
+ export { getRouter };