@hot-updater/console 0.33.0 → 0.33.1

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 (63) hide show
  1. package/.output/nitro.json +3 -3
  2. package/.output/public/assets/dist-DJX53faP.js +3 -0
  3. package/.output/public/assets/index-CCUspZZV.js +10 -0
  4. package/.output/public/assets/routes-D0t6y5Fr.js +54 -0
  5. package/.output/public/assets/styles-C0q26dS-.css +2 -0
  6. package/.output/server/{__tanstack-start-server-fn-resolver-ySzPUDlM.mjs → __23tanstack-start-server-fn-resolver-B12pVvhf.mjs} +32 -39
  7. package/.output/server/_chunks/ssr-renderer.mjs +14 -3
  8. package/.output/server/_libs/@floating-ui/react-dom+[...].mjs +7 -7
  9. package/.output/server/_libs/@radix-ui/react-alert-dialog+[...].mjs +142 -93
  10. package/.output/server/_libs/@radix-ui/react-popper+[...].mjs +32 -11
  11. package/.output/server/_libs/@radix-ui/react-select+[...].mjs +130 -95
  12. package/.output/server/_libs/@tanstack/form-core+[...].mjs +1138 -306
  13. package/.output/server/_libs/@tanstack/react-form+[...].mjs +156 -24
  14. package/.output/server/_libs/@tanstack/react-router+[...].mjs +2658 -1395
  15. package/.output/server/_libs/@tanstack/react-table+[...].mjs +1 -1
  16. package/.output/server/_libs/dayjs.mjs +6 -6
  17. package/.output/server/_libs/h3+rou3+srvx.mjs +30 -42
  18. package/.output/server/_libs/lucide-react.mjs +8 -8
  19. package/.output/server/_libs/next-themes.mjs +1 -1
  20. package/.output/server/_libs/radix-ui__number.mjs +1 -1
  21. package/.output/server/_libs/radix-ui__react-arrow.mjs +2 -2
  22. package/.output/server/_libs/radix-ui__react-collection.mjs +2 -2
  23. package/.output/server/_libs/radix-ui__react-direction.mjs +2 -2
  24. package/.output/server/_libs/radix-ui__react-label.mjs +2 -2
  25. package/.output/server/_libs/radix-ui__react-separator.mjs +2 -2
  26. package/.output/server/_libs/radix-ui__react-slider.mjs +103 -44
  27. package/.output/server/_libs/radix-ui__react-switch.mjs +88 -49
  28. package/.output/server/_libs/radix-ui__react-tooltip.mjs +6 -4
  29. package/.output/server/_libs/semver.mjs +97 -52
  30. package/.output/server/_libs/sonner.mjs +1 -1
  31. package/.output/server/_libs/tailwind-merge.mjs +51 -3
  32. package/.output/server/_libs/tanstack__history.mjs +28 -8
  33. package/.output/server/_libs/tanstack__query-core.mjs +200 -174
  34. package/.output/server/_libs/tanstack__react-query.mjs +14 -13
  35. package/.output/server/_ssr/{api-rpc-Bwustks9.mjs → api-rpc-ORImfBFu.mjs} +18 -18
  36. package/.output/server/_ssr/{config.server-xu3W-WAK.mjs → config.server-BSS366KT.mjs} +2 -2
  37. package/.output/server/_ssr/{createServerFn-CdeRXnVy.mjs → createServerFn-DzU0k62V.mjs} +129 -90
  38. package/.output/server/_ssr/{deleteBundle-CXxwjwEZ.mjs → deleteBundle-CuujBAH8.mjs} +2 -2
  39. package/.output/server/_ssr/{dist-CRiLZLfa.mjs → dist-KboydRVk.mjs} +1 -1
  40. package/.output/server/_ssr/empty-plugin-adapters-B4HCzgmM.mjs +5 -0
  41. package/.output/server/_ssr/{getBundleChildren-DFqZ6XMp.mjs → getBundleChildren-CVtSiH5t.mjs} +2 -2
  42. package/.output/server/_ssr/{router-1tw3jh6y.mjs → router-DmdnzGpe.mjs} +7 -8
  43. package/.output/server/_ssr/{routes-D5CmWxI7.mjs → routes-Be7gDfJS.mjs} +36 -39
  44. package/.output/server/_ssr/{sidebar-CgbtXkE2.mjs → sidebar-Cv_H0_Jv.mjs} +5 -5
  45. package/.output/server/_ssr/ssr.mjs +4222 -3153
  46. package/.output/server/_ssr/start-D4SBEASt.mjs +4 -0
  47. package/.output/server/_ssr/{storageProfile-wICk5nZZ.mjs → storageProfile-FVkjPoGb.mjs} +1 -1
  48. package/.output/server/_tanstack-start-manifest_v-BroBMdSR.mjs +20 -0
  49. package/.output/server/index.mjs +124 -168
  50. package/package.json +12 -9
  51. package/.output/public/assets/BaseTanStackRouterDevtoolsPanel-Bmws3ikM-q5p5qKUx.js +0 -486
  52. package/.output/public/assets/FloatingTanStackRouterDevtools-B7vy70jP-Bzs2Gthe.js +0 -1
  53. package/.output/public/assets/clsx-CbprLf2V.js +0 -1
  54. package/.output/public/assets/dist-BzU1qUss.js +0 -9
  55. package/.output/public/assets/main-CmNeAg9B.js +0 -10
  56. package/.output/public/assets/preload-helper-C5ST2IKa.js +0 -1
  57. package/.output/public/assets/routes-wJZuGodi.js +0 -54
  58. package/.output/public/assets/styles-DEbMLh52.css +0 -2
  59. package/.output/server/_libs/hookable.mjs +0 -41
  60. package/.output/server/_libs/tanstack__router-core.mjs +0 -6
  61. package/.output/server/_libs/unctx.mjs +0 -82
  62. package/.output/server/_ssr/start-CoRKunFF.mjs +0 -4
  63. package/.output/server/_tanstack-start-manifest_v-AftZl081.mjs +0 -22
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/subscribable.js
1
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/subscribable.js
2
2
  var Subscribable = class {
3
3
  constructor() {
4
4
  this.listeners = /* @__PURE__ */ new Set();
@@ -19,7 +19,60 @@ var Subscribable = class {
19
19
  onUnsubscribe() {}
20
20
  };
21
21
  //#endregion
22
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
22
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/focusManager.js
23
+ var FocusManager = class extends Subscribable {
24
+ #focused;
25
+ #cleanup;
26
+ #setup;
27
+ constructor() {
28
+ super();
29
+ this.#setup = (onFocus) => {
30
+ if (typeof window !== "undefined" && window.addEventListener) {
31
+ const listener = () => onFocus();
32
+ window.addEventListener("visibilitychange", listener, false);
33
+ return () => {
34
+ window.removeEventListener("visibilitychange", listener);
35
+ };
36
+ }
37
+ };
38
+ }
39
+ onSubscribe() {
40
+ if (!this.#cleanup) this.setEventListener(this.#setup);
41
+ }
42
+ onUnsubscribe() {
43
+ if (!this.hasListeners()) {
44
+ this.#cleanup?.();
45
+ this.#cleanup = void 0;
46
+ }
47
+ }
48
+ setEventListener(setup) {
49
+ this.#setup = setup;
50
+ this.#cleanup?.();
51
+ this.#cleanup = setup((focused) => {
52
+ if (typeof focused === "boolean") this.setFocused(focused);
53
+ else this.onFocus();
54
+ });
55
+ }
56
+ setFocused(focused) {
57
+ if (this.#focused !== focused) {
58
+ this.#focused = focused;
59
+ this.onFocus();
60
+ }
61
+ }
62
+ onFocus() {
63
+ const isFocused = this.isFocused();
64
+ this.listeners.forEach((listener) => {
65
+ listener(isFocused);
66
+ });
67
+ }
68
+ isFocused() {
69
+ if (typeof this.#focused === "boolean") return this.#focused;
70
+ return globalThis.document?.visibilityState !== "hidden";
71
+ }
72
+ };
73
+ var focusManager = new FocusManager();
74
+ //#endregion
75
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/timeoutManager.js
23
76
  var defaultTimeoutProvider = {
24
77
  setTimeout: (callback, delay) => setTimeout(callback, delay),
25
78
  clearTimeout: (timeoutId) => clearTimeout(timeoutId),
@@ -50,7 +103,7 @@ function systemSetTimeoutZero(callback) {
50
103
  setTimeout(callback, 0);
51
104
  }
52
105
  //#endregion
53
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/utils.js
106
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/utils.js
54
107
  var isServer = typeof window === "undefined" || "Deno" in globalThis;
55
108
  function noop() {}
56
109
  function functionalUpdate(updater, input) {
@@ -65,8 +118,8 @@ function timeUntilStale(updatedAt, staleTime) {
65
118
  function resolveStaleTime(staleTime, query) {
66
119
  return typeof staleTime === "function" ? staleTime(query) : staleTime;
67
120
  }
68
- function resolveEnabled(enabled, query) {
69
- return typeof enabled === "function" ? enabled(query) : enabled;
121
+ function resolveQueryBoolean(option, query) {
122
+ return typeof option === "function" ? option(query) : option;
70
123
  }
71
124
  function matchQuery(filters, query) {
72
125
  const { type = "all", exact, fetchStatus, predicate, queryKey, stale } = filters;
@@ -208,60 +261,20 @@ function addConsumeAwareSignal(object, getSignal, onCancelled) {
208
261
  return object;
209
262
  }
210
263
  //#endregion
211
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/focusManager.js
212
- var FocusManager = class extends Subscribable {
213
- #focused;
214
- #cleanup;
215
- #setup;
216
- constructor() {
217
- super();
218
- this.#setup = (onFocus) => {
219
- if (!isServer && window.addEventListener) {
220
- const listener = () => onFocus();
221
- window.addEventListener("visibilitychange", listener, false);
222
- return () => {
223
- window.removeEventListener("visibilitychange", listener);
224
- };
225
- }
226
- };
227
- }
228
- onSubscribe() {
229
- if (!this.#cleanup) this.setEventListener(this.#setup);
230
- }
231
- onUnsubscribe() {
232
- if (!this.hasListeners()) {
233
- this.#cleanup?.();
234
- this.#cleanup = void 0;
235
- }
236
- }
237
- setEventListener(setup) {
238
- this.#setup = setup;
239
- this.#cleanup?.();
240
- this.#cleanup = setup((focused) => {
241
- if (typeof focused === "boolean") this.setFocused(focused);
242
- else this.onFocus();
243
- });
244
- }
245
- setFocused(focused) {
246
- if (this.#focused !== focused) {
247
- this.#focused = focused;
248
- this.onFocus();
264
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/environmentManager.js
265
+ var environmentManager = /* @__PURE__ */ (() => {
266
+ let isServerFn = () => isServer;
267
+ return {
268
+ isServer() {
269
+ return isServerFn();
270
+ },
271
+ setIsServer(isServerValue) {
272
+ isServerFn = isServerValue;
249
273
  }
250
- }
251
- onFocus() {
252
- const isFocused = this.isFocused();
253
- this.listeners.forEach((listener) => {
254
- listener(isFocused);
255
- });
256
- }
257
- isFocused() {
258
- if (typeof this.#focused === "boolean") return this.#focused;
259
- return globalThis.document?.visibilityState !== "hidden";
260
- }
261
- };
262
- var focusManager = new FocusManager();
274
+ };
275
+ })();
263
276
  //#endregion
264
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/thenable.js
277
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/thenable.js
265
278
  function pendingThenable() {
266
279
  let resolve;
267
280
  let reject;
@@ -293,7 +306,7 @@ function pendingThenable() {
293
306
  return thenable;
294
307
  }
295
308
  //#endregion
296
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/notifyManager.js
309
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/notifyManager.js
297
310
  var defaultScheduler = systemSetTimeoutZero;
298
311
  function createNotifyManager() {
299
312
  let queue = [];
@@ -355,7 +368,7 @@ function createNotifyManager() {
355
368
  }
356
369
  var notifyManager = createNotifyManager();
357
370
  //#endregion
358
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/onlineManager.js
371
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/onlineManager.js
359
372
  var OnlineManager = class extends Subscribable {
360
373
  #online = true;
361
374
  #cleanup;
@@ -363,7 +376,7 @@ var OnlineManager = class extends Subscribable {
363
376
  constructor() {
364
377
  super();
365
378
  this.#setup = (onOnline) => {
366
- if (!isServer && window.addEventListener) {
379
+ if (typeof window !== "undefined" && window.addEventListener) {
367
380
  const onlineListener = () => onOnline(true);
368
381
  const offlineListener = () => onOnline(false);
369
382
  window.addEventListener("online", onlineListener, false);
@@ -403,7 +416,7 @@ var OnlineManager = class extends Subscribable {
403
416
  };
404
417
  var onlineManager = new OnlineManager();
405
418
  //#endregion
406
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/retryer.js
419
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/retryer.js
407
420
  function defaultRetryDelay(failureCount) {
408
421
  return Math.min(1e3 * 2 ** failureCount, 3e4);
409
422
  }
@@ -472,7 +485,7 @@ function createRetryer(config) {
472
485
  }
473
486
  Promise.resolve(promiseOrValue).then(resolve).catch((error) => {
474
487
  if (isResolved()) return;
475
- const retry = config.retry ?? (isServer ? 0 : 3);
488
+ const retry = config.retry ?? (environmentManager.isServer() ? 0 : 3);
476
489
  const retryDelay = config.retryDelay ?? defaultRetryDelay;
477
490
  const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay;
478
491
  const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error);
@@ -509,7 +522,7 @@ function createRetryer(config) {
509
522
  };
510
523
  }
511
524
  //#endregion
512
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/removable.js
525
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/removable.js
513
526
  var Removable = class {
514
527
  #gcTimeout;
515
528
  destroy() {
@@ -522,18 +535,97 @@ var Removable = class {
522
535
  }, this.gcTime);
523
536
  }
524
537
  updateGcTime(newGcTime) {
525
- this.gcTime = Math.max(this.gcTime || 0, newGcTime ?? (isServer ? Infinity : 300 * 1e3));
538
+ this.gcTime = Math.max(this.gcTime || 0, newGcTime ?? (environmentManager.isServer() ? Infinity : 300 * 1e3));
526
539
  }
527
540
  clearGcTimeout() {
528
- if (this.#gcTimeout) {
541
+ if (this.#gcTimeout !== void 0) {
529
542
  timeoutManager.clearTimeout(this.#gcTimeout);
530
543
  this.#gcTimeout = void 0;
531
544
  }
532
545
  }
533
546
  };
534
547
  //#endregion
535
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/query.js
548
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
549
+ function infiniteQueryBehavior(pages) {
550
+ return { onFetch: (context, query) => {
551
+ const options = context.options;
552
+ const direction = context.fetchOptions?.meta?.fetchMore?.direction;
553
+ const oldPages = context.state.data?.pages || [];
554
+ const oldPageParams = context.state.data?.pageParams || [];
555
+ let result = {
556
+ pages: [],
557
+ pageParams: []
558
+ };
559
+ let currentPage = 0;
560
+ const fetchFn = async () => {
561
+ let cancelled = false;
562
+ const addSignalProperty = (object) => {
563
+ addConsumeAwareSignal(object, () => context.signal, () => cancelled = true);
564
+ };
565
+ const queryFn = ensureQueryFn(context.options, context.fetchOptions);
566
+ const fetchPage = async (data, param, previous) => {
567
+ if (cancelled) return Promise.reject(context.signal.reason);
568
+ if (param == null && data.pages.length) return Promise.resolve(data);
569
+ const createQueryFnContext = () => {
570
+ const queryFnContext2 = {
571
+ client: context.client,
572
+ queryKey: context.queryKey,
573
+ pageParam: param,
574
+ direction: previous ? "backward" : "forward",
575
+ meta: context.options.meta
576
+ };
577
+ addSignalProperty(queryFnContext2);
578
+ return queryFnContext2;
579
+ };
580
+ const page = await queryFn(createQueryFnContext());
581
+ const { maxPages } = context.options;
582
+ const addTo = previous ? addToStart : addToEnd;
583
+ return {
584
+ pages: addTo(data.pages, page, maxPages),
585
+ pageParams: addTo(data.pageParams, param, maxPages)
586
+ };
587
+ };
588
+ if (direction && oldPages.length) {
589
+ const previous = direction === "backward";
590
+ const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;
591
+ const oldData = {
592
+ pages: oldPages,
593
+ pageParams: oldPageParams
594
+ };
595
+ result = await fetchPage(oldData, pageParamFn(options, oldData), previous);
596
+ } else {
597
+ const remainingPages = pages ?? oldPages.length;
598
+ do {
599
+ const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);
600
+ if (currentPage > 0 && param == null) break;
601
+ result = await fetchPage(result, param);
602
+ currentPage++;
603
+ } while (currentPage < remainingPages);
604
+ }
605
+ return result;
606
+ };
607
+ if (context.options.persister) context.fetchFn = () => {
608
+ return context.options.persister?.(fetchFn, {
609
+ client: context.client,
610
+ queryKey: context.queryKey,
611
+ meta: context.options.meta,
612
+ signal: context.signal
613
+ }, query);
614
+ };
615
+ else context.fetchFn = fetchFn;
616
+ } };
617
+ }
618
+ function getNextPageParam(options, { pages, pageParams }) {
619
+ const lastIndex = pages.length - 1;
620
+ return pages.length > 0 ? options.getNextPageParam(pages[lastIndex], pages, pageParams[lastIndex], pageParams) : void 0;
621
+ }
622
+ function getPreviousPageParam(options, { pages, pageParams }) {
623
+ return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;
624
+ }
625
+ //#endregion
626
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/query.js
536
627
  var Query = class extends Removable {
628
+ #queryType;
537
629
  #initialState;
538
630
  #revertState;
539
631
  #cache;
@@ -558,6 +650,9 @@ var Query = class extends Removable {
558
650
  get meta() {
559
651
  return this.options.meta;
560
652
  }
653
+ get queryType() {
654
+ return this.#queryType;
655
+ }
561
656
  get promise() {
562
657
  return this.#retryer?.promise;
563
658
  }
@@ -566,6 +661,7 @@ var Query = class extends Removable {
566
661
  ...this.#defaultOptions,
567
662
  ...options
568
663
  };
664
+ if (options?._type) this.#queryType = options._type;
569
665
  this.updateGcTime(this.options.gcTime);
570
666
  if (this.state && this.state.data === void 0) {
571
667
  const defaultState = getDefaultState$1(this.options);
@@ -588,11 +684,10 @@ var Query = class extends Removable {
588
684
  });
589
685
  return data;
590
686
  }
591
- setState(state, setStateOptions) {
687
+ setState(state) {
592
688
  this.#dispatch({
593
689
  type: "setState",
594
- state,
595
- setStateOptions
690
+ state
596
691
  });
597
692
  }
598
693
  cancel(options) {
@@ -604,16 +699,22 @@ var Query = class extends Removable {
604
699
  super.destroy();
605
700
  this.cancel({ silent: true });
606
701
  }
702
+ get resetState() {
703
+ return this.#initialState;
704
+ }
607
705
  reset() {
608
706
  this.destroy();
609
- this.setState(this.#initialState);
707
+ this.setState(this.resetState);
610
708
  }
611
709
  isActive() {
612
- return this.observers.some((observer) => resolveEnabled(observer.options.enabled, this) !== false);
710
+ return this.observers.some((observer) => resolveQueryBoolean(observer.options.enabled, this) !== false);
613
711
  }
614
712
  isDisabled() {
615
713
  if (this.getObserversCount() > 0) return !this.isActive();
616
- return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
714
+ return this.options.queryFn === skipToken || !this.isFetched();
715
+ }
716
+ isFetched() {
717
+ return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
617
718
  }
618
719
  isStatic() {
619
720
  if (this.getObserversCount() > 0) return this.observers.some((observer) => resolveStaleTime(observer.options.staleTime, this) === "static");
@@ -652,7 +753,7 @@ var Query = class extends Removable {
652
753
  if (this.observers.includes(observer)) {
653
754
  this.observers = this.observers.filter((x) => x !== observer);
654
755
  if (!this.observers.length) {
655
- if (this.#retryer) if (this.#abortSignalConsumed) this.#retryer.cancel({ revert: true });
756
+ if (this.#retryer) if (this.#abortSignalConsumed || this.#isInitialPausedFetch()) this.#retryer.cancel({ revert: true });
656
757
  else this.#retryer.cancelRetry();
657
758
  this.scheduleGc();
658
759
  }
@@ -666,6 +767,9 @@ var Query = class extends Removable {
666
767
  getObserversCount() {
667
768
  return this.observers.length;
668
769
  }
770
+ #isInitialPausedFetch() {
771
+ return this.state.fetchStatus === "paused" && this.state.status === "pending";
772
+ }
669
773
  invalidate() {
670
774
  if (!this.state.isInvalidated) this.#dispatch({ type: "invalidate" });
671
775
  }
@@ -721,7 +825,7 @@ var Query = class extends Removable {
721
825
  return context2;
722
826
  };
723
827
  const context = createFetchContext();
724
- this.options.behavior?.onFetch(context, this);
828
+ (this.#queryType === "infinite" ? infiniteQueryBehavior(this.options.pages) : this.options.behavior)?.onFetch(context, this);
725
829
  this.#revertState = this.state;
726
830
  if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) this.#dispatch({
727
831
  type: "fetch",
@@ -891,7 +995,7 @@ function getDefaultState$1(options) {
891
995
  };
892
996
  }
893
997
  //#endregion
894
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryObserver.js
998
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/queryObserver.js
895
999
  var QueryObserver = class extends Subscribable {
896
1000
  constructor(client, options) {
897
1001
  super();
@@ -947,7 +1051,7 @@ var QueryObserver = class extends Subscribable {
947
1051
  const prevOptions = this.options;
948
1052
  const prevQuery = this.#currentQuery;
949
1053
  this.options = this.#client.defaultQueryOptions(options);
950
- if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== "boolean") throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");
1054
+ if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveQueryBoolean(this.options.enabled, this.#currentQuery) !== "boolean") throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");
951
1055
  this.#updateQuery();
952
1056
  this.#currentQuery.setOptions(this.options);
953
1057
  if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) this.#client.getQueryCache().notify({
@@ -958,9 +1062,9 @@ var QueryObserver = class extends Subscribable {
958
1062
  const mounted = this.hasListeners();
959
1063
  if (mounted && shouldFetchOptionally(this.#currentQuery, prevQuery, this.options, prevOptions)) this.#executeFetch();
960
1064
  this.updateResult();
961
- if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) this.#updateStaleTimeout();
1065
+ if (mounted && (this.#currentQuery !== prevQuery || resolveQueryBoolean(this.options.enabled, this.#currentQuery) !== resolveQueryBoolean(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) this.#updateStaleTimeout();
962
1066
  const nextRefetchInterval = this.#computeRefetchInterval();
963
- if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) this.#updateRefetchInterval(nextRefetchInterval);
1067
+ if (mounted && (this.#currentQuery !== prevQuery || resolveQueryBoolean(this.options.enabled, this.#currentQuery) !== resolveQueryBoolean(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) this.#updateRefetchInterval(nextRefetchInterval);
964
1068
  }
965
1069
  getOptimisticResult(options) {
966
1070
  const query = this.#client.getQueryCache().build(this.#client, options);
@@ -1018,7 +1122,7 @@ var QueryObserver = class extends Subscribable {
1018
1122
  #updateStaleTimeout() {
1019
1123
  this.#clearStaleTimeout();
1020
1124
  const staleTime = resolveStaleTime(this.options.staleTime, this.#currentQuery);
1021
- if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) return;
1125
+ if (environmentManager.isServer() || this.#currentResult.isStale || !isValidTimeout(staleTime)) return;
1022
1126
  const timeout = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime) + 1;
1023
1127
  this.#staleTimeoutId = timeoutManager.setTimeout(() => {
1024
1128
  if (!this.#currentResult.isStale) this.updateResult();
@@ -1030,7 +1134,7 @@ var QueryObserver = class extends Subscribable {
1030
1134
  #updateRefetchInterval(nextInterval) {
1031
1135
  this.#clearRefetchInterval();
1032
1136
  this.#currentRefetchInterval = nextInterval;
1033
- if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) return;
1137
+ if (environmentManager.isServer() || resolveQueryBoolean(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) return;
1034
1138
  this.#refetchIntervalId = timeoutManager.setInterval(() => {
1035
1139
  if (this.options.refetchIntervalInBackground || focusManager.isFocused()) this.#executeFetch();
1036
1140
  }, this.#currentRefetchInterval);
@@ -1040,13 +1144,13 @@ var QueryObserver = class extends Subscribable {
1040
1144
  this.#updateRefetchInterval(this.#computeRefetchInterval());
1041
1145
  }
1042
1146
  #clearStaleTimeout() {
1043
- if (this.#staleTimeoutId) {
1147
+ if (this.#staleTimeoutId !== void 0) {
1044
1148
  timeoutManager.clearTimeout(this.#staleTimeoutId);
1045
1149
  this.#staleTimeoutId = void 0;
1046
1150
  }
1047
1151
  }
1048
1152
  #clearRefetchInterval() {
1049
- if (this.#refetchIntervalId) {
1153
+ if (this.#refetchIntervalId !== void 0) {
1050
1154
  timeoutManager.clearInterval(this.#refetchIntervalId);
1051
1155
  this.#refetchIntervalId = void 0;
1052
1156
  }
@@ -1123,7 +1227,7 @@ var QueryObserver = class extends Subscribable {
1123
1227
  failureCount: newState.fetchFailureCount,
1124
1228
  failureReason: newState.fetchFailureReason,
1125
1229
  errorUpdateCount: newState.errorUpdateCount,
1126
- isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,
1230
+ isFetched: query.isFetched(),
1127
1231
  isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,
1128
1232
  isFetching,
1129
1233
  isRefetching: isFetching && !isPending,
@@ -1134,7 +1238,7 @@ var QueryObserver = class extends Subscribable {
1134
1238
  isStale: isStale(query, options),
1135
1239
  refetch: this.refetch,
1136
1240
  promise: this.#currentThenable,
1137
- isEnabled: resolveEnabled(options.enabled, query) !== false
1241
+ isEnabled: resolveQueryBoolean(options.enabled, query) !== false
1138
1242
  };
1139
1243
  if (this.options.experimental_prefetchInRender) {
1140
1244
  const hasResultData = nextResult.data !== void 0;
@@ -1211,108 +1315,30 @@ var QueryObserver = class extends Subscribable {
1211
1315
  }
1212
1316
  };
1213
1317
  function shouldLoadOnMount(query, options) {
1214
- return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false);
1318
+ return resolveQueryBoolean(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && resolveQueryBoolean(options.retryOnMount, query) === false);
1215
1319
  }
1216
1320
  function shouldFetchOnMount(query, options) {
1217
1321
  return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);
1218
1322
  }
1219
1323
  function shouldFetchOn(query, options, field) {
1220
- if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") {
1324
+ if (resolveQueryBoolean(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") {
1221
1325
  const value = typeof field === "function" ? field(query) : field;
1222
1326
  return value === "always" || value !== false && isStale(query, options);
1223
1327
  }
1224
1328
  return false;
1225
1329
  }
1226
1330
  function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
1227
- return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
1331
+ return (query !== prevQuery || resolveQueryBoolean(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
1228
1332
  }
1229
1333
  function isStale(query, options) {
1230
- return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));
1334
+ return resolveQueryBoolean(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));
1231
1335
  }
1232
1336
  function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
1233
1337
  if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) return true;
1234
1338
  return false;
1235
1339
  }
1236
1340
  //#endregion
1237
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js
1238
- function infiniteQueryBehavior(pages) {
1239
- return { onFetch: (context, query) => {
1240
- const options = context.options;
1241
- const direction = context.fetchOptions?.meta?.fetchMore?.direction;
1242
- const oldPages = context.state.data?.pages || [];
1243
- const oldPageParams = context.state.data?.pageParams || [];
1244
- let result = {
1245
- pages: [],
1246
- pageParams: []
1247
- };
1248
- let currentPage = 0;
1249
- const fetchFn = async () => {
1250
- let cancelled = false;
1251
- const addSignalProperty = (object) => {
1252
- addConsumeAwareSignal(object, () => context.signal, () => cancelled = true);
1253
- };
1254
- const queryFn = ensureQueryFn(context.options, context.fetchOptions);
1255
- const fetchPage = async (data, param, previous) => {
1256
- if (cancelled) return Promise.reject();
1257
- if (param == null && data.pages.length) return Promise.resolve(data);
1258
- const createQueryFnContext = () => {
1259
- const queryFnContext2 = {
1260
- client: context.client,
1261
- queryKey: context.queryKey,
1262
- pageParam: param,
1263
- direction: previous ? "backward" : "forward",
1264
- meta: context.options.meta
1265
- };
1266
- addSignalProperty(queryFnContext2);
1267
- return queryFnContext2;
1268
- };
1269
- const page = await queryFn(createQueryFnContext());
1270
- const { maxPages } = context.options;
1271
- const addTo = previous ? addToStart : addToEnd;
1272
- return {
1273
- pages: addTo(data.pages, page, maxPages),
1274
- pageParams: addTo(data.pageParams, param, maxPages)
1275
- };
1276
- };
1277
- if (direction && oldPages.length) {
1278
- const previous = direction === "backward";
1279
- const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;
1280
- const oldData = {
1281
- pages: oldPages,
1282
- pageParams: oldPageParams
1283
- };
1284
- result = await fetchPage(oldData, pageParamFn(options, oldData), previous);
1285
- } else {
1286
- const remainingPages = pages ?? oldPages.length;
1287
- do {
1288
- const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);
1289
- if (currentPage > 0 && param == null) break;
1290
- result = await fetchPage(result, param);
1291
- currentPage++;
1292
- } while (currentPage < remainingPages);
1293
- }
1294
- return result;
1295
- };
1296
- if (context.options.persister) context.fetchFn = () => {
1297
- return context.options.persister?.(fetchFn, {
1298
- client: context.client,
1299
- queryKey: context.queryKey,
1300
- meta: context.options.meta,
1301
- signal: context.signal
1302
- }, query);
1303
- };
1304
- else context.fetchFn = fetchFn;
1305
- } };
1306
- }
1307
- function getNextPageParam(options, { pages, pageParams }) {
1308
- const lastIndex = pages.length - 1;
1309
- return pages.length > 0 ? options.getNextPageParam(pages[lastIndex], pages, pageParams[lastIndex], pageParams) : void 0;
1310
- }
1311
- function getPreviousPageParam(options, { pages, pageParams }) {
1312
- return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;
1313
- }
1314
- //#endregion
1315
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutation.js
1341
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/mutation.js
1316
1342
  var Mutation = class extends Removable {
1317
1343
  #client;
1318
1344
  #observers;
@@ -1526,7 +1552,7 @@ function getDefaultState() {
1526
1552
  };
1527
1553
  }
1528
1554
  //#endregion
1529
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutationCache.js
1555
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/mutationCache.js
1530
1556
  var MutationCache = class extends Subscribable {
1531
1557
  constructor(config = {}) {
1532
1558
  super();
@@ -1633,7 +1659,7 @@ function scopeFor(mutation) {
1633
1659
  return mutation.options.scope?.id;
1634
1660
  }
1635
1661
  //#endregion
1636
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutationObserver.js
1662
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/mutationObserver.js
1637
1663
  var MutationObserver = class extends Subscribable {
1638
1664
  #client;
1639
1665
  #currentResult = void 0;
@@ -1737,7 +1763,7 @@ var MutationObserver = class extends Subscribable {
1737
1763
  }
1738
1764
  };
1739
1765
  //#endregion
1740
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryCache.js
1766
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/queryCache.js
1741
1767
  var QueryCache = class extends Subscribable {
1742
1768
  constructor(config = {}) {
1743
1769
  super();
@@ -1829,7 +1855,7 @@ var QueryCache = class extends Subscribable {
1829
1855
  }
1830
1856
  };
1831
1857
  //#endregion
1832
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryClient.js
1858
+ //#region ../../node_modules/.pnpm/@tanstack+query-core@5.101.0/node_modules/@tanstack/query-core/build/modern/queryClient.js
1833
1859
  var QueryClient = class {
1834
1860
  #queryCache;
1835
1861
  #mutationCache;
@@ -1986,14 +2012,14 @@ var QueryClient = class {
1986
2012
  return this.fetchQuery(options).then(noop).catch(noop);
1987
2013
  }
1988
2014
  fetchInfiniteQuery(options) {
1989
- options.behavior = infiniteQueryBehavior(options.pages);
2015
+ options._type = "infinite";
1990
2016
  return this.fetchQuery(options);
1991
2017
  }
1992
2018
  prefetchInfiniteQuery(options) {
1993
2019
  return this.fetchInfiniteQuery(options).then(noop).catch(noop);
1994
2020
  }
1995
2021
  ensureInfiniteQueryData(options) {
1996
- options.behavior = infiniteQueryBehavior(options.pages);
2022
+ options._type = "infinite";
1997
2023
  return this.ensureQueryData(options);
1998
2024
  }
1999
2025
  resumePausedMutations() {
@@ -2070,4 +2096,4 @@ var QueryClient = class {
2070
2096
  }
2071
2097
  };
2072
2098
  //#endregion
2073
- export { isServer as a, notifyManager as i, MutationObserver as n, noop as o, QueryObserver as r, shouldThrowError as s, QueryClient as t };
2099
+ export { environmentManager as a, notifyManager as i, MutationObserver as n, noop as o, QueryObserver as r, shouldThrowError as s, QueryClient as t };